From bbabf2d110680c6ed155ef639d0a6b0285cceb88 Mon Sep 17 00:00:00 2001 From: kvhnuke Date: Mon, 30 May 2016 22:16:39 -0700 Subject: [PATCH] beautifying tayvano's code but really impressive what she did :) --- app/scripts/controllers/theDaoProposalCtrl.js | 78 +- app/scripts/controllers/thedaoCtrl.js | 4 +- app/scripts/globalFuncs.js | 8 +- chrome-extension/js/etherwallet-master-min.js | 9985 ++++++++--------- chrome-extension/js/etherwallet-master.js | 9985 ++++++++--------- dist/js/etherwallet-master-min.js | 9985 ++++++++--------- dist/js/etherwallet-master.js | 9985 ++++++++--------- 7 files changed, 19848 insertions(+), 20182 deletions(-) diff --git a/app/scripts/controllers/theDaoProposalCtrl.js b/app/scripts/controllers/theDaoProposalCtrl.js index e086ca7b46..16b219a450 100644 --- a/app/scripts/controllers/theDaoProposalCtrl.js +++ b/app/scripts/controllers/theDaoProposalCtrl.js @@ -64,73 +64,22 @@ var theDaoProposalCtrl = function($scope, $sce, walletService) { } $scope.filters = { + id: globalFuncs.urlGet('id') != null ? parseInt(globalFuncs.urlGet('id')) : '', + open: globalFuncs.urlGet('open') != null ? globalFuncs.urlGet('open') : '', + split: globalFuncs.urlGet('split') != null ? globalFuncs.urlGet('split') : '', + description: globalFuncs.urlGet('description') != null ? globalFuncs.urlGet('description') : '' }; - - if (globalFuncs.urlGet('id') == null) { - $scope.comparator = false; - } else { - $scope.filters.id = parseInt(globalFuncs.urlGet('id')); - $scope.comparator = true; - } - - if (globalFuncs.urlGet('open') == null) { - } else { - $scope.filters.open = globalFuncs.urlGet('open'); - $scope.comparator = false; - } - - if (globalFuncs.urlGet('split') == null) { - } else { - $scope.filters.split = globalFuncs.urlGet('split'); - $scope.comparator = false; - } - - if (globalFuncs.urlGet('description') == null) { - } else { - $scope.filters.description = globalFuncs.urlGet('description'); - $scope.comparator = false; - } - - if (globalFuncs.urlGet('id') == null && globalFuncs.urlGet('open') == null && globalFuncs.urlGet('split') == null && globalFuncs.urlGet('description') == null ) { + $scope.comparator = globalFuncs.urlGet('id') != null; + if ($scope.filters.id == '' && $scope.filters.open == '' && $scope.filters.split == '' && $scope.filters.description == '' ) { $scope.filters.split = 'false'; $scope.filters.open = 'true'; - $scope.comparator = false; } - $scope.$watch('filters.id', function() { - if ($scope.filters.id == '') { - $scope.comparator = false; - $scope.filters.id = ''; - } - if ($scope.filters.id == null) { - $scope.comparator = false; - } - console.log("split: " + JSON.stringify($scope.filters)); - console.log("split: comparator: " + $scope.comparator); - }); - - $scope.$watch('filters.open', function() { - if ($scope.filters.open == null) {} else { - $scope.comparator = false; - $scope.filters.id = ''; - } - console.log("open: " + JSON.stringify($scope.filters)); - console.log("open: comparator: " + $scope.comparator); - }); - $scope.$watch('filters.split', function() { - if ($scope.filters.split == null) {} else { - $scope.comparator = false; - $scope.filters.id = ''; - } - console.log("split: " + JSON.stringify($scope.filters)); - console.log("split: comparator: " + $scope.comparator); - }); - - console.log("load: " + JSON.stringify($scope.filters)); - console.log("load: comparator: " + $scope.comparator); - - - + $scope.$watch('filters', function(newValue, oldValue) { + if ((newValue.id!=oldValue.id)&&($scope.filters.id == '' || $scope.filters.id == null)) $scope.comparator = false; + if (newValue.open!=oldValue.open && $scope.filters.open == '') $scope.filters.id = ''; + if (newValue.split!=oldValue.split && $scope.filters.split != '') $scope.filters.id = ''; + }, true); $scope.initValues(); $scope.showProposal = function(id) { if (!$scope.AllProposals[id].showprop) { @@ -169,7 +118,7 @@ var theDaoProposalCtrl = function($scope, $sce, walletService) { recipient: '0x' + proposal[0], amount: etherUnits.toEther('0x' + proposal[1], 'wei'), content: proposal[12] == "0" ? "" : proposal.slice(13).join(), - description: proposal[12] == "0" ? "Propsoal ID #" + tProposal.proposalID : globalFuncs.hexToAscii(proposal.slice(13).join('')).replace(/
/g, '\n').replace(/\\n/g, '\n'), + description: proposal[12] == "0" ? "Propsoal ID #" + tProposal.proposalID : globalFuncs.stripTags(globalFuncs.hexToAscii(proposal.slice(13).join('')).replace(/
/g, '\n').replace(/\\n/g, '\n')), votingDeadline: new Date(new BigNumber("0x" + proposal[3]).toNumber() * 1000), today: new Date(), open: proposal[4] == '1' ? true : false, @@ -203,10 +152,9 @@ var theDaoProposalCtrl = function($scope, $sce, walletService) { if (objProposal.description.indexOf('\n') > 0) { var firstLine = objProposal.description.substring(0, objProposal.description.indexOf('\n')); - objProposal.descriptionHTML = $sce.trustAsHtml(globalFuncs.stripTags(marked(objProposal.description.substring(firstLine.length + 1) || ""))); + objProposal.descriptionHTML = $sce.trustAsHtml(marked(objProposal.description.substring(firstLine.length + 1) || "")); objProposal.description = firstLine; } - return objProposal; } $scope.generateTx = function() { diff --git a/app/scripts/controllers/thedaoCtrl.js b/app/scripts/controllers/thedaoCtrl.js index 4893a101bb..36a7778c39 100644 --- a/app/scripts/controllers/thedaoCtrl.js +++ b/app/scripts/controllers/thedaoCtrl.js @@ -123,7 +123,7 @@ var theDaoCtrl = function($scope, $sce, walletService) { recipient: '0x' + proposal[0], amount: etherUnits.toEther('0x' + proposal[1], 'wei'), content: proposal[12] == "0" ? "" : proposal.slice(13).join(), - description: proposal[12] == "0" ? "Propsoal ID #" + $scope.proposalId : globalFuncs.hexToAscii(proposal.slice(13).join('')).replace(/
/g, '\n').replace(/\\n/g, '\n'), + description: proposal[12] == "0" ? "Propsoal ID #" + $scope.proposalId : globalFuncs.stripTags(globalFuncs.hexToAscii(proposal.slice(13).join('')).replace(/
/g, '\n').replace(/\\n/g, '\n')), votingDeadline: new Date(new BigNumber("0x" + proposal[3]).toNumber() * 1000), today: new Date(), open: proposal[4] == '1' ? true : false, @@ -158,7 +158,7 @@ var theDaoCtrl = function($scope, $sce, walletService) { if ($scope.objProposal.description.indexOf('\n') > 0) { var firstLine = $scope.objProposal.description.substring(0, $scope.objProposal.description.indexOf('\n')); - $scope.objProposal.descriptionHTML = $sce.trustAsHtml(globalFuncs.stripTags(marked($scope.objProposal.description.substring(firstLine.length + 1) || ""))); + $scope.objProposal.descriptionHTML = $sce.trustAsHtml(marked($scope.objProposal.description.substring(firstLine.length + 1) || "")); $scope.objProposal.description = firstLine; } } diff --git a/app/scripts/globalFuncs.js b/app/scripts/globalFuncs.js index 1e631e6c64..42dc09b042 100644 --- a/app/scripts/globalFuncs.js +++ b/app/scripts/globalFuncs.js @@ -77,13 +77,7 @@ globalFuncs.checkAndRedirectHTTPS = function() { if ((host == window.location.host || githost == window.location.host || hostw == window.location.host || githostw == window.location.host) && (window.location.protocol != "https:")) window.location.protocol = "https"; } globalFuncs.isStrongPass = function(password) { - if (password.length > 8) { - return true; - } else { - return false; - } - //var re = /(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}/; - //return re.test(password); + return password.length > 8; } globalFuncs.hexToAscii = function(hex) { return hex.match(/.{1,2}/g).map(function(v) { diff --git a/chrome-extension/js/etherwallet-master-min.js b/chrome-extension/js/etherwallet-master-min.js index 2a3341a1f5..6272e000ba 100644 --- a/chrome-extension/js/etherwallet-master-min.js +++ b/chrome-extension/js/etherwallet-master-min.js @@ -1,2532 +1,2474 @@ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o0) - ajaxReq.queuePost(); - }); -} -ajaxReq.post = function(data, callback) { - this.pendingPosts.push({ - data: data, - callback: callback - }); - if(this.pendingPosts.length==1) - this.queuePost(); -} -ajaxReq.getETHvalue = function(callback) { - var prefix = "eth"; - this.http.get(this.COINMARKETCAPAPI + prefix).then(function(data) { - data = data['data']['price']; - var priceObj = { - usd: data['usd'].toFixed(6), - eur: data['eur'].toFixed(6), - btc: data['btc'].toFixed(6) - }; - callback(priceObj); - }); -} -ajaxReq.getDAOProposals = function(callback) { - this.http.get(this.DAOPROPOSALSURL).then(function(data) { - callback(data.data); - }); -} +'use strict'; +var http; +var ajaxReq = function() {} +ajaxReq.http = null; +ajaxReq.postSerializer = null; +ajaxReq.SERVERURL = "https://rpc.myetherwallet.com/api.php"; +ajaxReq.DAOPROPOSALSURL = "https://rpc.myetherwallet.com/TheDAO/getDAOProposals.php"; +ajaxReq.COINMARKETCAPAPI = "https://coinmarketcap-nexuist.rhcloud.com/api/"; +ajaxReq.pendingPosts = []; +ajaxReq.config = { + headers: { + 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' + } +}; +ajaxReq.getBalance = function(addr, callback) { + this.post({ + balance: addr + }, callback); +} +ajaxReq.getTransactionData = function(addr, callback) { + this.post({ + txdata: addr + }, callback); +} +ajaxReq.sendRawTx = function(rawTx, callback) { + this.post({ + rawtx: rawTx + }, callback); +} +ajaxReq.getEstimatedGas = function(txobj, callback) { + this.post({ + estimatedGas: txobj + }, callback); +} +ajaxReq.getEthCall = function(txobj, callback) { + this.post({ + ethCall: txobj + }, callback); +} +ajaxReq.queuePost = function() { + var data = this.pendingPosts[0].data; + var callback = this.pendingPosts[0].callback; + this.http.post(this.SERVERURL, this.postSerializer(data), this.config).then(function(data) { + callback(data.data); + ajaxReq.pendingPosts.splice(0, 1); + if(ajaxReq.pendingPosts.length>0) + ajaxReq.queuePost(); + }); +} +ajaxReq.post = function(data, callback) { + this.pendingPosts.push({ + data: data, + callback: callback + }); + if(this.pendingPosts.length==1) + this.queuePost(); +} +ajaxReq.getETHvalue = function(callback) { + var prefix = "eth"; + this.http.get(this.COINMARKETCAPAPI + prefix).then(function(data) { + data = data['data']['price']; + var priceObj = { + usd: data['usd'].toFixed(6), + eur: data['eur'].toFixed(6), + btc: data['btc'].toFixed(6) + }; + callback(priceObj); + }); +} +ajaxReq.getDAOProposals = function(callback) { + this.http.get(this.DAOPROPOSALSURL).then(function(data) { + callback(data.data); + }); +} module.exports = ajaxReq; },{}],2:[function(require,module,exports){ -'use strict'; -var addWalletCtrl = function($scope, $sce) { - $scope.showBtnGen = $scope.showBtnUnlock = $scope.showBtnAdd = $scope.showBtnAddWallet = $scope.showAddWallet = $scope.requireFPass = $scope.requirePPass = $scope.showPassTxt = false; - $scope.nickNames = []; - $scope.filePassword = $scope.fileContent = ""; - $scope.wallet = null; - $scope.addAccount = { - address: "", - nickName: "", - encStr: "", - password: "" - }; - $scope.onPrivKeyChange = function() { - $scope.addWalletStats = ""; - $scope.requirePPass = $scope.manualprivkey.length == 128 || $scope.manualprivkey.length == 132; - $scope.showBtnUnlock = $scope.manualprivkey.length == 64; - }; - $scope.onPrivKeyPassChange = function() { - $scope.showBtnUnlock = $scope.privPassword.length > 6; - }; - $scope.showContent = function($fileContent) { - $scope.fileStatus = $sce.trustAsHtml(globalFuncs.getSuccessText("File Selected: " + document.getElementById('fselector').files[0].name)); - try { - $scope.requireFPass = Wallet.walletRequirePass($fileContent); - $scope.showBtnUnlock = !$scope.requireFPass; - $scope.fileContent = $fileContent; - } catch (e) { - $scope.fileStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - }; - $scope.openFileDialog = function($fileContent) { - $scope.addWalletStats = ""; - document.getElementById('fselector').click(); - }; - $scope.onFilePassChange = function() { - $scope.showBtnUnlock = $scope.filePassword.length > 6; - }; - $scope.decryptWallet = function() { - $scope.wallet = null; - $scope.addWalletStats = ""; - try { - if ($scope.walletType == "pasteprivkey" && $scope.requirePPass) { - $scope.wallet = Wallet.fromMyEtherWalletKey($scope.manualprivkey, $scope.privPassword); - $scope.addAccount.password = $scope.privPassword; - } else if ($scope.walletType == "pasteprivkey" && !$scope.requirePPass) { - $scope.wallet = new Wallet($scope.manualprivkey); - $scope.addAccount.password = ''; - } else if ($scope.walletType == "fileupload") { - $scope.wallet = Wallet.getWalletFromPrivKeyFile($scope.fileContent, $scope.filePassword); - $scope.addAccount.password = $scope.filePassword; - } - $scope.addAccount.address = $scope.wallet.getAddressString(); - } catch (e) { - $scope.addWalletStats = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[6] + e)); - } - if ($scope.wallet != null) { - $scope.addWalletStats = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[1])); - $scope.showAddWallet = true; - $scope.showPassTxt = $scope.addAccount.password == ''; - $scope.setBalance(); - } - }; - $scope.setNickNames = function() { - cxFuncs.getAllNickNames(function(nicks) { - $scope.nickNames = nicks; - }); - }; - $scope.setNickNames(); - $scope.newWalletChange = function(varStatus, shwbtn) { - if ($scope.addAccount.nickName != "" && $scope.nickNames.indexOf($scope.addAccount.nickName) == -1 && $scope.addAccount.password.length > 8) $scope[shwbtn] = true; - else $scope[shwbtn] = false; - if ($scope.nickNames.indexOf($scope.addAccount.nickName) !== -1) $scope[varStatus] = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[13])); - else $scope[varStatus] = ""; - } - $scope.watchOnlyChange = function() { - if ($scope.addAccount.address != "" && $scope.addAccount.nickName != "" && $scope.nickNames.indexOf($scope.addAccount.nickName) == -1 && ethFuncs.validateEtherAddress($scope.addAccount.address)) $scope.showBtnAdd = true; - else $scope.showBtnAdd = false; - if ($scope.addAccount.address != "" && !ethFuncs.validateEtherAddress($scope.addAccount.address)) $scope.watchOnlyStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[5])); - else if ($scope.nickNames.indexOf($scope.addAccount.nickName) !== -1) $scope.watchOnlyStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[13])); - else $scope.watchOnlyStatus = ""; - } - $scope.addWatchOnly = function() { - if ($scope.nickNames.indexOf($scope.addAccount.nickName) !== -1) { - $scope.addWalletStats = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[13])); - return; - } - cxFuncs.addWatchOnlyAddress($scope.addAccount.address, $scope.addAccount.nickName, function() { - if (chrome.runtime.lastError) { - $scope.addWalletStats = $sce.trustAsHtml(globalFuncs.getDangerText(chrome.runtime.lastError.message)); - } else { - $scope.addWalletStats = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[3] + $scope.addAccount.address)); - $scope.setNickNames(); - } - $scope.$apply(); - }); - } - $scope.isStrongPass = function(pass) { - return globalFuncs.isStrongPass(pass); - } - $scope.$watch('walletType', function() { - $scope.showBtnGen = $scope.showBtnUnlock = $scope.showBtnAdd = $scope.showAddWallet = false; - $scope.addNewNick = $scope.addNewPass = ""; - $scope.addWalletStats = ""; - }); - $scope.addWalletToStorage = function(status) { - if ($scope.nickNames.indexOf($scope.addAccount.nickName) !== -1) { - $scope[status] = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[13])); - return; - } else if($scope.nickNames.indexOf(ethUtil.toChecksumAddress($scope.addAccount.address)) !== -1){ - $scope[status] = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[16])); - return; - } - cxFuncs.addWalletToStorage($scope.addAccount.address, $scope.addAccount.encStr, $scope.addAccount.nickName, function() { - if (chrome.runtime.lastError) { - $scope[status] = $sce.trustAsHtml(globalFuncs.getDangerText(chrome.runtime.lastError.message)); - } else { - $scope[status] = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[3] + $scope.addAccount.address)); - $scope.setNickNames(); - } - $scope.$apply(); - }); - } - $scope.importWalletToStorage = function() { - var wStr = $scope.wallet.toV3($scope.addAccount.password, { - kdf: globalFuncs.kdf, - n: globalFuncs.scrypt.n - }); - $scope.addAccount.encStr = JSON.stringify(wStr); - $scope.addWalletToStorage('addStatus'); - } - $scope.generateWallet = function() { - var wallet = Wallet.generate(false); - var wStr = wallet.toV3($scope.addAccount.password, { - kdf: globalFuncs.kdf, - n: globalFuncs.scrypt.n - }); - $scope.addAccount.encStr = JSON.stringify(wStr); - $scope.addAccount.address = wallet.getAddressString(); - $scope.addWalletToStorage('addWalletStats'); - } - $scope.setBalance = function() { - ajaxReq.getBalance($scope.wallet.getAddressString(), function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.etherBalance = etherUnits.toEther(data.data.balance, 'wei'); - ajaxReq.getETHvalue(function(data) { - $scope.usdBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.usd); - $scope.eurBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.eur); - $scope.btcBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.btc); - }); - } - }); - } -}; -module.exports = addWalletCtrl; +'use strict'; +var addWalletCtrl = function($scope, $sce) { + $scope.showBtnGen = $scope.showBtnUnlock = $scope.showBtnAdd = $scope.showBtnAddWallet = $scope.showAddWallet = $scope.requireFPass = $scope.requirePPass = $scope.showPassTxt = false; + $scope.nickNames = []; + $scope.filePassword = $scope.fileContent = ""; + $scope.wallet = null; + $scope.addAccount = { + address: "", + nickName: "", + encStr: "", + password: "" + }; + $scope.onPrivKeyChange = function() { + $scope.addWalletStats = ""; + $scope.requirePPass = $scope.manualprivkey.length == 128 || $scope.manualprivkey.length == 132; + $scope.showBtnUnlock = $scope.manualprivkey.length == 64; + }; + $scope.onPrivKeyPassChange = function() { + $scope.showBtnUnlock = $scope.privPassword.length > 6; + }; + $scope.showContent = function($fileContent) { + $scope.fileStatus = $sce.trustAsHtml(globalFuncs.getSuccessText("File Selected: " + document.getElementById('fselector').files[0].name)); + try { + $scope.requireFPass = Wallet.walletRequirePass($fileContent); + $scope.showBtnUnlock = !$scope.requireFPass; + $scope.fileContent = $fileContent; + } catch (e) { + $scope.fileStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + }; + $scope.openFileDialog = function($fileContent) { + $scope.addWalletStats = ""; + document.getElementById('fselector').click(); + }; + $scope.onFilePassChange = function() { + $scope.showBtnUnlock = $scope.filePassword.length > 6; + }; + $scope.decryptWallet = function() { + $scope.wallet = null; + $scope.addWalletStats = ""; + try { + if ($scope.walletType == "pasteprivkey" && $scope.requirePPass) { + $scope.wallet = Wallet.fromMyEtherWalletKey($scope.manualprivkey, $scope.privPassword); + $scope.addAccount.password = $scope.privPassword; + } else if ($scope.walletType == "pasteprivkey" && !$scope.requirePPass) { + $scope.wallet = new Wallet($scope.manualprivkey); + $scope.addAccount.password = ''; + } else if ($scope.walletType == "fileupload") { + $scope.wallet = Wallet.getWalletFromPrivKeyFile($scope.fileContent, $scope.filePassword); + $scope.addAccount.password = $scope.filePassword; + } + $scope.addAccount.address = $scope.wallet.getAddressString(); + } catch (e) { + $scope.addWalletStats = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[6] + e)); + } + if ($scope.wallet != null) { + $scope.addWalletStats = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[1])); + $scope.showAddWallet = true; + $scope.showPassTxt = $scope.addAccount.password == ''; + $scope.setBalance(); + } + }; + $scope.setNickNames = function() { + cxFuncs.getAllNickNames(function(nicks) { + $scope.nickNames = nicks; + }); + }; + $scope.setNickNames(); + $scope.newWalletChange = function(varStatus, shwbtn) { + if ($scope.addAccount.nickName != "" && $scope.nickNames.indexOf($scope.addAccount.nickName) == -1 && $scope.addAccount.password.length > 8) $scope[shwbtn] = true; + else $scope[shwbtn] = false; + if ($scope.nickNames.indexOf($scope.addAccount.nickName) !== -1) $scope[varStatus] = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[13])); + else $scope[varStatus] = ""; + } + $scope.watchOnlyChange = function() { + if ($scope.addAccount.address != "" && $scope.addAccount.nickName != "" && $scope.nickNames.indexOf($scope.addAccount.nickName) == -1 && ethFuncs.validateEtherAddress($scope.addAccount.address)) $scope.showBtnAdd = true; + else $scope.showBtnAdd = false; + if ($scope.addAccount.address != "" && !ethFuncs.validateEtherAddress($scope.addAccount.address)) $scope.watchOnlyStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[5])); + else if ($scope.nickNames.indexOf($scope.addAccount.nickName) !== -1) $scope.watchOnlyStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[13])); + else $scope.watchOnlyStatus = ""; + } + $scope.addWatchOnly = function() { + if ($scope.nickNames.indexOf($scope.addAccount.nickName) !== -1) { + $scope.addWalletStats = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[13])); + return; + } + cxFuncs.addWatchOnlyAddress($scope.addAccount.address, $scope.addAccount.nickName, function() { + if (chrome.runtime.lastError) { + $scope.addWalletStats = $sce.trustAsHtml(globalFuncs.getDangerText(chrome.runtime.lastError.message)); + } else { + $scope.addWalletStats = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[3] + $scope.addAccount.address)); + $scope.setNickNames(); + } + $scope.$apply(); + }); + } + $scope.isStrongPass = function(pass) { + return globalFuncs.isStrongPass(pass); + } + $scope.$watch('walletType', function() { + $scope.showBtnGen = $scope.showBtnUnlock = $scope.showBtnAdd = $scope.showAddWallet = false; + $scope.addNewNick = $scope.addNewPass = ""; + $scope.addWalletStats = ""; + }); + $scope.addWalletToStorage = function(status) { + if ($scope.nickNames.indexOf($scope.addAccount.nickName) !== -1) { + $scope[status] = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[13])); + return; + } else if($scope.nickNames.indexOf(ethUtil.toChecksumAddress($scope.addAccount.address)) !== -1){ + $scope[status] = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[16])); + return; + } + cxFuncs.addWalletToStorage($scope.addAccount.address, $scope.addAccount.encStr, $scope.addAccount.nickName, function() { + if (chrome.runtime.lastError) { + $scope[status] = $sce.trustAsHtml(globalFuncs.getDangerText(chrome.runtime.lastError.message)); + } else { + $scope[status] = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[3] + $scope.addAccount.address)); + $scope.setNickNames(); + } + $scope.$apply(); + }); + } + $scope.importWalletToStorage = function() { + var wStr = $scope.wallet.toV3($scope.addAccount.password, { + kdf: globalFuncs.kdf, + n: globalFuncs.scrypt.n + }); + $scope.addAccount.encStr = JSON.stringify(wStr); + $scope.addWalletToStorage('addStatus'); + } + $scope.generateWallet = function() { + var wallet = Wallet.generate(false); + var wStr = wallet.toV3($scope.addAccount.password, { + kdf: globalFuncs.kdf, + n: globalFuncs.scrypt.n + }); + $scope.addAccount.encStr = JSON.stringify(wStr); + $scope.addAccount.address = wallet.getAddressString(); + $scope.addWalletToStorage('addWalletStats'); + } + $scope.setBalance = function() { + ajaxReq.getBalance($scope.wallet.getAddressString(), function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.etherBalance = etherUnits.toEther(data.data.balance, 'wei'); + ajaxReq.getETHvalue(function(data) { + $scope.usdBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.usd); + $scope.eurBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.eur); + $scope.btcBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.btc); + }); + } + }); + } +}; +module.exports = addWalletCtrl; },{}],3:[function(require,module,exports){ -'use strict'; -var cxDecryptWalletCtrl = function($scope, $sce, walletService) { - $scope.allWallets = []; - $scope.selectedWallet = $scope.password = ""; - $scope.setAllWallets = function() { - cxFuncs.getWalletsArr(function(wlts) { - $scope.allWallets = wlts; - $scope.updateBalance(); - $scope.$apply(); - }); - }; - $scope.updateBalance = function() { - for (var i = 0; i < $scope.allWallets.length; i++) { - $scope.setBalance($scope.allWallets[i].addr,i); - } - }; - $scope.setBalance = function(address,id) { - ajaxReq.getBalance(address, function(data) { - if (data.error) { - $scope.allWallets[id].balance = data.msg; - } else { - $scope.allWallets[id].balance = etherUnits.toEther(data.data.balance, 'wei'); - } - }); - }; - $scope.setAllWallets(); - $scope.getPrivFromAdd = function(){ - if ($scope.selectedWallet=="") throw globalFuncs.errorMsgs[5]; - for (var i = 0; i < $scope.allWallets.length; i++) { - if( $scope.allWallets[i].addr==$scope.selectedWallet) - return $scope.allWallets[i].priv; - } - throw globalFuncs.errorMsgs[14]; - } - $scope.decryptWallet = function() { - $scope.wallet=null; - $scope.decryptStatus=""; - try { - var priv = $scope.getPrivFromAdd(); - if (priv.length==132) - $scope.wallet = Wallet.fromMyEtherWalletKey(priv, $scope.password); - else - $scope.wallet = Wallet.getWalletFromPrivKeyFile(priv, $scope.password); - walletService.password = $scope.password; - walletService.wallet = $scope.wallet; - } catch (e) { - $scope.decryptStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[6] + ":" + e)); - } - if($scope.wallet!=null) $scope.decryptStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[1])); - }; -}; +'use strict'; +var cxDecryptWalletCtrl = function($scope, $sce, walletService) { + $scope.allWallets = []; + $scope.selectedWallet = $scope.password = ""; + $scope.setAllWallets = function() { + cxFuncs.getWalletsArr(function(wlts) { + $scope.allWallets = wlts; + $scope.updateBalance(); + $scope.$apply(); + }); + }; + $scope.updateBalance = function() { + for (var i = 0; i < $scope.allWallets.length; i++) { + $scope.setBalance($scope.allWallets[i].addr,i); + } + }; + $scope.setBalance = function(address,id) { + ajaxReq.getBalance(address, function(data) { + if (data.error) { + $scope.allWallets[id].balance = data.msg; + } else { + $scope.allWallets[id].balance = etherUnits.toEther(data.data.balance, 'wei'); + } + }); + }; + $scope.setAllWallets(); + $scope.getPrivFromAdd = function(){ + if ($scope.selectedWallet=="") throw globalFuncs.errorMsgs[5]; + for (var i = 0; i < $scope.allWallets.length; i++) { + if( $scope.allWallets[i].addr==$scope.selectedWallet) + return $scope.allWallets[i].priv; + } + throw globalFuncs.errorMsgs[14]; + } + $scope.decryptWallet = function() { + $scope.wallet=null; + $scope.decryptStatus=""; + try { + var priv = $scope.getPrivFromAdd(); + if (priv.length==132) + $scope.wallet = Wallet.fromMyEtherWalletKey(priv, $scope.password); + else + $scope.wallet = Wallet.getWalletFromPrivKeyFile(priv, $scope.password); + walletService.password = $scope.password; + walletService.wallet = $scope.wallet; + } catch (e) { + $scope.decryptStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[6] + ":" + e)); + } + if($scope.wallet!=null) $scope.decryptStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[1])); + }; +}; module.exports = cxDecryptWalletCtrl; },{}],4:[function(require,module,exports){ -'use strict'; -var mainPopCtrl = function($scope, $sce) { - $scope.allWallets = []; - $scope.allWatchOnly = []; - $scope.setAllWallets = function() { - cxFuncs.getWalletsArr(function(wlts) { - $scope.allWallets = wlts; - $scope.updateBalance('allWallets'); - }); - cxFuncs.getWatchOnlyArr(function(wlts) { - $scope.allWatchOnly = wlts; - $scope.updateBalance('allWatchOnly'); - $scope.$apply(); - }); - }; - $scope.updateBalance = function(varWal) { - for (var i = 0; i < $scope[varWal].length; i++) { - $scope.setBalance($scope[varWal][i].addr, i, varWal); - } - }; - $scope.setBalance = function(address, id, varWal) { - ajaxReq.getBalance(address, function(data) { - if (data.error) { - $scope[varWal][id].balance = data.msg; - } else { - $scope[varWal][id].balance = etherUnits.toEther(data.data.balance, 'wei'); - $scope[varWal][id].balanceR = new BigNumber($scope[varWal][id].balance).toPrecision(5); - } - }); - }; - $scope.setAllWallets(); -}; -module.exports = mainPopCtrl; +'use strict'; +var mainPopCtrl = function($scope, $sce) { + $scope.allWallets = []; + $scope.allWatchOnly = []; + $scope.setAllWallets = function() { + cxFuncs.getWalletsArr(function(wlts) { + $scope.allWallets = wlts; + $scope.updateBalance('allWallets'); + }); + cxFuncs.getWatchOnlyArr(function(wlts) { + $scope.allWatchOnly = wlts; + $scope.updateBalance('allWatchOnly'); + $scope.$apply(); + }); + }; + $scope.updateBalance = function(varWal) { + for (var i = 0; i < $scope[varWal].length; i++) { + $scope.setBalance($scope[varWal][i].addr, i, varWal); + } + }; + $scope.setBalance = function(address, id, varWal) { + ajaxReq.getBalance(address, function(data) { + if (data.error) { + $scope[varWal][id].balance = data.msg; + } else { + $scope[varWal][id].balance = etherUnits.toEther(data.data.balance, 'wei'); + $scope[varWal][id].balanceR = new BigNumber($scope[varWal][id].balance).toPrecision(5); + } + }); + }; + $scope.setAllWallets(); +}; +module.exports = mainPopCtrl; },{}],5:[function(require,module,exports){ -'use strict'; -var myWalletsCtrl = function($scope, $sce) { - $scope.editModal = new Modal(document.getElementById('editWallet')); - $scope.viewModal = new Modal(document.getElementById('viewWalletDetails')); - $scope.removeModal = new Modal(document.getElementById('removeWallet')); - $scope.allWallets = []; - $scope.allWatchOnly = []; - $scope.nickNames = []; - $scope.fiatVal = { - usd: 0, - eur: 0, - btc: 0 - }; - $scope.viewWallet = {}; - $scope.setNickNames = function() { - cxFuncs.getAllNickNames(function(nicks) { - $scope.nickNames = nicks; - }); - }; - $scope.setAllWallets = function() { - cxFuncs.getWalletsArr(function(wlts) { - $scope.allWallets = wlts; - $scope.updateBalance('allWallets'); - }); - cxFuncs.getWatchOnlyArr(function(wlts) { - $scope.allWatchOnly = wlts; - $scope.updateBalance('allWatchOnly'); - $scope.$apply(); - }); - }; - $scope.updateBalance = function(varWal) { - for (var i = 0; i < $scope[varWal].length; i++) { - $scope.setBalance($scope[varWal][i].addr, i, varWal); - } - }; - $scope.setBalance = function(address, id, varWal) { - ajaxReq.getBalance(address, function(data) { - if (data.error) { - $scope[varWal][id].balance = data.msg; - } else { - $scope[varWal][id].balance = etherUnits.toEther(data.data.balance, 'wei'); - $scope[varWal][id].balanceR = new BigNumber($scope[varWal][id].balance).toPrecision(5); - $scope[varWal][id].usd = etherUnits.toFiat($scope[varWal][id].balance, 'ether', $scope.fiatVal.usd); - $scope[varWal][id].eur = etherUnits.toFiat($scope[varWal][id].balance, 'ether', $scope.fiatVal.eur); - $scope[varWal][id].btc = etherUnits.toFiat($scope[varWal][id].balance, 'ether', $scope.fiatVal.btc); - } - }); - }; - $scope.setViewWalletObj = function(val, type) { - var vtype = 'allWallets'; - if (type == 'watchOnly') vtype = 'allWatchOnly' - $scope.viewWallet = { - nick: $scope[vtype][val].nick, - addr: $scope[vtype][val].addr, - id: val, - type: type - } - } - $scope.editMWallet = function(val, type) { - $scope.setViewWalletObj(val, type); - $scope.editModal.open(); - } - $scope.editSave = function() { - if ($scope.nickNames.indexOf($scope.viewWallet.nick) !== -1) { - $scope.editStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[13])); - return; - } else { - cxFuncs.editNickName($scope.viewWallet.addr, $scope.viewWallet.nick, function() { - if (chrome.runtime.lastError) $scope.editStatus = $sce.trustAsHtml(globalFuncs.getDangerText(chrome.runtime.lastError.message)); - else { - $scope.setAllWallets(); - $scope.setNickNames(); - $scope.editModal.close(); - } - }); - } - } - $scope.viewMWallet = function(val, type) { - $scope.setViewWalletObj(val, type); - $scope.viewModal.open(); - } - $scope.decryptWallet = function() { - $scope.wallet = null; - $scope.viewStatus = ""; - try { - var priv = $scope.allWallets[$scope.viewWallet.id].priv; - if (priv.length==132) - $scope.wallet = Wallet.fromMyEtherWalletKey(priv, $scope.password); - else - $scope.wallet = Wallet.getWalletFromPrivKeyFile(priv, $scope.password); - $scope.viewModal.close(); - $scope.setWalletInfo(); - $scope.password = ""; - } catch (e) { - $scope.viewStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[6] + ":" + e)); - } - }; - $scope.printQRCode = function() { - globalFuncs.printPaperWallets(JSON.stringify([{ - address: $scope.wallet.getAddressString(), - private: $scope.wallet.getPrivateKeyString() - }])); - } - $scope.resetWallet = function() { - $scope.wallet = null; - $scope.blob = $scope.blobEnc = $scope.password = ""; - } - $scope.setWalletInfo = function() { - $scope.blob = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toJSON()); - if ($scope.password != '') { - $scope.blobEnc = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toV3($scope.password, { - kdf: globalFuncs.kdf, - n: globalFuncs.scrypt.n - })); - $scope.encFileName = $scope.wallet.getV3Filename(); - } - ajaxReq.getBalance($scope.wallet.getAddressString(), function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.etherBalance = etherUnits.toEther(data.data.balance, 'wei'); - ajaxReq.getETHvalue(function(data) { - $scope.usdBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.usd); - $scope.eurBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.eur); - $scope.btcBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.btc); - }); - } - }); - } - $scope.deleteWalletMsg = function(val, type) { - $scope.setViewWalletObj(val, type); - $scope.removeModal.open(); - } - $scope.deleteWallet = function() { - cxFuncs.deleteAccount($scope.viewWallet.addr, function() { - $scope.setAllWallets(); - $scope.setNickNames(); - $scope.removeModal.close(); - }); - } - ajaxReq.getETHvalue(function(data) { - $scope.fiatVal.usd = data.usd; - $scope.fiatVal.eur = data.eur; - $scope.fiatVal.btc = data.btc; - $scope.setAllWallets(); - }); - $scope.setNickNames(); -}; +'use strict'; +var myWalletsCtrl = function($scope, $sce) { + $scope.editModal = new Modal(document.getElementById('editWallet')); + $scope.viewModal = new Modal(document.getElementById('viewWalletDetails')); + $scope.removeModal = new Modal(document.getElementById('removeWallet')); + $scope.allWallets = []; + $scope.allWatchOnly = []; + $scope.nickNames = []; + $scope.fiatVal = { + usd: 0, + eur: 0, + btc: 0 + }; + $scope.viewWallet = {}; + $scope.setNickNames = function() { + cxFuncs.getAllNickNames(function(nicks) { + $scope.nickNames = nicks; + }); + }; + $scope.setAllWallets = function() { + cxFuncs.getWalletsArr(function(wlts) { + $scope.allWallets = wlts; + $scope.updateBalance('allWallets'); + }); + cxFuncs.getWatchOnlyArr(function(wlts) { + $scope.allWatchOnly = wlts; + $scope.updateBalance('allWatchOnly'); + $scope.$apply(); + }); + }; + $scope.updateBalance = function(varWal) { + for (var i = 0; i < $scope[varWal].length; i++) { + $scope.setBalance($scope[varWal][i].addr, i, varWal); + } + }; + $scope.setBalance = function(address, id, varWal) { + ajaxReq.getBalance(address, function(data) { + if (data.error) { + $scope[varWal][id].balance = data.msg; + } else { + $scope[varWal][id].balance = etherUnits.toEther(data.data.balance, 'wei'); + $scope[varWal][id].balanceR = new BigNumber($scope[varWal][id].balance).toPrecision(5); + $scope[varWal][id].usd = etherUnits.toFiat($scope[varWal][id].balance, 'ether', $scope.fiatVal.usd); + $scope[varWal][id].eur = etherUnits.toFiat($scope[varWal][id].balance, 'ether', $scope.fiatVal.eur); + $scope[varWal][id].btc = etherUnits.toFiat($scope[varWal][id].balance, 'ether', $scope.fiatVal.btc); + } + }); + }; + $scope.setViewWalletObj = function(val, type) { + var vtype = 'allWallets'; + if (type == 'watchOnly') vtype = 'allWatchOnly' + $scope.viewWallet = { + nick: $scope[vtype][val].nick, + addr: $scope[vtype][val].addr, + id: val, + type: type + } + } + $scope.editMWallet = function(val, type) { + $scope.setViewWalletObj(val, type); + $scope.editModal.open(); + } + $scope.editSave = function() { + if ($scope.nickNames.indexOf($scope.viewWallet.nick) !== -1) { + $scope.editStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[13])); + return; + } else { + cxFuncs.editNickName($scope.viewWallet.addr, $scope.viewWallet.nick, function() { + if (chrome.runtime.lastError) $scope.editStatus = $sce.trustAsHtml(globalFuncs.getDangerText(chrome.runtime.lastError.message)); + else { + $scope.setAllWallets(); + $scope.setNickNames(); + $scope.editModal.close(); + } + }); + } + } + $scope.viewMWallet = function(val, type) { + $scope.setViewWalletObj(val, type); + $scope.viewModal.open(); + } + $scope.decryptWallet = function() { + $scope.wallet = null; + $scope.viewStatus = ""; + try { + var priv = $scope.allWallets[$scope.viewWallet.id].priv; + if (priv.length==132) + $scope.wallet = Wallet.fromMyEtherWalletKey(priv, $scope.password); + else + $scope.wallet = Wallet.getWalletFromPrivKeyFile(priv, $scope.password); + $scope.viewModal.close(); + $scope.setWalletInfo(); + $scope.password = ""; + } catch (e) { + $scope.viewStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[6] + ":" + e)); + } + }; + $scope.printQRCode = function() { + globalFuncs.printPaperWallets(JSON.stringify([{ + address: $scope.wallet.getAddressString(), + private: $scope.wallet.getPrivateKeyString() + }])); + } + $scope.resetWallet = function() { + $scope.wallet = null; + $scope.blob = $scope.blobEnc = $scope.password = ""; + } + $scope.setWalletInfo = function() { + $scope.blob = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toJSON()); + if ($scope.password != '') { + $scope.blobEnc = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toV3($scope.password, { + kdf: globalFuncs.kdf, + n: globalFuncs.scrypt.n + })); + $scope.encFileName = $scope.wallet.getV3Filename(); + } + ajaxReq.getBalance($scope.wallet.getAddressString(), function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.etherBalance = etherUnits.toEther(data.data.balance, 'wei'); + ajaxReq.getETHvalue(function(data) { + $scope.usdBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.usd); + $scope.eurBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.eur); + $scope.btcBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.btc); + }); + } + }); + } + $scope.deleteWalletMsg = function(val, type) { + $scope.setViewWalletObj(val, type); + $scope.removeModal.open(); + } + $scope.deleteWallet = function() { + cxFuncs.deleteAccount($scope.viewWallet.addr, function() { + $scope.setAllWallets(); + $scope.setNickNames(); + $scope.removeModal.close(); + }); + } + ajaxReq.getETHvalue(function(data) { + $scope.fiatVal.usd = data.usd; + $scope.fiatVal.eur = data.eur; + $scope.fiatVal.btc = data.btc; + $scope.setAllWallets(); + }); + $scope.setNickNames(); +}; module.exports = myWalletsCtrl; },{}],6:[function(require,module,exports){ -'use strict'; -var quickSendCtrl = function($scope, $sce) { - $scope.allWallets = []; - $scope.selectedWallet = ""; - $scope.showConfirm = false; - $scope.tx = { - gasLimit: globalFuncs.defaultTxGasLimit, - data: "", - to: "", - unit: "ether", - value: "", - nonce: null, - gasPrice: null, - donate: false - } - $scope.setAllWallets = function() { - cxFuncs.getWalletsArr(function(wlts) { - $scope.allWallets = wlts; - $scope.updateBalance('allWallets'); - }); - }; - $scope.updateBalance = function(varWal) { - for (var i = 0; i < $scope[varWal].length; i++) { - $scope.setBalance($scope[varWal][i].addr, i, varWal); - } - }; - $scope.setBalance = function(address, id, varWal) { - ajaxReq.getBalance(address, function(data) { - if (data.error) { - $scope[varWal][id].balance = data.msg; - } else { - $scope[varWal][id].balance = etherUnits.toEther(data.data.balance, 'wei'); - $scope[varWal][id].balanceR = new BigNumber($scope[varWal][id].balance).toPrecision(5); - } - }); - }; - $scope.validateAddress = function() { - if (ethFuncs.validateEtherAddress($scope.tx.to)) { - $scope.validateAddressStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[0])); - } else { - $scope.validateAddressStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[5])); - } - } - $scope.transferAllBalance = function() { - $scope.wallet = {}; - $scope.wallet.getAddressString = function() { - return $scope.allWallets[$scope.selectedWallet].addr; - } - uiFuncs.transferAllBalance($scope, $sce); - } - $scope.prepTX = function() { - try { - if (!ethFuncs.validateEtherAddress($scope.tx.to)) throw globalFuncs.errorMsgs[5]; - else if (!globalFuncs.isNumeric($scope.tx.value) || parseFloat($scope.tx.value) < 0) throw globalFuncs.errorMsgs[7]; - $scope.showConfirm = true; - } catch (e) { - $scope.prepTXStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - } - $scope.unlockAndSend = function() { - try { - $scope.decryptWallet(); - $scope.autoSend = true; - uiFuncs.generateTx($scope, $sce); - $scope.validateTxStatus = ""; - } catch (e) { - $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - } - $scope.decryptWallet = function() { - $scope.wallet = null; - $scope.validateTxStatus = ""; - $scope.wallet = Wallet.getWalletFromPrivKeyFile($scope.allWallets[$scope.selectedWallet].priv, $scope.password); - }; - $scope.setAllWallets(); -}; +'use strict'; +var quickSendCtrl = function($scope, $sce) { + $scope.allWallets = []; + $scope.selectedWallet = ""; + $scope.showConfirm = false; + $scope.tx = { + gasLimit: globalFuncs.defaultTxGasLimit, + data: "", + to: "", + unit: "ether", + value: "", + nonce: null, + gasPrice: null, + donate: false + } + $scope.setAllWallets = function() { + cxFuncs.getWalletsArr(function(wlts) { + $scope.allWallets = wlts; + $scope.updateBalance('allWallets'); + }); + }; + $scope.updateBalance = function(varWal) { + for (var i = 0; i < $scope[varWal].length; i++) { + $scope.setBalance($scope[varWal][i].addr, i, varWal); + } + }; + $scope.setBalance = function(address, id, varWal) { + ajaxReq.getBalance(address, function(data) { + if (data.error) { + $scope[varWal][id].balance = data.msg; + } else { + $scope[varWal][id].balance = etherUnits.toEther(data.data.balance, 'wei'); + $scope[varWal][id].balanceR = new BigNumber($scope[varWal][id].balance).toPrecision(5); + } + }); + }; + $scope.validateAddress = function() { + if (ethFuncs.validateEtherAddress($scope.tx.to)) { + $scope.validateAddressStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[0])); + } else { + $scope.validateAddressStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[5])); + } + } + $scope.transferAllBalance = function() { + $scope.wallet = {}; + $scope.wallet.getAddressString = function() { + return $scope.allWallets[$scope.selectedWallet].addr; + } + uiFuncs.transferAllBalance($scope, $sce); + } + $scope.prepTX = function() { + try { + if (!ethFuncs.validateEtherAddress($scope.tx.to)) throw globalFuncs.errorMsgs[5]; + else if (!globalFuncs.isNumeric($scope.tx.value) || parseFloat($scope.tx.value) < 0) throw globalFuncs.errorMsgs[7]; + $scope.showConfirm = true; + } catch (e) { + $scope.prepTXStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + } + $scope.unlockAndSend = function() { + try { + $scope.decryptWallet(); + $scope.autoSend = true; + uiFuncs.generateTx($scope, $sce); + $scope.validateTxStatus = ""; + } catch (e) { + $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + } + $scope.decryptWallet = function() { + $scope.wallet = null; + $scope.validateTxStatus = ""; + $scope.wallet = Wallet.getWalletFromPrivKeyFile($scope.allWallets[$scope.selectedWallet].priv, $scope.password); + }; + $scope.setAllWallets(); +}; module.exports = quickSendCtrl; },{}],7:[function(require,module,exports){ -'use strict'; -var bulkGenCtrl = function($scope) { - $scope.showWallets = false; - $scope.genWallets = function(){ - if($scope.amount==''||$scope.amount != parseInt($scope.amount, 10)) alert(globalFuncs.errorMsgs[0]); - else { - $scope.wallets = []; - var csv = ''; var txt = ''; - $scope.jsonWallets = []; - for(var i=0;i<$scope.amount;i++){ - var tWallet = Wallet.generate(false); - csv += tWallet.getChecksumAddressString() + ',' + tWallet.getPrivateKeyString() + '\n'; - txt += tWallet.getChecksumAddressString() + '\t' + tWallet.getPrivateKeyString() + '\n'; - $scope.jsonWallets.push({ - address: tWallet.getChecksumAddressString(), - private: tWallet.getPrivateKeyString() - }); - $scope.wallets.push(tWallet); - } - $scope.showWallets = true; - $scope.bJSON = globalFuncs.getBlob("text/json;charset=UTF-8",JSON.stringify($scope.jsonWallets)); - $scope.bTXT = globalFuncs.getBlob("text/plain;charset=UTF-8",txt); - $scope.bCSV = globalFuncs.getBlob("text/csv;charset=UTF-8",csv); - } - } - $scope.printQRCode = function() { - globalFuncs.printPaperWallets(JSON.stringify($scope.jsonWallets)); - } -}; +'use strict'; +var bulkGenCtrl = function($scope) { + $scope.showWallets = false; + $scope.genWallets = function(){ + if($scope.amount==''||$scope.amount != parseInt($scope.amount, 10)) alert(globalFuncs.errorMsgs[0]); + else { + $scope.wallets = []; + var csv = ''; var txt = ''; + $scope.jsonWallets = []; + for(var i=0;i<$scope.amount;i++){ + var tWallet = Wallet.generate(false); + csv += tWallet.getChecksumAddressString() + ',' + tWallet.getPrivateKeyString() + '\n'; + txt += tWallet.getChecksumAddressString() + '\t' + tWallet.getPrivateKeyString() + '\n'; + $scope.jsonWallets.push({ + address: tWallet.getChecksumAddressString(), + private: tWallet.getPrivateKeyString() + }); + $scope.wallets.push(tWallet); + } + $scope.showWallets = true; + $scope.bJSON = globalFuncs.getBlob("text/json;charset=UTF-8",JSON.stringify($scope.jsonWallets)); + $scope.bTXT = globalFuncs.getBlob("text/plain;charset=UTF-8",txt); + $scope.bCSV = globalFuncs.getBlob("text/csv;charset=UTF-8",csv); + } + } + $scope.printQRCode = function() { + globalFuncs.printPaperWallets(JSON.stringify($scope.jsonWallets)); + } +}; module.exports = bulkGenCtrl; },{}],8:[function(require,module,exports){ -'use strict'; -var decryptWalletCtrl = function($scope, $sce, walletService) { - $scope.walletType = ""; - $scope.requireFPass = $scope.requirePPass = $scope.showFDecrypt = $scope.showPDecrypt = false; - $scope.filePassword = ""; - $scope.fileContent = ""; - $scope.showContent = function($fileContent) { - $scope.fileStatus = $sce.trustAsHtml(globalFuncs.getSuccessText("File Selected: " + document.getElementById('fselector').files[0].name)); - try { - $scope.requireFPass = Wallet.walletRequirePass($fileContent); - $scope.showFDecrypt = !$scope.requireFPass; - $scope.fileContent = $fileContent; - } catch (e) { - $scope.fileStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - }; - $scope.openFileDialog = function($fileContent) { - document.getElementById('fselector').click(); - }; - $scope.onFilePassChange = function() { - $scope.showFDecrypt = $scope.filePassword.length > 3; - }; - $scope.onPrivKeyChange = function() { - $scope.requirePPass = $scope.manualprivkey.length == 128 || $scope.manualprivkey.length == 132; - $scope.showPDecrypt = $scope.manualprivkey.length == 64; - }; - $scope.onPrivKeyPassChange = function() { - $scope.showPDecrypt = $scope.privPassword.length > 6; - }; - $scope.decryptWallet = function() { - $scope.wallet=null; - $scope.decryptStatus=""; - try { - if ($scope.showPDecrypt && $scope.requirePPass) { - $scope.wallet = Wallet.fromMyEtherWalletKey($scope.manualprivkey, $scope.privPassword); - walletService.password = $scope.privPassword; - } else if ($scope.showPDecrypt && !$scope.requirePPass) { - $scope.wallet = new Wallet($scope.manualprivkey); - walletService.password = ''; - } else if ($scope.showFDecrypt) { - $scope.wallet = Wallet.getWalletFromPrivKeyFile($scope.fileContent, $scope.filePassword); - walletService.password = $scope.filePassword; - } - walletService.wallet = $scope.wallet; - } catch (e) { - $scope.decryptStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[6]+e)); - } - if($scope.wallet!=null) $scope.decryptStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[1])); - }; -}; +'use strict'; +var decryptWalletCtrl = function($scope, $sce, walletService) { + $scope.walletType = ""; + $scope.requireFPass = $scope.requirePPass = $scope.showFDecrypt = $scope.showPDecrypt = false; + $scope.filePassword = ""; + $scope.fileContent = ""; + $scope.showContent = function($fileContent) { + $scope.fileStatus = $sce.trustAsHtml(globalFuncs.getSuccessText("File Selected: " + document.getElementById('fselector').files[0].name)); + try { + $scope.requireFPass = Wallet.walletRequirePass($fileContent); + $scope.showFDecrypt = !$scope.requireFPass; + $scope.fileContent = $fileContent; + } catch (e) { + $scope.fileStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + }; + $scope.openFileDialog = function($fileContent) { + document.getElementById('fselector').click(); + }; + $scope.onFilePassChange = function() { + $scope.showFDecrypt = $scope.filePassword.length > 3; + }; + $scope.onPrivKeyChange = function() { + $scope.requirePPass = $scope.manualprivkey.length == 128 || $scope.manualprivkey.length == 132; + $scope.showPDecrypt = $scope.manualprivkey.length == 64; + }; + $scope.onPrivKeyPassChange = function() { + $scope.showPDecrypt = $scope.privPassword.length > 6; + }; + $scope.decryptWallet = function() { + $scope.wallet=null; + $scope.decryptStatus=""; + try { + if ($scope.showPDecrypt && $scope.requirePPass) { + $scope.wallet = Wallet.fromMyEtherWalletKey($scope.manualprivkey, $scope.privPassword); + walletService.password = $scope.privPassword; + } else if ($scope.showPDecrypt && !$scope.requirePPass) { + $scope.wallet = new Wallet($scope.manualprivkey); + walletService.password = ''; + } else if ($scope.showFDecrypt) { + $scope.wallet = Wallet.getWalletFromPrivKeyFile($scope.fileContent, $scope.filePassword); + walletService.password = $scope.filePassword; + } + walletService.wallet = $scope.wallet; + } catch (e) { + $scope.decryptStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[6]+e)); + } + if($scope.wallet!=null) $scope.decryptStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[1])); + }; +}; module.exports = decryptWalletCtrl; },{}],9:[function(require,module,exports){ -'use strict'; -var digixCtrl = function($scope, $sce, walletService) { - new Modal(document.getElementById('sendTransaction')); - walletService.wallet = null; - walletService.password = ''; - $scope.showSend = true; - $scope.showRaw = false; - $scope.digixContract = "0xf0160428a8552ac9bb7e050d90eeade4ddd52843"; - $scope.tokenContract = "0xe0b7927c4af23765cb51314a0e0521a9645f0e2a"; - $scope.badgeContract = "0x54bda709fed875224eae569bb6817d96ef7ed9ad"; - $scope.digixUserInfo = "0x1959a002"; - $scope.digixClaim = "0x4e71d92d"; - $scope.digixTransfer = "0xa9059cbb"; - $scope.balanceOf = "0x70a08231"; - $scope.tx = { - gasLimit: globalFuncs.digixClaimTxGasLimit, - data: $scope.digixClaim, - to: $scope.digixContract, - unit: "ether", - value: 0, - nonce: null, - gasPrice: null, - donate: false - } - $scope.tokenTx = { - to: '', - value: 0, - unit: "dgd" - } - $scope.$watch(function() { - if (walletService.wallet == null) return null; - return walletService.wallet.getAddressString(); - }, function() { - if (walletService.wallet == null) return; - $scope.wallet = walletService.wallet; - $scope.setBalance(); - }); - $scope.validateAddress = function(address, status) { - if (ethFuncs.validateEtherAddress(address)) { - $scope[status] = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[0])); - } else { - $scope[status] = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[5])); - } - } - $scope.setBalance = function() { - var tUserInfo = { - to: $scope.digixContract, - data: $scope.digixUserInfo - }; - ajaxReq.getBalance($scope.wallet.getAddressString(), function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.etherBalance = etherUnits.toEther(data.data.balance, 'wei'); - ajaxReq.getETHvalue(function(data) { - $scope.usdBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.usd); - $scope.eurBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.eur); - $scope.btcBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.btc); - }); - } - }); - var userInfo = ethFuncs.getDataObj($scope.digixContract, $scope.digixUserInfo, [ethFuncs.getNakedAddress($scope.wallet.getAddressString())]); - ajaxReq.getEthCall(userInfo, function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - var digixObj = $scope.processDigixInfo(data.data); - $scope.centsTotal = digixObj.centstotal; - $scope.weiTotal = digixObj.weitotal; - $scope.shareTotal = digixObj.share; - $scope.badgesTotal = digixObj.badges; - $scope.claimedTotal = digixObj.claimed.toString(); - } - }); - var tokenBalance = ethFuncs.getDataObj($scope.tokenContract, $scope.balanceOf, [ethFuncs.getNakedAddress($scope.wallet.getAddressString())]); - ajaxReq.getEthCall(tokenBalance, function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.tokenBalance = new BigNumber(data.data).div(1000000000).toString(); - } - }); - var badgeBalance = ethFuncs.getDataObj($scope.badgeContract, $scope.balanceOf, [ethFuncs.getNakedAddress($scope.wallet.getAddressString())]); - ajaxReq.getEthCall(badgeBalance, function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.badgeBalance = new BigNumber(data.data).toString(); - } - }); - } - $scope.processDigixInfo = function(data) { - data = data.replace('0x', ''); - var values = data.match(/.{1,64}/g); - var digixObj = { - centstotal: new BigNumber('0x' + values[0]).div(100).toString(), - weitotal: new BigNumber('0x' + values[1]).div(etherUnits.getValueOfUnit('ether')).toString(), - share: new BigNumber('0x' + values[2]).div(etherUnits.getValueOfUnit('gwei')).toString(), - badges: new BigNumber('0x' + values[3]).toString(), - claimed: new BigNumber('0x' + values[4]).toString() == '1' - }; - return digixObj; - } - $scope.$watch('tx', function() { - $scope.showRaw = false; - $scope.sendTxStatus = ""; - }, true); - $scope.$watch('showSend', function() { - $scope.showRaw = false; - $scope.sendTxStatus = ""; - if (!$scope.showSend) { - $scope.tx.data = $scope.digixClaim; - $scope.tx.to = $scope.digixContract; - $scope.tx.gasLimit = globalFuncs.digixClaimTxGasLimit; - } - }); - $scope.generateTokenTx = function() { - try { - if (!ethFuncs.validateEtherAddress($scope.tokenTx.to)) throw globalFuncs.errorMsgs[5]; - else if (!globalFuncs.isNumeric($scope.tokenTx.value) || parseFloat($scope.tokenTx.value) < 0) throw globalFuncs.errorMsgs[7]; - else if ($scope.tokenTx.unit == "dgd" && new BigNumber($scope.tokenTx.value).greaterThan(new BigNumber($scope.tokenBalance))) throw globalFuncs.errorMsgs[7]; - else if ($scope.tokenTx.unit == "dgdb" && new BigNumber($scope.tokenTx.value).greaterThan(new BigNumber($scope.badgeBalance))) throw globalFuncs.errorMsgs[7]; - var value = 0; - if ($scope.tokenTx.unit == "dgd") { - value = new BigNumber($scope.tokenTx.value).times(etherUnits.getValueOfUnit('gwei')).toString(16); - $scope.tx.to = $scope.tokenContract; - } else { - value = new BigNumber($scope.tokenTx.value).toString(16); - $scope.tx.to = $scope.badgeContract; - } - value = ethFuncs.padLeft(value, 64); - var toAdd = ethFuncs.padLeft(ethFuncs.getNakedAddress($scope.tokenTx.to), 64); - $scope.tx.data = $scope.digixTransfer + toAdd + value; - $scope.tx.value = 0; - $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText('')); - $scope.generateTx(); - } catch (e) { - $scope.showRaw = false; - $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - } - $scope.generateTx = function(){ - uiFuncs.generateTx($scope,$sce); - } - $scope.sendTx = function() { - uiFuncs.sendTx($scope,$sce); - } -}; -module.exports = digixCtrl; +'use strict'; +var digixCtrl = function($scope, $sce, walletService) { + new Modal(document.getElementById('sendTransaction')); + walletService.wallet = null; + walletService.password = ''; + $scope.showSend = true; + $scope.showRaw = false; + $scope.digixContract = "0xf0160428a8552ac9bb7e050d90eeade4ddd52843"; + $scope.tokenContract = "0xe0b7927c4af23765cb51314a0e0521a9645f0e2a"; + $scope.badgeContract = "0x54bda709fed875224eae569bb6817d96ef7ed9ad"; + $scope.digixUserInfo = "0x1959a002"; + $scope.digixClaim = "0x4e71d92d"; + $scope.digixTransfer = "0xa9059cbb"; + $scope.balanceOf = "0x70a08231"; + $scope.tx = { + gasLimit: globalFuncs.digixClaimTxGasLimit, + data: $scope.digixClaim, + to: $scope.digixContract, + unit: "ether", + value: 0, + nonce: null, + gasPrice: null, + donate: false + } + $scope.tokenTx = { + to: '', + value: 0, + unit: "dgd" + } + $scope.$watch(function() { + if (walletService.wallet == null) return null; + return walletService.wallet.getAddressString(); + }, function() { + if (walletService.wallet == null) return; + $scope.wallet = walletService.wallet; + $scope.setBalance(); + }); + $scope.validateAddress = function(address, status) { + if (ethFuncs.validateEtherAddress(address)) { + $scope[status] = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[0])); + } else { + $scope[status] = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[5])); + } + } + $scope.setBalance = function() { + var tUserInfo = { + to: $scope.digixContract, + data: $scope.digixUserInfo + }; + ajaxReq.getBalance($scope.wallet.getAddressString(), function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.etherBalance = etherUnits.toEther(data.data.balance, 'wei'); + ajaxReq.getETHvalue(function(data) { + $scope.usdBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.usd); + $scope.eurBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.eur); + $scope.btcBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.btc); + }); + } + }); + var userInfo = ethFuncs.getDataObj($scope.digixContract, $scope.digixUserInfo, [ethFuncs.getNakedAddress($scope.wallet.getAddressString())]); + ajaxReq.getEthCall(userInfo, function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + var digixObj = $scope.processDigixInfo(data.data); + $scope.centsTotal = digixObj.centstotal; + $scope.weiTotal = digixObj.weitotal; + $scope.shareTotal = digixObj.share; + $scope.badgesTotal = digixObj.badges; + $scope.claimedTotal = digixObj.claimed.toString(); + } + }); + var tokenBalance = ethFuncs.getDataObj($scope.tokenContract, $scope.balanceOf, [ethFuncs.getNakedAddress($scope.wallet.getAddressString())]); + ajaxReq.getEthCall(tokenBalance, function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.tokenBalance = new BigNumber(data.data).div(1000000000).toString(); + } + }); + var badgeBalance = ethFuncs.getDataObj($scope.badgeContract, $scope.balanceOf, [ethFuncs.getNakedAddress($scope.wallet.getAddressString())]); + ajaxReq.getEthCall(badgeBalance, function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.badgeBalance = new BigNumber(data.data).toString(); + } + }); + } + $scope.processDigixInfo = function(data) { + data = data.replace('0x', ''); + var values = data.match(/.{1,64}/g); + var digixObj = { + centstotal: new BigNumber('0x' + values[0]).div(100).toString(), + weitotal: new BigNumber('0x' + values[1]).div(etherUnits.getValueOfUnit('ether')).toString(), + share: new BigNumber('0x' + values[2]).div(etherUnits.getValueOfUnit('gwei')).toString(), + badges: new BigNumber('0x' + values[3]).toString(), + claimed: new BigNumber('0x' + values[4]).toString() == '1' + }; + return digixObj; + } + $scope.$watch('tx', function() { + $scope.showRaw = false; + $scope.sendTxStatus = ""; + }, true); + $scope.$watch('showSend', function() { + $scope.showRaw = false; + $scope.sendTxStatus = ""; + if (!$scope.showSend) { + $scope.tx.data = $scope.digixClaim; + $scope.tx.to = $scope.digixContract; + $scope.tx.gasLimit = globalFuncs.digixClaimTxGasLimit; + } + }); + $scope.generateTokenTx = function() { + try { + if (!ethFuncs.validateEtherAddress($scope.tokenTx.to)) throw globalFuncs.errorMsgs[5]; + else if (!globalFuncs.isNumeric($scope.tokenTx.value) || parseFloat($scope.tokenTx.value) < 0) throw globalFuncs.errorMsgs[7]; + else if ($scope.tokenTx.unit == "dgd" && new BigNumber($scope.tokenTx.value).greaterThan(new BigNumber($scope.tokenBalance))) throw globalFuncs.errorMsgs[7]; + else if ($scope.tokenTx.unit == "dgdb" && new BigNumber($scope.tokenTx.value).greaterThan(new BigNumber($scope.badgeBalance))) throw globalFuncs.errorMsgs[7]; + var value = 0; + if ($scope.tokenTx.unit == "dgd") { + value = new BigNumber($scope.tokenTx.value).times(etherUnits.getValueOfUnit('gwei')).toString(16); + $scope.tx.to = $scope.tokenContract; + } else { + value = new BigNumber($scope.tokenTx.value).toString(16); + $scope.tx.to = $scope.badgeContract; + } + value = ethFuncs.padLeft(value, 64); + var toAdd = ethFuncs.padLeft(ethFuncs.getNakedAddress($scope.tokenTx.to), 64); + $scope.tx.data = $scope.digixTransfer + toAdd + value; + $scope.tx.value = 0; + $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText('')); + $scope.generateTx(); + } catch (e) { + $scope.showRaw = false; + $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + } + $scope.generateTx = function(){ + uiFuncs.generateTx($scope,$sce); + } + $scope.sendTx = function() { + uiFuncs.sendTx($scope,$sce); + } +}; +module.exports = digixCtrl; },{}],10:[function(require,module,exports){ (function (Buffer){ -'use strict'; -var sendOfflineTxCtrl = function($scope, $sce, walletService) { - walletService.wallet = null; - walletService.password = ''; - $scope.showAdvance = false; - $scope.showRaw = false; - $scope.showWalletInfo = false; - $scope.gasPriceDec = 0; - $scope.nonceDec = 0; - $scope.tx = { - gasLimit: globalFuncs.defaultTxGasLimit, - from: "", - data: "", - to: "", - unit: "ether", - value: '', - nonce: null, - gasPrice: null, - donate: false - } - $scope.$watch(function() { - if (walletService.wallet == null) return null; - return walletService.wallet.getAddressString(); - }, function() { - if (walletService.wallet == null) return; - $scope.wallet = walletService.wallet; - }); - $scope.getWalletInfo = function() { - if (ethFuncs.validateEtherAddress($scope.tx.from)) { - ajaxReq.getTransactionData($scope.tx.from, function(data) { - if (data.error) throw data.msg; - data = data.data; - $scope.gasPriceDec = ethFuncs.hexToDecimal(ethFuncs.sanitizeHex(ethFuncs.addTinyMoreToGas(data.gasprice))); - $scope.nonceDec = ethFuncs.hexToDecimal(data.nonce); - $scope.showWalletInfo = true; - }); - } - } - $scope.$watch('tx', function() { - $scope.showRaw = false; - $scope.sendTxStatus = ""; - }, true); - $scope.validateAddress = function(address, status) { - if (ethFuncs.validateEtherAddress(address)) { - $scope[status] = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[0])); - } else { - $scope[status] = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[5])); - } - } - $scope.generateTx = function() { - try { - if (!ethFuncs.validateEtherAddress($scope.tx.to)) throw globalFuncs.errorMsgs[5]; - else if (!globalFuncs.isNumeric($scope.tx.value) || parseFloat($scope.tx.value) < 0) throw globalFuncs.errorMsgs[7]; - else if (!globalFuncs.isNumeric($scope.gasPriceDec) || parseFloat($scope.gasPriceDec) <= 0) throw globalFuncs.errorMsgs[10]; - else if (!globalFuncs.isNumeric($scope.nonceDec) || parseFloat($scope.nonceDec) < 0) throw globalFuncs.errorMsgs[11]; - else if (!globalFuncs.isNumeric($scope.tx.gasLimit) || parseFloat($scope.tx.gasLimit) <= 0) throw globalFuncs.errorMsgs[8]; - else if (!ethFuncs.validateHexString($scope.tx.data)) throw globalFuncs.errorMsgs[9]; - var rawTx = { - nonce: ethFuncs.sanitizeHex(ethFuncs.decimalToHex($scope.nonceDec)), - gasPrice: ethFuncs.sanitizeHex(ethFuncs.decimalToHex($scope.gasPriceDec)), - gasLimit: ethFuncs.sanitizeHex(ethFuncs.decimalToHex($scope.tx.gasLimit)), - to: ethFuncs.sanitizeHex($scope.tx.to), - value: ethFuncs.sanitizeHex(ethFuncs.decimalToHex(etherUnits.toWei($scope.tx.value, $scope.tx.unit))), - data: ethFuncs.sanitizeHex($scope.tx.data) - } - var eTx = new ethUtil.Tx(rawTx); - eTx.sign(new Buffer($scope.wallet.getPrivateKeyString(), 'hex')); - $scope.rawTx = JSON.stringify(rawTx); - $scope.signedTx = '0x' + eTx.serialize().toString('hex'); - $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText('')); - } catch (e) { - $scope.showRaw = false; - $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - } - $scope.confirmSendTx = function(){ - try { - if($scope.signedTx=="" || !ethFuncs.validateHexString($scope.signedTx)) throw globalFuncs.errorMsgs[12]; - var eTx = new ethUtil.Tx($scope.signedTx); - $scope.tx.to = '0x'+eTx.to.toString('hex'); - $scope.tx.value = etherUnits.toEther('0x'+eTx.value.toString('hex'),'wei'); - $scope.tx.unit = 'ether'; - new Modal(document.getElementById('sendTransactionOffline')).open(); - } catch (e){ - $scope.offlineTxPublishStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - } - $scope.sendTx = function() { - new Modal(document.getElementById('sendTransactionOffline')).close(); - ajaxReq.sendRawTx($scope.signedTx, function(data) { - if (data.error) { - $scope.offlineTxPublishStatus = $sce.trustAsHtml(globalFuncs.getDangerText(data.msg)); - } else { - $scope.offlineTxPublishStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[2] + " " + data.data)); - } - }); - } -}; +'use strict'; +var sendOfflineTxCtrl = function($scope, $sce, walletService) { + walletService.wallet = null; + walletService.password = ''; + $scope.showAdvance = false; + $scope.showRaw = false; + $scope.showWalletInfo = false; + $scope.gasPriceDec = 0; + $scope.nonceDec = 0; + $scope.tx = { + gasLimit: globalFuncs.defaultTxGasLimit, + from: "", + data: "", + to: "", + unit: "ether", + value: '', + nonce: null, + gasPrice: null, + donate: false + } + $scope.$watch(function() { + if (walletService.wallet == null) return null; + return walletService.wallet.getAddressString(); + }, function() { + if (walletService.wallet == null) return; + $scope.wallet = walletService.wallet; + }); + $scope.getWalletInfo = function() { + if (ethFuncs.validateEtherAddress($scope.tx.from)) { + ajaxReq.getTransactionData($scope.tx.from, function(data) { + if (data.error) throw data.msg; + data = data.data; + $scope.gasPriceDec = ethFuncs.hexToDecimal(ethFuncs.sanitizeHex(ethFuncs.addTinyMoreToGas(data.gasprice))); + $scope.nonceDec = ethFuncs.hexToDecimal(data.nonce); + $scope.showWalletInfo = true; + }); + } + } + $scope.$watch('tx', function() { + $scope.showRaw = false; + $scope.sendTxStatus = ""; + }, true); + $scope.validateAddress = function(address, status) { + if (ethFuncs.validateEtherAddress(address)) { + $scope[status] = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[0])); + } else { + $scope[status] = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[5])); + } + } + $scope.generateTx = function() { + try { + if (!ethFuncs.validateEtherAddress($scope.tx.to)) throw globalFuncs.errorMsgs[5]; + else if (!globalFuncs.isNumeric($scope.tx.value) || parseFloat($scope.tx.value) < 0) throw globalFuncs.errorMsgs[7]; + else if (!globalFuncs.isNumeric($scope.gasPriceDec) || parseFloat($scope.gasPriceDec) <= 0) throw globalFuncs.errorMsgs[10]; + else if (!globalFuncs.isNumeric($scope.nonceDec) || parseFloat($scope.nonceDec) < 0) throw globalFuncs.errorMsgs[11]; + else if (!globalFuncs.isNumeric($scope.tx.gasLimit) || parseFloat($scope.tx.gasLimit) <= 0) throw globalFuncs.errorMsgs[8]; + else if (!ethFuncs.validateHexString($scope.tx.data)) throw globalFuncs.errorMsgs[9]; + var rawTx = { + nonce: ethFuncs.sanitizeHex(ethFuncs.decimalToHex($scope.nonceDec)), + gasPrice: ethFuncs.sanitizeHex(ethFuncs.decimalToHex($scope.gasPriceDec)), + gasLimit: ethFuncs.sanitizeHex(ethFuncs.decimalToHex($scope.tx.gasLimit)), + to: ethFuncs.sanitizeHex($scope.tx.to), + value: ethFuncs.sanitizeHex(ethFuncs.decimalToHex(etherUnits.toWei($scope.tx.value, $scope.tx.unit))), + data: ethFuncs.sanitizeHex($scope.tx.data) + } + var eTx = new ethUtil.Tx(rawTx); + eTx.sign(new Buffer($scope.wallet.getPrivateKeyString(), 'hex')); + $scope.rawTx = JSON.stringify(rawTx); + $scope.signedTx = '0x' + eTx.serialize().toString('hex'); + $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText('')); + } catch (e) { + $scope.showRaw = false; + $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + } + $scope.confirmSendTx = function(){ + try { + if($scope.signedTx=="" || !ethFuncs.validateHexString($scope.signedTx)) throw globalFuncs.errorMsgs[12]; + var eTx = new ethUtil.Tx($scope.signedTx); + $scope.tx.to = '0x'+eTx.to.toString('hex'); + $scope.tx.value = etherUnits.toEther('0x'+eTx.value.toString('hex'),'wei'); + $scope.tx.unit = 'ether'; + new Modal(document.getElementById('sendTransactionOffline')).open(); + } catch (e){ + $scope.offlineTxPublishStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + } + $scope.sendTx = function() { + new Modal(document.getElementById('sendTransactionOffline')).close(); + ajaxReq.sendRawTx($scope.signedTx, function(data) { + if (data.error) { + $scope.offlineTxPublishStatus = $sce.trustAsHtml(globalFuncs.getDangerText(data.msg)); + } else { + $scope.offlineTxPublishStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[2] + " " + data.data)); + } + }); + } +}; module.exports = sendOfflineTxCtrl; }).call(this,require("buffer").Buffer) -},{"buffer":83}],11:[function(require,module,exports){ -'use strict'; -var sendTxCtrl = function($scope, $sce, walletService) { - new Modal(document.getElementById('sendTransaction')); - walletService.wallet = null; - walletService.password = ''; - $scope.showAdvance = false; - $scope.showRaw = false; - $scope.tx = { - gasLimit: globalFuncs.urlGet('gaslimit') == null ? globalFuncs.defaultTxGasLimit : globalFuncs.urlGet('gaslimit'), - data: globalFuncs.urlGet('data') == null ? "" : globalFuncs.urlGet('data'), - to: globalFuncs.urlGet('to') == null ? "" : globalFuncs.urlGet('to'), - unit: "ether", - value: globalFuncs.urlGet('value') == null ? "" : globalFuncs.urlGet('value'), - nonce: null, - gasPrice: null, - donate: false - } - $scope.$watch(function() { - if (walletService.wallet == null) return null; - return walletService.wallet.getAddressString(); - }, function() { - if (walletService.wallet == null) return; - $scope.wallet = walletService.wallet; - $scope.setBalance(); - }); - $scope.setBalance = function() { - ajaxReq.getBalance($scope.wallet.getAddressString(), function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.etherBalance = etherUnits.toEther(data.data.balance, 'wei'); - ajaxReq.getETHvalue(function(data) { - $scope.usdBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.usd); - $scope.eurBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.eur); - $scope.btcBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.btc); - }); - } - }); - } - $scope.$watch('tx', function() { - $scope.showRaw = false; - $scope.sendTxStatus = ""; - }, true); - $scope.validateAddress = function() { - if (ethFuncs.validateEtherAddress($scope.tx.to)) { - $scope.validateAddressStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[0])); - } else { - $scope.validateAddressStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[5])); - } - } - $scope.toggleShowAdvance = function() { - $scope.showAdvance = !$scope.showAdvance; - } - $scope.onDonateClick = function() { - $scope.tx.to = globalFuncs.donateAddress; - $scope.tx.donate = true; - $scope.validateAddress(); - } - $scope.generateTx = function(){ - uiFuncs.generateTx($scope,$sce); - } - $scope.sendTx = function() { - uiFuncs.sendTx($scope,$sce); - } - $scope.transferAllBalance = function() { - uiFuncs.transferAllBalance($scope,$sce); - } -}; +},{"buffer":84}],11:[function(require,module,exports){ +'use strict'; +var sendTxCtrl = function($scope, $sce, walletService) { + new Modal(document.getElementById('sendTransaction')); + walletService.wallet = null; + walletService.password = ''; + $scope.showAdvance = false; + $scope.showRaw = false; + $scope.tx = { + gasLimit: globalFuncs.urlGet('gaslimit') == null ? globalFuncs.defaultTxGasLimit : globalFuncs.urlGet('gaslimit'), + data: globalFuncs.urlGet('data') == null ? "" : globalFuncs.urlGet('data'), + to: globalFuncs.urlGet('to') == null ? "" : globalFuncs.urlGet('to'), + unit: "ether", + value: globalFuncs.urlGet('value') == null ? "" : globalFuncs.urlGet('value'), + nonce: null, + gasPrice: null, + donate: false + } + $scope.$watch(function() { + if (walletService.wallet == null) return null; + return walletService.wallet.getAddressString(); + }, function() { + if (walletService.wallet == null) return; + $scope.wallet = walletService.wallet; + $scope.setBalance(); + }); + $scope.setBalance = function() { + ajaxReq.getBalance($scope.wallet.getAddressString(), function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.etherBalance = etherUnits.toEther(data.data.balance, 'wei'); + ajaxReq.getETHvalue(function(data) { + $scope.usdBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.usd); + $scope.eurBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.eur); + $scope.btcBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.btc); + }); + } + }); + } + $scope.$watch('tx', function() { + $scope.showRaw = false; + $scope.sendTxStatus = ""; + }, true); + $scope.validateAddress = function() { + if (ethFuncs.validateEtherAddress($scope.tx.to)) { + $scope.validateAddressStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[0])); + } else { + $scope.validateAddressStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[5])); + } + } + $scope.toggleShowAdvance = function() { + $scope.showAdvance = !$scope.showAdvance; + } + $scope.onDonateClick = function() { + $scope.tx.to = globalFuncs.donateAddress; + $scope.tx.donate = true; + $scope.validateAddress(); + } + $scope.generateTx = function(){ + uiFuncs.generateTx($scope,$sce); + } + $scope.sendTx = function() { + uiFuncs.sendTx($scope,$sce); + } + $scope.transferAllBalance = function() { + uiFuncs.transferAllBalance($scope,$sce); + } +}; module.exports = sendTxCtrl; },{}],12:[function(require,module,exports){ -'use strict'; -var tabsCtrl = function($scope, globalService) { - $scope.tabNames = globalService.tabs; - var hval = window.location.hash; - if(hval!=""){ - hval = hval.replace("#",''); - for (var key in $scope.tabNames) { - if($scope.tabNames[key].url == hval){ - $scope.activeTab = globalService.currentTab = $scope.tabNames[key].id; - break; - } - $scope.activeTab = globalService.currentTab; - } - } else { - $scope.activeTab = globalService.currentTab; - } - $scope.tabClick = function(id) { - $scope.activeTab = globalService.currentTab = id; - for (var key in $scope.tabNames) { - if($scope.tabNames[key].id == id) - location.hash = $scope.tabNames[key].url; - } - } -}; -module.exports = tabsCtrl; +'use strict'; +var tabsCtrl = function($scope, globalService) { + $scope.tabNames = globalService.tabs; + var hval = window.location.hash; + if(hval!=""){ + hval = hval.replace("#",''); + for (var key in $scope.tabNames) { + if($scope.tabNames[key].url == hval){ + $scope.activeTab = globalService.currentTab = $scope.tabNames[key].id; + break; + } + $scope.activeTab = globalService.currentTab; + } + } else { + $scope.activeTab = globalService.currentTab; + } + $scope.tabClick = function(id) { + $scope.activeTab = globalService.currentTab = id; + for (var key in $scope.tabNames) { + if($scope.tabNames[key].id == id) + location.hash = $scope.tabNames[key].url; + } + } +}; +module.exports = tabsCtrl; },{}],13:[function(require,module,exports){ -'use strict'; -var theDaoCtrl = function($scope, $sce, walletService) { - $scope.curTab = "send"; - new Modal(document.getElementById('sendTransaction')); - $scope.voteModal = new Modal(document.getElementById('voteProposal')); - $scope.showVoteYes = $scope.showVoteNo = true; - walletService.wallet = null; - walletService.password = ''; - $scope.showAdvance = false; - $scope.showRaw = false; - $scope.slockitContract = "0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413"; //0xd838f9c9792bf8398e1f5fbfbd3b43c5a86445aa - $scope.slockitBalance = "0x70a08231"; - $scope.slockitSupply = "0x18160ddd"; - $scope.slockitTransfer = "0xa9059cbb"; - $scope.slockitProposal = "0x013cf08b"; - $scope.slockitminQuorumDivisor = "0x674ed066"; - $scope.slockitABalance = "0x39d1f908"; - $scope.slockitRToken = "0xcdef91d0"; - $scope.slockitVote = "0xc9d27afe"; - $scope.tx = { - gasLimit: 150000, - data: '', - to: $scope.slockitContract, - unit: "ether", - value: 0, - nonce: null, - gasPrice: null, - donate: false - } - $scope.token = { - balance: 0, - total: 0, - totRaised: 0 - } - $scope.tokenTx = { - to: '', - value: 0, - unit: "dao" - } - $scope.$watch(function() { - if (walletService.wallet == null) return null; - return walletService.wallet.getAddressString(); - }, function() { - if (walletService.wallet == null) return; - $scope.wallet = walletService.wallet; - $scope.setBalance(); - }); - $scope.setBalance = function() { - ajaxReq.getBalance($scope.wallet.getAddressString(), function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.etherBalance = etherUnits.toEther(data.data.balance, 'wei'); - ajaxReq.getETHvalue(function(data) { - $scope.usdBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.usd); - $scope.eurBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.eur); - $scope.btcBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.btc); - }); - } - }); - var userInfo = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitBalance, [ethFuncs.getNakedAddress($scope.wallet.getAddressString())]); - ajaxReq.getEthCall(userInfo, function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.token.balance = new BigNumber(data.data).div(etherUnits.getValueOfUnit('milli') * 10).toString(); - } - }); - var totSupply = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitSupply, []); - ajaxReq.getEthCall(totSupply, function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.token.total = new BigNumber(data.data).toString(); - } - }); - ajaxReq.getBalance($scope.slockitContract, function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.token.totRaised = etherUnits.toEther(data.data.balance, 'wei'); - } - }); - var minq = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitminQuorumDivisor, []); - ajaxReq.getEthCall(minq, function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.minQuorumDivisor = new BigNumber(data.data).toNumber(); - } - }); - var actB = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitABalance, []); - ajaxReq.getEthCall(actB, function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.actualBalance = new BigNumber(data.data).toNumber(); - } - }); - var rToken = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitRToken, [ethFuncs.getNakedAddress($scope.slockitContract)]); - ajaxReq.getEthCall(rToken, function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.rewardToken = new BigNumber(data.data).toNumber(); - } - }); - } - - $scope.setProposal = function() { - try { - $scope.loadProposalStatus = ""; - if (!globalFuncs.isNumeric($scope.proposalId) || parseFloat($scope.proposalId) < 0) throw globalFuncs.errorMsgs[15]; - var callProposal = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitProposal, [new BigNumber($scope.proposalId).toString(16)]); - ajaxReq.getEthCall(callProposal, function(data) { - try { - if (data.error) { - $scope.loadProposalStatus = data.msg; - } else { - var proposal = ethFuncs.contractOutToArray(data.data); - $scope.objProposal = { - id: $scope.proposalId, - recipient: '0x' + proposal[0], - amount: etherUnits.toEther('0x' + proposal[1], 'wei'), - content: proposal[12] == "0" ? "" : proposal.slice(13).join(), - description: proposal[12] == "0" ? "Propsoal ID #" + $scope.proposalId : globalFuncs.hexToAscii(proposal.slice(13).join('')).replace(/
/g, '\n').replace(/\\n/g, '\n'), - votingDeadline: new Date(new BigNumber("0x" + proposal[3]).toNumber() * 1000), - today: new Date(), - open: proposal[4] == '1' ? true : false, - proposalPassed: proposal[5] == '1' ? true : false, - proposalHash: '0x' + proposal[6], - proposalDeposit: etherUnits.toEther('0x' + proposal[7], 'wei'), - split: proposal[8] == '1' ? true : false, - yea: etherUnits.toEther('0x' + proposal[9], 'wei'), - nay: etherUnits.toEther('0x' + proposal[10], 'wei'), - creator: "0x" + proposal[11], - enabled: true, - minQuroum: function() { - var totalInWei = etherUnits.toWei($scope.token.totRaised, "ether"); - return etherUnits.toEther(totalInWei / $scope.minQuorumDivisor + (etherUnits.toWei(this.amount, "ether") * totalInWei) / (3 * ($scope.actualBalance + $scope.rewardToken)), "wei"); - }, - data: proposal - }; - $scope.showProposal = true; - - var yeaBN = new BigNumber($scope.objProposal.yea); - var nayBN = new BigNumber($scope.objProposal.nay); - $scope.objProposal.totalVotes = yeaBN.plus(nayBN) - $scope.objProposal.yeaPer = yeaBN.plus(nayBN).toNumber() == '0' ? 0 : yeaBN.div($scope.objProposal.totalVotes).times(100).toNumber(); - $scope.objProposal.nayPer = yeaBN.plus(nayBN).toNumber() == '0' ? 0 : nayBN.div($scope.objProposal.totalVotes).times(100).toNumber(); - - $scope.objProposal.quorumCurrent = ($scope.objProposal.totalVotes * 100) / $scope.token.totRaised; - $scope.objProposal.quorumPer = ($scope.objProposal.minQuroum() * 100) / $scope.token.totRaised; - - $scope.objProposal.openEnglish = $scope.objProposal.open == true ? "Yes" : "No"; - $scope.objProposal.splitEnglish = $scope.objProposal.split == true ? "Yes" : "No"; - $scope.objProposal.proposalPassedEnglish = $scope.objProposal.proposalPassed == true ? "Yes" : "No"; - - if ($scope.objProposal.description.indexOf('\n') > 0) { - var firstLine = $scope.objProposal.description.substring(0, $scope.objProposal.description.indexOf('\n')); - $scope.objProposal.descriptionHTML = $sce.trustAsHtml(globalFuncs.stripTags(marked($scope.objProposal.description.substring(firstLine.length + 1) || ""))); - $scope.objProposal.description = firstLine; - } - } - } catch (e) { - $scope.loadProposalStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[15] + e)); - $scope.showProposal = false; - } - }); - } catch (e) { - $scope.loadProposalStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - } - $scope.$watch('curTab', function() { - $scope.tx.data = ''; - $scope.showRaw = $scope.showProposal = false; - }); - $scope.$watch('[tx,curTab]', function() { - $scope.showRaw = false; - $scope.sendTxStatus = ""; - }, true); - - // sending - $scope.generateTokenTx = function() { - try { - if (!ethFuncs.validateEtherAddress($scope.tokenTx.to)) throw globalFuncs.errorMsgs[5]; - else if (!globalFuncs.isNumeric($scope.tokenTx.value) || parseFloat($scope.tokenTx.value) < 0) throw globalFuncs.errorMsgs[7]; - $scope.tx.to = $scope.slockitContract; - var value = ethFuncs.padLeft(new BigNumber($scope.tokenTx.value).times(etherUnits.getValueOfUnit('milli') * 10).toString(16), 64); - var toAdd = ethFuncs.padLeft(ethFuncs.getNakedAddress($scope.tokenTx.to), 64); - $scope.tx.data = $scope.slockitTransfer + toAdd + value; - $scope.tx.value = 0; - $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText('')); - $scope.generateTx(); - } catch (e) { - $scope.showRaw = false; - $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - }; - - $scope.generateTx = function() { - uiFuncs.generateTx($scope, $sce); - } - $scope.sendTx = function() { - uiFuncs.sendTx($scope, $sce); - } - - // voting - $scope.generateVoteTx = function(isYes) { - if (isYes) $scope.showVoteNo = false; - else $scope.showVoteYes = false; - try { - $scope.tx.to = $scope.slockitContract; - var id = ethFuncs.padLeft(new BigNumber($scope.proposalId).toString(16), 64); - var vote = isYes ? ethFuncs.padLeft("1", 64) : ethFuncs.padLeft("0", 64); - $scope.tx.data = $scope.slockitVote + id + vote; - $scope.tx.value = 0; - $scope.generateTx2(); - } catch (e) { - $scope.showRaw = false; - $scope.voteTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - } - $scope.generateTx2 = function() { - uiFuncs.generateTx($scope, $sce, function() { - $scope.sendTx2(); - }); - } - $scope.sendTx2 = function() { - ajaxReq.sendRawTx($scope.signedTx, function(data) { - if (data.error) { - $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(data.msg + "
" + globalFuncs.errorMsgs[17])); - } else { - $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[4] + " " + globalFuncs.successMsgs[2] + " " + data.data)); - } - }); - } -}; -module.exports = theDaoCtrl; +'use strict'; +var theDaoCtrl = function($scope, $sce, walletService) { + $scope.curTab = "send"; + new Modal(document.getElementById('sendTransaction')); + $scope.voteModal = new Modal(document.getElementById('voteProposal')); + $scope.showVoteYes = $scope.showVoteNo = true; + walletService.wallet = null; + walletService.password = ''; + $scope.showAdvance = false; + $scope.showRaw = false; + $scope.slockitContract = "0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413"; //0xd838f9c9792bf8398e1f5fbfbd3b43c5a86445aa + $scope.slockitBalance = "0x70a08231"; + $scope.slockitSupply = "0x18160ddd"; + $scope.slockitTransfer = "0xa9059cbb"; + $scope.slockitProposal = "0x013cf08b"; + $scope.slockitminQuorumDivisor = "0x674ed066"; + $scope.slockitABalance = "0x39d1f908"; + $scope.slockitRToken = "0xcdef91d0"; + $scope.slockitVote = "0xc9d27afe"; + $scope.tx = { + gasLimit: 150000, + data: '', + to: $scope.slockitContract, + unit: "ether", + value: 0, + nonce: null, + gasPrice: null, + donate: false + } + $scope.token = { + balance: 0, + total: 0, + totRaised: 0 + } + $scope.tokenTx = { + to: '', + value: 0, + unit: "dao" + } + $scope.$watch(function() { + if (walletService.wallet == null) return null; + return walletService.wallet.getAddressString(); + }, function() { + if (walletService.wallet == null) return; + $scope.wallet = walletService.wallet; + $scope.setBalance(); + }); + $scope.setBalance = function() { + ajaxReq.getBalance($scope.wallet.getAddressString(), function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.etherBalance = etherUnits.toEther(data.data.balance, 'wei'); + ajaxReq.getETHvalue(function(data) { + $scope.usdBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.usd); + $scope.eurBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.eur); + $scope.btcBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.btc); + }); + } + }); + var userInfo = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitBalance, [ethFuncs.getNakedAddress($scope.wallet.getAddressString())]); + ajaxReq.getEthCall(userInfo, function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.token.balance = new BigNumber(data.data).div(etherUnits.getValueOfUnit('milli') * 10).toString(); + } + }); + var totSupply = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitSupply, []); + ajaxReq.getEthCall(totSupply, function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.token.total = new BigNumber(data.data).toString(); + } + }); + ajaxReq.getBalance($scope.slockitContract, function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.token.totRaised = etherUnits.toEther(data.data.balance, 'wei'); + } + }); + var minq = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitminQuorumDivisor, []); + ajaxReq.getEthCall(minq, function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.minQuorumDivisor = new BigNumber(data.data).toNumber(); + } + }); + var actB = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitABalance, []); + ajaxReq.getEthCall(actB, function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.actualBalance = new BigNumber(data.data).toNumber(); + } + }); + var rToken = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitRToken, [ethFuncs.getNakedAddress($scope.slockitContract)]); + ajaxReq.getEthCall(rToken, function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.rewardToken = new BigNumber(data.data).toNumber(); + } + }); + } + + $scope.setProposal = function() { + try { + $scope.loadProposalStatus = ""; + if (!globalFuncs.isNumeric($scope.proposalId) || parseFloat($scope.proposalId) < 0) throw globalFuncs.errorMsgs[15]; + var callProposal = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitProposal, [new BigNumber($scope.proposalId).toString(16)]); + ajaxReq.getEthCall(callProposal, function(data) { + try { + if (data.error) { + $scope.loadProposalStatus = data.msg; + } else { + var proposal = ethFuncs.contractOutToArray(data.data); + $scope.objProposal = { + id: $scope.proposalId, + recipient: '0x' + proposal[0], + amount: etherUnits.toEther('0x' + proposal[1], 'wei'), + content: proposal[12] == "0" ? "" : proposal.slice(13).join(), + description: proposal[12] == "0" ? "Propsoal ID #" + $scope.proposalId : globalFuncs.stripTags(globalFuncs.hexToAscii(proposal.slice(13).join('')).replace(/
/g, '\n').replace(/\\n/g, '\n')), + votingDeadline: new Date(new BigNumber("0x" + proposal[3]).toNumber() * 1000), + today: new Date(), + open: proposal[4] == '1' ? true : false, + proposalPassed: proposal[5] == '1' ? true : false, + proposalHash: '0x' + proposal[6], + proposalDeposit: etherUnits.toEther('0x' + proposal[7], 'wei'), + split: proposal[8] == '1' ? true : false, + yea: etherUnits.toEther('0x' + proposal[9], 'wei'), + nay: etherUnits.toEther('0x' + proposal[10], 'wei'), + creator: "0x" + proposal[11], + enabled: true, + minQuroum: function() { + var totalInWei = etherUnits.toWei($scope.token.totRaised, "ether"); + return etherUnits.toEther(totalInWei / $scope.minQuorumDivisor + (etherUnits.toWei(this.amount, "ether") * totalInWei) / (3 * ($scope.actualBalance + $scope.rewardToken)), "wei"); + }, + data: proposal + }; + $scope.showProposal = true; + + var yeaBN = new BigNumber($scope.objProposal.yea); + var nayBN = new BigNumber($scope.objProposal.nay); + $scope.objProposal.totalVotes = yeaBN.plus(nayBN) + $scope.objProposal.yeaPer = yeaBN.plus(nayBN).toNumber() == '0' ? 0 : yeaBN.div($scope.objProposal.totalVotes).times(100).toNumber(); + $scope.objProposal.nayPer = yeaBN.plus(nayBN).toNumber() == '0' ? 0 : nayBN.div($scope.objProposal.totalVotes).times(100).toNumber(); + + $scope.objProposal.quorumCurrent = ($scope.objProposal.totalVotes * 100) / $scope.token.totRaised; + $scope.objProposal.quorumPer = ($scope.objProposal.minQuroum() * 100) / $scope.token.totRaised; + + $scope.objProposal.openEnglish = $scope.objProposal.open == true ? "Yes" : "No"; + $scope.objProposal.splitEnglish = $scope.objProposal.split == true ? "Yes" : "No"; + $scope.objProposal.proposalPassedEnglish = $scope.objProposal.proposalPassed == true ? "Yes" : "No"; + + if ($scope.objProposal.description.indexOf('\n') > 0) { + var firstLine = $scope.objProposal.description.substring(0, $scope.objProposal.description.indexOf('\n')); + $scope.objProposal.descriptionHTML = $sce.trustAsHtml(marked($scope.objProposal.description.substring(firstLine.length + 1) || "")); + $scope.objProposal.description = firstLine; + } + } + } catch (e) { + $scope.loadProposalStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[15] + e)); + $scope.showProposal = false; + } + }); + } catch (e) { + $scope.loadProposalStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + } + $scope.$watch('curTab', function() { + $scope.tx.data = ''; + $scope.showRaw = $scope.showProposal = false; + }); + $scope.$watch('[tx,curTab]', function() { + $scope.showRaw = false; + $scope.sendTxStatus = ""; + }, true); + + // sending + $scope.generateTokenTx = function() { + try { + if (!ethFuncs.validateEtherAddress($scope.tokenTx.to)) throw globalFuncs.errorMsgs[5]; + else if (!globalFuncs.isNumeric($scope.tokenTx.value) || parseFloat($scope.tokenTx.value) < 0) throw globalFuncs.errorMsgs[7]; + $scope.tx.to = $scope.slockitContract; + var value = ethFuncs.padLeft(new BigNumber($scope.tokenTx.value).times(etherUnits.getValueOfUnit('milli') * 10).toString(16), 64); + var toAdd = ethFuncs.padLeft(ethFuncs.getNakedAddress($scope.tokenTx.to), 64); + $scope.tx.data = $scope.slockitTransfer + toAdd + value; + $scope.tx.value = 0; + $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText('')); + $scope.generateTx(); + } catch (e) { + $scope.showRaw = false; + $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + }; + + $scope.generateTx = function() { + uiFuncs.generateTx($scope, $sce); + } + $scope.sendTx = function() { + uiFuncs.sendTx($scope, $sce); + } + + // voting + $scope.generateVoteTx = function(isYes) { + if (isYes) $scope.showVoteNo = false; + else $scope.showVoteYes = false; + try { + $scope.tx.to = $scope.slockitContract; + var id = ethFuncs.padLeft(new BigNumber($scope.proposalId).toString(16), 64); + var vote = isYes ? ethFuncs.padLeft("1", 64) : ethFuncs.padLeft("0", 64); + $scope.tx.data = $scope.slockitVote + id + vote; + $scope.tx.value = 0; + $scope.generateTx2(); + } catch (e) { + $scope.showRaw = false; + $scope.voteTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + } + $scope.generateTx2 = function() { + uiFuncs.generateTx($scope, $sce, function() { + $scope.sendTx2(); + }); + } + $scope.sendTx2 = function() { + ajaxReq.sendRawTx($scope.signedTx, function(data) { + if (data.error) { + $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(data.msg + "
" + globalFuncs.errorMsgs[17])); + } else { + $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[4] + " " + globalFuncs.successMsgs[2] + " " + data.data)); + } + }); + } +}; +module.exports = theDaoCtrl; },{}],14:[function(require,module,exports){ -'use strict'; -var theDaoProposalCtrl = function($scope, $sce, walletService) { - walletService.wallet = null; - walletService.password = ''; - $scope.voteModal = new Modal(document.getElementById('voteProposal')); - $scope.showVoteYes = $scope.showVoteNo = true; - $scope.AllProposals = []; - $scope.slockitContract = "0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413"; - $scope.slockitBalance = "0x70a08231"; - $scope.slockitSupply = "0x18160ddd"; - $scope.slockitTransfer = "0xa9059cbb"; - $scope.slockitProposal = "0x013cf08b"; - $scope.slockitminQuorumDivisor = "0x674ed066"; - $scope.slockitABalance = "0x39d1f908"; - $scope.slockitRToken = "0xcdef91d0"; - $scope.slockitVote = "0xc9d27afe"; - $scope.initValues = function() { - ajaxReq.getBalance($scope.slockitContract, function(data) { - if (!data.error) $scope.totRaised = etherUnits.toEther(data.data.balance, 'wei'); - var minq = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitminQuorumDivisor, []); - ajaxReq.getEthCall(minq, function(data) { - if (!data.error) $scope.minQuorumDivisor = new BigNumber(data.data).toNumber(); - var actB = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitABalance, []); - ajaxReq.getEthCall(actB, function(data) { - if (!data.error) $scope.actualBalance = new BigNumber(data.data).toNumber(); - var rToken = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitRToken, [ethFuncs.getNakedAddress($scope.slockitContract)]); - ajaxReq.getEthCall(rToken, function(data) { - if (!data.error) $scope.rewardToken = new BigNumber(data.data).toNumber(); - $scope.getAllProposals(); - }); - }); - }); - }); - } - $scope.tx = { - gasLimit: 150000, - data: '', - to: $scope.slockitContract, - unit: "ether", - value: 0, - nonce: null, - gasPrice: null, - donate: false - } - $scope.$watch(function() { - if (walletService.wallet == null) return null; - return walletService.wallet.getAddressString(); - }, function() { - if (walletService.wallet == null) return; - $scope.wallet = walletService.wallet; - }); - $scope.openVote = function(id) { - $scope.voteID = id; - $scope.showVoteYes = $scope.showVoteNo = true; - $scope.voteTxStatus = $scope.sendTxStatus = ""; - $scope.voteModal.open(); - } - $scope.getAllProposals = function() { - ajaxReq.getDAOProposals(function(proposals) { - for (var i = 0; i < proposals.length; i++) { - $scope.AllProposals.push($scope.getProposalObj(proposals[i])); - } - }); - } - - $scope.filters = { - }; - - if (globalFuncs.urlGet('id') == null) { - $scope.comparator = false; - } else { - $scope.filters.id = parseInt(globalFuncs.urlGet('id')); - $scope.comparator = true; - } - - if (globalFuncs.urlGet('open') == null) { - } else { - $scope.filters.open = globalFuncs.urlGet('open'); - $scope.comparator = false; - } - - if (globalFuncs.urlGet('split') == null) { - } else { - $scope.filters.split = globalFuncs.urlGet('split'); - $scope.comparator = false; - } - - if (globalFuncs.urlGet('description') == null) { - } else { - $scope.filters.description = globalFuncs.urlGet('description'); - $scope.comparator = false; - } - - if (globalFuncs.urlGet('id') == null && globalFuncs.urlGet('open') == null && globalFuncs.urlGet('split') == null && globalFuncs.urlGet('description') == null ) { - $scope.filters.split = 'false'; - $scope.filters.open = 'true'; - $scope.comparator = false; - } - - $scope.$watch('filters.id', function() { - if ($scope.filters.id == '') { - $scope.comparator = false; - $scope.filters.id = ''; - } - if ($scope.filters.id == null) { - $scope.comparator = false; - } - console.log("split: " + JSON.stringify($scope.filters)); - console.log("split: comparator: " + $scope.comparator); - }); - - $scope.$watch('filters.open', function() { - if ($scope.filters.open == null) {} else { - $scope.comparator = false; - $scope.filters.id = ''; - } - console.log("open: " + JSON.stringify($scope.filters)); - console.log("open: comparator: " + $scope.comparator); - }); - $scope.$watch('filters.split', function() { - if ($scope.filters.split == null) {} else { - $scope.comparator = false; - $scope.filters.id = ''; - } - console.log("split: " + JSON.stringify($scope.filters)); - console.log("split: comparator: " + $scope.comparator); - }); - - console.log("load: " + JSON.stringify($scope.filters)); - console.log("load: comparator: " + $scope.comparator); - - - - $scope.initValues(); - $scope.showProposal = function(id) { - if (!$scope.AllProposals[id].showprop) { - var callProposal = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitProposal, [new BigNumber(id).toString(16)]); - ajaxReq.getEthCall(callProposal, function(data) { - var iobj = { - proposalID: id, - data: data.data - }; - $scope.AllProposals[id] = $scope.getProposalObj(iobj); - $scope.AllProposals[id].showprop = true; - }); - } else { - $scope.AllProposals[id].showprop = false; - } - } - $scope.generateVoteTx = function(isYes) { - if (isYes) $scope.showVoteNo = false; - else $scope.showVoteYes = false; - try { - $scope.tx.to = $scope.slockitContract; - var id = ethFuncs.padLeft(new BigNumber($scope.voteID).toString(16), 64); - var vote = isYes ? ethFuncs.padLeft("1", 64) : ethFuncs.padLeft("0", 64); - $scope.tx.data = $scope.slockitVote + id + vote; - $scope.tx.value = 0; - $scope.generateTx(); - } catch (e) { - $scope.showRaw = false; - $scope.voteTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - } - $scope.getProposalObj = function(tProposal) { - var proposal = ethFuncs.contractOutToArray(tProposal.data); - var objProposal = { - id: tProposal.proposalID, - recipient: '0x' + proposal[0], - amount: etherUnits.toEther('0x' + proposal[1], 'wei'), - content: proposal[12] == "0" ? "" : proposal.slice(13).join(), - description: proposal[12] == "0" ? "Propsoal ID #" + tProposal.proposalID : globalFuncs.hexToAscii(proposal.slice(13).join('')).replace(/
/g, '\n').replace(/\\n/g, '\n'), - votingDeadline: new Date(new BigNumber("0x" + proposal[3]).toNumber() * 1000), - today: new Date(), - open: proposal[4] == '1' ? true : false, - proposalPassed: proposal[5] == '1' ? true : false, - proposalHash: '0x' + proposal[6], - proposalDeposit: etherUnits.toEther('0x' + proposal[7], 'wei'), - split: proposal[8] == '1' ? true : false, - yea: etherUnits.toEther('0x' + proposal[9], 'wei'), - nay: etherUnits.toEther('0x' + proposal[10], 'wei'), - creator: "0x" + proposal[11], - show: true, - showprop: false, - minQuroum: function() { - var totalInWei = etherUnits.toWei($scope.totRaised, "ether"); - return etherUnits.toEther(totalInWei / $scope.minQuorumDivisor + (etherUnits.toWei(this.amount, "ether") * totalInWei) / (3 * ($scope.actualBalance + $scope.rewardToken)), "wei"); - }, - data: proposal - }; - var yeaBN = new BigNumber(objProposal.yea); - var nayBN = new BigNumber(objProposal.nay); - objProposal.totalVotes = yeaBN.plus(nayBN) - objProposal.yeaPer = yeaBN.plus(nayBN).toNumber() == '0' ? 0 : yeaBN.div(objProposal.totalVotes).times(100).toNumber(); - objProposal.nayPer = yeaBN.plus(nayBN).toNumber() == '0' ? 0 : nayBN.div(objProposal.totalVotes).times(100).toNumber(); - - objProposal.quorumCurrent = (objProposal.totalVotes * 100) / $scope.totRaised; - objProposal.quorumPer = (objProposal.minQuroum() * 100) / $scope.totRaised; - - objProposal.openEnglish = objProposal.open == true ? "Yes" : "No"; - objProposal.splitEnglish = objProposal.split == true ? "Yes" : "No"; - objProposal.proposalPassedEnglish = objProposal.proposalPassed == true ? "Yes" : "No"; - - if (objProposal.description.indexOf('\n') > 0) { - var firstLine = objProposal.description.substring(0, objProposal.description.indexOf('\n')); - objProposal.descriptionHTML = $sce.trustAsHtml(globalFuncs.stripTags(marked(objProposal.description.substring(firstLine.length + 1) || ""))); - objProposal.description = firstLine; - } - - return objProposal; - } - $scope.generateTx = function() { - uiFuncs.generateTx($scope, $sce, function(){ - $scope.sendTx(); - }); - } - $scope.sendTx = function() { - ajaxReq.sendRawTx($scope.signedTx, function(data) { - if (data.error) { - $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(data.msg + "
" + globalFuncs.errorMsgs[17] )); - } else { - $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[4] + " " +globalFuncs.successMsgs[2] + " " + data.data)); - } - }); - } - -}; - - -module.exports = theDaoProposalCtrl; +'use strict'; +var theDaoProposalCtrl = function($scope, $sce, walletService) { + walletService.wallet = null; + walletService.password = ''; + $scope.voteModal = new Modal(document.getElementById('voteProposal')); + $scope.showVoteYes = $scope.showVoteNo = true; + $scope.AllProposals = []; + $scope.slockitContract = "0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413"; + $scope.slockitBalance = "0x70a08231"; + $scope.slockitSupply = "0x18160ddd"; + $scope.slockitTransfer = "0xa9059cbb"; + $scope.slockitProposal = "0x013cf08b"; + $scope.slockitminQuorumDivisor = "0x674ed066"; + $scope.slockitABalance = "0x39d1f908"; + $scope.slockitRToken = "0xcdef91d0"; + $scope.slockitVote = "0xc9d27afe"; + $scope.initValues = function() { + ajaxReq.getBalance($scope.slockitContract, function(data) { + if (!data.error) $scope.totRaised = etherUnits.toEther(data.data.balance, 'wei'); + var minq = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitminQuorumDivisor, []); + ajaxReq.getEthCall(minq, function(data) { + if (!data.error) $scope.minQuorumDivisor = new BigNumber(data.data).toNumber(); + var actB = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitABalance, []); + ajaxReq.getEthCall(actB, function(data) { + if (!data.error) $scope.actualBalance = new BigNumber(data.data).toNumber(); + var rToken = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitRToken, [ethFuncs.getNakedAddress($scope.slockitContract)]); + ajaxReq.getEthCall(rToken, function(data) { + if (!data.error) $scope.rewardToken = new BigNumber(data.data).toNumber(); + $scope.getAllProposals(); + }); + }); + }); + }); + } + $scope.tx = { + gasLimit: 150000, + data: '', + to: $scope.slockitContract, + unit: "ether", + value: 0, + nonce: null, + gasPrice: null, + donate: false + } + $scope.$watch(function() { + if (walletService.wallet == null) return null; + return walletService.wallet.getAddressString(); + }, function() { + if (walletService.wallet == null) return; + $scope.wallet = walletService.wallet; + }); + $scope.openVote = function(id) { + $scope.voteID = id; + $scope.showVoteYes = $scope.showVoteNo = true; + $scope.voteTxStatus = $scope.sendTxStatus = ""; + $scope.voteModal.open(); + } + $scope.getAllProposals = function() { + ajaxReq.getDAOProposals(function(proposals) { + for (var i = 0; i < proposals.length; i++) { + $scope.AllProposals.push($scope.getProposalObj(proposals[i])); + } + }); + } + + $scope.filters = { + id: globalFuncs.urlGet('id') != null ? parseInt(globalFuncs.urlGet('id')) : '', + open: globalFuncs.urlGet('open') != null ? globalFuncs.urlGet('open') : '', + split: globalFuncs.urlGet('split') != null ? globalFuncs.urlGet('split') : '', + description: globalFuncs.urlGet('description') != null ? globalFuncs.urlGet('description') : '' + }; + $scope.comparator = globalFuncs.urlGet('id') != null; + if ($scope.filters.id == '' && $scope.filters.open == '' && $scope.filters.split == '' && $scope.filters.description == '' ) { + $scope.filters.split = 'false'; + $scope.filters.open = 'true'; + } + + $scope.$watch('filters', function(newValue, oldValue) { + if ((newValue.id!=oldValue.id)&&($scope.filters.id == '' || $scope.filters.id == null)) $scope.comparator = false; + if (newValue.open!=oldValue.open && $scope.filters.open == '') $scope.filters.id = ''; + if (newValue.split!=oldValue.split && $scope.filters.split != '') $scope.filters.id = ''; + }, true); + $scope.initValues(); + $scope.showProposal = function(id) { + if (!$scope.AllProposals[id].showprop) { + var callProposal = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitProposal, [new BigNumber(id).toString(16)]); + ajaxReq.getEthCall(callProposal, function(data) { + var iobj = { + proposalID: id, + data: data.data + }; + $scope.AllProposals[id] = $scope.getProposalObj(iobj); + $scope.AllProposals[id].showprop = true; + }); + } else { + $scope.AllProposals[id].showprop = false; + } + } + $scope.generateVoteTx = function(isYes) { + if (isYes) $scope.showVoteNo = false; + else $scope.showVoteYes = false; + try { + $scope.tx.to = $scope.slockitContract; + var id = ethFuncs.padLeft(new BigNumber($scope.voteID).toString(16), 64); + var vote = isYes ? ethFuncs.padLeft("1", 64) : ethFuncs.padLeft("0", 64); + $scope.tx.data = $scope.slockitVote + id + vote; + $scope.tx.value = 0; + $scope.generateTx(); + } catch (e) { + $scope.showRaw = false; + $scope.voteTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + } + $scope.getProposalObj = function(tProposal) { + var proposal = ethFuncs.contractOutToArray(tProposal.data); + var objProposal = { + id: tProposal.proposalID, + recipient: '0x' + proposal[0], + amount: etherUnits.toEther('0x' + proposal[1], 'wei'), + content: proposal[12] == "0" ? "" : proposal.slice(13).join(), + description: proposal[12] == "0" ? "Propsoal ID #" + tProposal.proposalID : globalFuncs.stripTags(globalFuncs.hexToAscii(proposal.slice(13).join('')).replace(/
/g, '\n').replace(/\\n/g, '\n')), + votingDeadline: new Date(new BigNumber("0x" + proposal[3]).toNumber() * 1000), + today: new Date(), + open: proposal[4] == '1' ? true : false, + proposalPassed: proposal[5] == '1' ? true : false, + proposalHash: '0x' + proposal[6], + proposalDeposit: etherUnits.toEther('0x' + proposal[7], 'wei'), + split: proposal[8] == '1' ? true : false, + yea: etherUnits.toEther('0x' + proposal[9], 'wei'), + nay: etherUnits.toEther('0x' + proposal[10], 'wei'), + creator: "0x" + proposal[11], + show: true, + showprop: false, + minQuroum: function() { + var totalInWei = etherUnits.toWei($scope.totRaised, "ether"); + return etherUnits.toEther(totalInWei / $scope.minQuorumDivisor + (etherUnits.toWei(this.amount, "ether") * totalInWei) / (3 * ($scope.actualBalance + $scope.rewardToken)), "wei"); + }, + data: proposal + }; + var yeaBN = new BigNumber(objProposal.yea); + var nayBN = new BigNumber(objProposal.nay); + objProposal.totalVotes = yeaBN.plus(nayBN) + objProposal.yeaPer = yeaBN.plus(nayBN).toNumber() == '0' ? 0 : yeaBN.div(objProposal.totalVotes).times(100).toNumber(); + objProposal.nayPer = yeaBN.plus(nayBN).toNumber() == '0' ? 0 : nayBN.div(objProposal.totalVotes).times(100).toNumber(); + + objProposal.quorumCurrent = (objProposal.totalVotes * 100) / $scope.totRaised; + objProposal.quorumPer = (objProposal.minQuroum() * 100) / $scope.totRaised; + + objProposal.openEnglish = objProposal.open == true ? "Yes" : "No"; + objProposal.splitEnglish = objProposal.split == true ? "Yes" : "No"; + objProposal.proposalPassedEnglish = objProposal.proposalPassed == true ? "Yes" : "No"; + + if (objProposal.description.indexOf('\n') > 0) { + var firstLine = objProposal.description.substring(0, objProposal.description.indexOf('\n')); + objProposal.descriptionHTML = $sce.trustAsHtml(marked(objProposal.description.substring(firstLine.length + 1) || "")); + objProposal.description = firstLine; + } + return objProposal; + } + $scope.generateTx = function() { + uiFuncs.generateTx($scope, $sce, function(){ + $scope.sendTx(); + }); + } + $scope.sendTx = function() { + ajaxReq.sendRawTx($scope.signedTx, function(data) { + if (data.error) { + $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(data.msg + "
" + globalFuncs.errorMsgs[17] )); + } else { + $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[4] + " " +globalFuncs.successMsgs[2] + " " + data.data)); + } + }); + } + +}; + + +module.exports = theDaoProposalCtrl; },{}],15:[function(require,module,exports){ -'use strict'; -var viewCtrl = function($scope, globalService) { - $scope.globalService = globalService; -}; +'use strict'; +var viewCtrl = function($scope, globalService) { + $scope.globalService = globalService; +}; module.exports = viewCtrl; },{}],16:[function(require,module,exports){ -'use strict'; -var viewWalletCtrl = function($scope, walletService) { - walletService.wallet = null; - walletService.password = ''; - $scope.$watch(function() { - if (walletService.wallet == null) return null; - return walletService.wallet.getAddressString(); - }, function() { - if (walletService.wallet == null) return; - $scope.wallet = walletService.wallet; - $scope.showEnc = walletService.password != ''; - $scope.blob = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toJSON()); - if (walletService.password != '') { - $scope.blobEnc = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toV3(walletService.password, { - kdf: globalFuncs.kdf, - n: globalFuncs.scrypt.n - })); - $scope.encFileName = $scope.wallet.getV3Filename(); - } - ajaxReq.getBalance($scope.wallet.getAddressString(), function(data){ - if(data.error){ - $scope.etherBalance = data.msg; - } else { - $scope.etherBalance = etherUnits.toEther(data.data.balance,'wei'); - ajaxReq.getETHvalue(function(data){ - $scope.usdBalance = etherUnits.toFiat($scope.etherBalance,'ether',data.usd); - $scope.eurBalance = etherUnits.toFiat($scope.etherBalance,'ether',data.eur); - $scope.btcBalance = etherUnits.toFiat($scope.etherBalance,'ether',data.btc); - }); - } - }); - }); - $scope.printQRCode = function() { - globalFuncs.printPaperWallets(JSON.stringify([{ - address: $scope.wallet.getAddressString(), - private: $scope.wallet.getPrivateKeyString() - }])); - } -}; +'use strict'; +var viewWalletCtrl = function($scope, walletService) { + walletService.wallet = null; + walletService.password = ''; + $scope.$watch(function() { + if (walletService.wallet == null) return null; + return walletService.wallet.getAddressString(); + }, function() { + if (walletService.wallet == null) return; + $scope.wallet = walletService.wallet; + $scope.showEnc = walletService.password != ''; + $scope.blob = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toJSON()); + if (walletService.password != '') { + $scope.blobEnc = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toV3(walletService.password, { + kdf: globalFuncs.kdf, + n: globalFuncs.scrypt.n + })); + $scope.encFileName = $scope.wallet.getV3Filename(); + } + ajaxReq.getBalance($scope.wallet.getAddressString(), function(data){ + if(data.error){ + $scope.etherBalance = data.msg; + } else { + $scope.etherBalance = etherUnits.toEther(data.data.balance,'wei'); + ajaxReq.getETHvalue(function(data){ + $scope.usdBalance = etherUnits.toFiat($scope.etherBalance,'ether',data.usd); + $scope.eurBalance = etherUnits.toFiat($scope.etherBalance,'ether',data.eur); + $scope.btcBalance = etherUnits.toFiat($scope.etherBalance,'ether',data.btc); + }); + } + }); + }); + $scope.printQRCode = function() { + globalFuncs.printPaperWallets(JSON.stringify([{ + address: $scope.wallet.getAddressString(), + private: $scope.wallet.getPrivateKeyString() + }])); + } +}; module.exports = viewWalletCtrl; },{}],17:[function(require,module,exports){ -'use strict'; -var walletGenCtrl = function($scope) { - $scope.password = ""; - $scope.wallet = null; - $scope.showWallet = false; - $scope.blob = $scope.blobEnc = ""; - $scope.isDone = true; - $scope.showPass = true; - $scope.genNewWallet = function() { - if (!$scope.isStrongPass()) { - alert(globalFuncs.errorMsgs[1]); - } else if($scope.isDone){ - $scope.isDone = false; - $scope.wallet = Wallet.generate(false); - $scope.showWallet = true; - $scope.blob = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toJSON()); - $scope.blobEnc = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toV3($scope.password, { - kdf: globalFuncs.kdf, - n: globalFuncs.scrypt.n - })); - $scope.encFileName = $scope.wallet.getV3Filename(); - if(parent!=null) - parent.postMessage(JSON.stringify({address:$scope.wallet.getAddressString(), checksumAddress: $scope.wallet.getChecksumAddressString()}),"*"); - $scope.isDone = true; - } - } - $scope.printQRCode = function() { - globalFuncs.printPaperWallets(JSON.stringify([{ - address: $scope.wallet.getAddressString(), - private: $scope.wallet.getPrivateKeyString() - }])); - } - $scope.isStrongPass = function(){ - return globalFuncs.isStrongPass($scope.password); - } -}; +'use strict'; +var walletGenCtrl = function($scope) { + $scope.password = ""; + $scope.wallet = null; + $scope.showWallet = false; + $scope.blob = $scope.blobEnc = ""; + $scope.isDone = true; + $scope.showPass = true; + $scope.genNewWallet = function() { + if (!$scope.isStrongPass()) { + alert(globalFuncs.errorMsgs[1]); + } else if($scope.isDone){ + $scope.isDone = false; + $scope.wallet = Wallet.generate(false); + $scope.showWallet = true; + $scope.blob = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toJSON()); + $scope.blobEnc = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toV3($scope.password, { + kdf: globalFuncs.kdf, + n: globalFuncs.scrypt.n + })); + $scope.encFileName = $scope.wallet.getV3Filename(); + if(parent!=null) + parent.postMessage(JSON.stringify({address:$scope.wallet.getAddressString(), checksumAddress: $scope.wallet.getChecksumAddressString()}),"*"); + $scope.isDone = true; + } + } + $scope.printQRCode = function() { + globalFuncs.printPaperWallets(JSON.stringify([{ + address: $scope.wallet.getAddressString(), + private: $scope.wallet.getPrivateKeyString() + }])); + } + $scope.isStrongPass = function(){ + return globalFuncs.isStrongPass($scope.password); + } +}; module.exports = walletGenCtrl; },{}],18:[function(require,module,exports){ -'use strict'; -var cxFuncs = function() {} -cxFuncs.storage = chrome.storage.sync; -cxFuncs.getAllNickNames = function(callback) { - var nickNames = []; - this.storage.get(null, function(items) { - for (var key in items) { - if (items.hasOwnProperty(key)) { - var tobj = JSON.parse(items[key]); - if (tobj.type == 'wallet' || tobj.type == 'watchOnly') { - nickNames.push(tobj.nick); - nickNames.push(key); - } - } - } - callback(nickNames); - }); -} -cxFuncs.addWalletToStorage = function(address, encStr, nickname, callback) { - nickname = nickname.replace(/(<([^>]+)>)/ig, ""); - var value = { - nick: nickname, - priv: encStr, - type: 'wallet' - }; - var keyname = ethUtil.toChecksumAddress(address); - var obj = {}; - obj[keyname] = JSON.stringify(value); - this.storage.set(obj, callback); -} -cxFuncs.addWatchOnlyAddress = function(address, nickname, callback) { - nickname = nickname.replace(/(<([^>]+)>)/ig, ""); - var value = { - nick: nickname, - type: 'watchOnly' - }; - var keyname = ethUtil.toChecksumAddress(address);; - var obj = {}; - obj[keyname] = JSON.stringify(value); - this.storage.set(obj, callback); -} -cxFuncs.getStorageArr = function(filter, callback) { - var wallets = []; - this.storage.get(null, function(items) { - for (var key in items) { - if (items.hasOwnProperty(key)) { - var tobj = JSON.parse(items[key]); - if (tobj.type == filter) { - tobj['addr'] = key; - wallets.push(tobj); - } - } - } - wallets.sort(function(a, b) { - if (a.nick < b.nick) return -1; - if (a.nick > b.nick) return 1; - return 0; - }); - callback(wallets); - }); -} -cxFuncs.getWalletsArr = function(callback) { - this.getStorageArr('wallet', callback); -} -cxFuncs.getWatchOnlyArr = function(callback) { - this.getStorageArr('watchOnly', callback); -} -cxFuncs.deleteAccount = function(address,callback){ - this.storage.remove(address,function(){ - callback(address); - }); -} -cxFuncs.editNickName = function(address,newNick, callback){ - newNick = newNick.replace(/(<([^>]+)>)/ig,""); - this.storage.get(address, function(account) { - var accountInfo = account[address]; - accountInfo = JSON.parse(accountInfo); - accountInfo['nick'] = newNick; - account[address] = JSON.stringify(accountInfo); - cxFuncs.storage.set(account,function(){ - callback(newNick); - }); - }); -} +'use strict'; +var cxFuncs = function() {} +cxFuncs.storage = chrome.storage.sync; +cxFuncs.getAllNickNames = function(callback) { + var nickNames = []; + this.storage.get(null, function(items) { + for (var key in items) { + if (items.hasOwnProperty(key)) { + var tobj = JSON.parse(items[key]); + if (tobj.type == 'wallet' || tobj.type == 'watchOnly') { + nickNames.push(tobj.nick); + nickNames.push(key); + } + } + } + callback(nickNames); + }); +} +cxFuncs.addWalletToStorage = function(address, encStr, nickname, callback) { + nickname = nickname.replace(/(<([^>]+)>)/ig, ""); + var value = { + nick: nickname, + priv: encStr, + type: 'wallet' + }; + var keyname = ethUtil.toChecksumAddress(address); + var obj = {}; + obj[keyname] = JSON.stringify(value); + this.storage.set(obj, callback); +} +cxFuncs.addWatchOnlyAddress = function(address, nickname, callback) { + nickname = nickname.replace(/(<([^>]+)>)/ig, ""); + var value = { + nick: nickname, + type: 'watchOnly' + }; + var keyname = ethUtil.toChecksumAddress(address);; + var obj = {}; + obj[keyname] = JSON.stringify(value); + this.storage.set(obj, callback); +} +cxFuncs.getStorageArr = function(filter, callback) { + var wallets = []; + this.storage.get(null, function(items) { + for (var key in items) { + if (items.hasOwnProperty(key)) { + var tobj = JSON.parse(items[key]); + if (tobj.type == filter) { + tobj['addr'] = key; + wallets.push(tobj); + } + } + } + wallets.sort(function(a, b) { + if (a.nick < b.nick) return -1; + if (a.nick > b.nick) return 1; + return 0; + }); + callback(wallets); + }); +} +cxFuncs.getWalletsArr = function(callback) { + this.getStorageArr('wallet', callback); +} +cxFuncs.getWatchOnlyArr = function(callback) { + this.getStorageArr('watchOnly', callback); +} +cxFuncs.deleteAccount = function(address,callback){ + this.storage.remove(address,function(){ + callback(address); + }); +} +cxFuncs.editNickName = function(address,newNick, callback){ + newNick = newNick.replace(/(<([^>]+)>)/ig,""); + this.storage.get(address, function(account) { + var accountInfo = account[address]; + accountInfo = JSON.parse(accountInfo); + accountInfo['nick'] = newNick; + account[address] = JSON.stringify(accountInfo); + cxFuncs.storage.set(account,function(){ + callback(newNick); + }); + }); +} module.exports = cxFuncs; },{}],19:[function(require,module,exports){ -'use strict'; -var QRCodeDrtv = function() { - return function(scope, element, attrs) { - var watchVar = attrs.watchVar; - scope.$watch(watchVar, function() { - var value = attrs.qrCode; - element.empty(); - var delay = 0; - if (element[0].clientWidth == 0) delay = 200; - setTimeout(function() { - new QRCode(element[0], { - text: value, - width: element[0].clientWidth, - height: element[0].clientWidth, - colorDark: "#000000", - colorLight: "#ffffff", - correctLevel: QRCode.CorrectLevel.H - }); - }, delay); - }); - }; -}; +'use strict'; +var QRCodeDrtv = function() { + return function(scope, element, attrs) { + var watchVar = attrs.watchVar; + scope.$watch(watchVar, function() { + var value = attrs.qrCode; + element.empty(); + var delay = 0; + if (element[0].clientWidth == 0) delay = 200; + setTimeout(function() { + new QRCode(element[0], { + text: value, + width: element[0].clientWidth, + height: element[0].clientWidth, + colorDark: "#000000", + colorLight: "#ffffff", + correctLevel: QRCode.CorrectLevel.H + }); + }, delay); + }); + }; +}; module.exports = QRCodeDrtv; },{}],20:[function(require,module,exports){ -'use strict'; -var blockiesDrtv = function() { - return function(scope, element, attrs){ - var watchVar = attrs.watchVar; - scope.$watch(watchVar, function() { - var address = attrs.blockieAddress; - var content = ethFuncs.validateEtherAddress(address) ? globalFuncs.getBlockie(address):''; - element.css({ - 'background-image': 'url(' + content +')' - }); - }); - }; -}; +'use strict'; +var blockiesDrtv = function() { + return function(scope, element, attrs){ + var watchVar = attrs.watchVar; + scope.$watch(watchVar, function() { + var address = attrs.blockieAddress; + var content = ethFuncs.validateEtherAddress(address) ? globalFuncs.getBlockie(address):''; + element.css({ + 'background-image': 'url(' + content +')' + }); + }); + }; +}; module.exports = blockiesDrtv; },{}],21:[function(require,module,exports){ -'use strict'; -var cxWalletDecryptDrtv = function() { - return { - restrict : "E", - template : '
\n \ -
\n \ -

Select a Wallet:

\n \ -
\n \ - \n \ -
\n \ -
\n \ -
\n \ -

Enter the Password:

\n \ - \n \ -
\n \ -
\n \ -

Access Your Wallet:

\n \ - \n \ -
\n \ -
\n \ -
' - }; -}; -module.exports = cxWalletDecryptDrtv; +'use strict'; +var cxWalletDecryptDrtv = function() { + return { + restrict : "E", + template : '
\n \ +
\n \ +

Select a Wallet:

\n \ +
\n \ + \n \ +
\n \ +
\n \ +
\n \ +

Enter the Password:

\n \ + \n \ +
\n \ +
\n \ +

Access Your Wallet:

\n \ + \n \ +
\n \ +
\n \ +
' + }; +}; +module.exports = cxWalletDecryptDrtv; },{}],22:[function(require,module,exports){ -'use strict'; -var fileReaderDrtv = function($parse) { - return { - restrict: 'A', - scope: false, - link: function(scope, element, attrs) { - var fn = $parse(attrs.onReadFile); - element.on('change', function(onChangeEvent) { - var reader = new FileReader(); - reader.onload = function(onLoadEvent) { - scope.$apply(function() { - fn(scope, { - $fileContent: onLoadEvent.target.result - }); - }); - }; - reader.readAsText((onChangeEvent.srcElement || onChangeEvent.target).files[0]); - }); - } - }; -}; +'use strict'; +var fileReaderDrtv = function($parse) { + return { + restrict: 'A', + scope: false, + link: function(scope, element, attrs) { + var fn = $parse(attrs.onReadFile); + element.on('change', function(onChangeEvent) { + var reader = new FileReader(); + reader.onload = function(onLoadEvent) { + scope.$apply(function() { + fn(scope, { + $fileContent: onLoadEvent.target.result + }); + }); + }; + reader.readAsText((onChangeEvent.srcElement || onChangeEvent.target).files[0]); + }); + } + }; +}; module.exports = fileReaderDrtv; },{}],23:[function(require,module,exports){ -'use strict'; -var walletDecryptDrtv = function() { - return { - restrict : "E", - template : '
\n \ -
\n \ -

Select the format of your private key:

\n \ -
\n \ - \n \ -
\n \ -
\n \ - \n \ -
\n \ -
\n \ -
\n \ - \n \ -
\n \ -

Select your wallet file:

\n \ -
\n \ - \n \ - SELECT WALLET FILE... \n \ -
\n \ -
\n \ -
\n \ -

Your file is encrypted. Please enter the password:

\n \ - \n \ -
\n \ -
\n \ - \n \ - \n \ -
\n \ -

Paste / type your private key:

\n \ -
\n \ - \n \ -
\n \ -
\n \ -

Your file is encrypted. Please enter the password:

\n \ - \n \ -
\n \ -
\n \ - \n \ -
\n \ -
\n \ -

Access Your Wallet:

\n \ -

Access Your Wallet:

\n \ - \n \ -
\n \ -
\n \ -
' - }; -}; -module.exports = walletDecryptDrtv; +'use strict'; +var walletDecryptDrtv = function() { + return { + restrict : "E", + template : '
\n \ +
\n \ +

Select the format of your private key:

\n \ +
\n \ + \n \ +
\n \ +
\n \ + \n \ +
\n \ +
\n \ +
\n \ + \n \ +
\n \ +

Select your wallet file:

\n \ +
\n \ + \n \ + SELECT WALLET FILE... \n \ +
\n \ +
\n \ +
\n \ +

Your file is encrypted. Please enter the password:

\n \ + \n \ +
\n \ +
\n \ + \n \ + \n \ +
\n \ +

Paste / type your private key:

\n \ +
\n \ + \n \ +
\n \ +
\n \ +

Your file is encrypted. Please enter the password:

\n \ + \n \ +
\n \ +
\n \ + \n \ +
\n \ +
\n \ +

Access Your Wallet:

\n \ +

Access Your Wallet:

\n \ + \n \ +
\n \ +
\n \ +
' + }; +}; +module.exports = walletDecryptDrtv; },{}],24:[function(require,module,exports){ -'use strict'; -var ethFuncs = function() {} -ethFuncs.validateEtherAddress = function(address) { - if (address.substring(0, 2) != "0x") return false; - else if (!/^(0x)?[0-9a-f]{40}$/i.test(address)) return false; - else if (/^(0x)?[0-9a-f]{40}$/.test(address) || /^(0x)?[0-9A-F]{40}$/.test(address)) return true; - else - return this.isChecksumAddress(address); -} -ethFuncs.isChecksumAddress = function(address) { - return address == ethUtil.toChecksumAddress(address); -} -ethFuncs.validateHexString = function(str) { - if (str == "") return true; - str = str.substring(0, 2) == '0x' ? str.substring(2) : str; - var re = /[0-9A-Fa-f]+$/g; - return re.test(str); -} -ethFuncs.sanitizeHex = function(hex) { - hex = hex.substring(0, 2) == '0x' ? hex.substring(2) : hex; - if (hex == "") return ""; - return '0x' + this.padLeftEven(hex); -} -ethFuncs.padLeftEven = function(hex) { - hex = hex.length % 2 != 0 ? '0' + hex : hex; - return hex; -} -ethFuncs.addTinyMoreToGas = function(hex) { - hex = this.sanitizeHex(hex); - return new BigNumber(hex).plus(etherUnits.getValueOfUnit('gwei')).toDigits(2).toString(16); -} -ethFuncs.decimalToHex = function(dec) { - return new BigNumber(dec).toString(16); -} -ethFuncs.hexToDecimal = function(hex) { - return new BigNumber(this.sanitizeHex(hex)).toString(); -} -ethFuncs.contractOutToArray = function(hex) { - hex = hex.replace('0x', '').match(/.{64}/g); - for(var i=0;i= width ? n : new Array(width - n.length + 1).join(z) + n; -} -ethFuncs.getDataObj = function(to, func, arrVals) { - var val=""; - for(var i=0;i= width ? n : new Array(width - n.length + 1).join(z) + n; +} +ethFuncs.getDataObj = function(to, func, arrVals) { + var val=""; + for(var i=0;i"); -} -globalFuncs.getBlob = function(mime, str) { - var str = (typeof str === 'object') ? JSON.stringify(str) : str; - if (str == null) return ''; - var blob = new Blob([str], { - type: mime - }); - return window.URL.createObjectURL(blob); -} -globalFuncs.getSuccessText = function(str) { - return '

' + str + '

' -} -globalFuncs.getDangerText = function(str) { - return '

' + str + '

' -} -globalFuncs.errorMsgs = [ - "Please enter valid amount. ", - "Your password must be at least 9 characters. Please ensure it is a strong password. ", - "Sorry! We don't have a clue what type of wallet file this is. ", - "This is not a valid wallet file. ", - "This unit doesn\'t exists, please use the one of the following units ", - "Invalid address. ", - "Invalid password. ", - "Invalid amount. ", - "Invalid gas limit. ", - "Invalid data value. ", - "Invalid gas amount. ", - "Invalid nonce. ", - "Invalid signed transaction. ", - "A wallet with this nickname already exists. ", - "Wallet not found. ", - "Whoops. It doesnt look like a proposal with this ID exists yet or there is an error reading this proposal. ", - "A wallet with this address already exists in storage. Please check your wallets page. ", - "You need to have at some ETH in your account to cover the cost of gas. .05ETH should be more than sufficient for a few sends and votes. "]; -globalFuncs.successMsgs = ["Valid address", "Wallet successfully decrypted", "Transaction submitted. TX ID: ", "New wallet added: ", "You have successfully voted. Thank you for being an active participant in The DAO."]; -globalFuncs.scrypt = { - n: 1024 -}; -globalFuncs.postDelay = 300; -globalFuncs.kdf = "scrypt"; -globalFuncs.defaultTxGasLimit = 21000; -globalFuncs.digixClaimTxGasLimit = 150000; -globalFuncs.donateAddress = "0x7cB57B5A97eAbe94205C07890BE4c1aD31E486A8"; -globalFuncs.isNumeric = function(n) { - return !isNaN(parseFloat(n)) && isFinite(n); -} -globalFuncs.urlGet = function(name) { - if (name = (new RegExp('[?&]' + encodeURIComponent(name) + '=([^&]*)')).exec(location.search)) return this.stripTags(decodeURIComponent(name[1])); -} -globalFuncs.stripTags = function(str) { - var SCRIPT_REGEX = /)<[^<]*)*<\/script>/gi; - while (SCRIPT_REGEX.test(str)) { - str = str.replace(SCRIPT_REGEX, ""); - } - return str; -} -globalFuncs.checkAndRedirectHTTPS = function() { - var host = "myetherwallet.com"; - var githost = "kvhnuke.github.io"; - var githostw = "www.kvhnuke.github.io"; - var hostw = "www.myetherwallet.com"; - if ((host == window.location.host || githost == window.location.host || hostw == window.location.host || githostw == window.location.host) && (window.location.protocol != "https:")) window.location.protocol = "https"; -} -globalFuncs.isStrongPass = function(password) { - if (password.length > 8) { - return true; - } else { - return false; - } - //var re = /(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}/; - //return re.test(password); -} -globalFuncs.hexToAscii = function(hex) { - return hex.match(/.{1,2}/g).map(function(v) { - return String.fromCharCode(parseInt(v, 16)); - }).join(''); -} -module.exports = globalFuncs; +'use strict'; +var globalFuncs = function() {} +globalFuncs.getBlockie = function(address) { + return blockies.create({ + seed: address.toLowerCase(), + size: 8, + scale: 16 + }).toDataURL(); +} +globalFuncs.printPaperWallets = function(strJson) { + var win = window.open("about:blank", "_blank"); + var data = ""); +} +globalFuncs.getBlob = function(mime, str) { + var str = (typeof str === 'object') ? JSON.stringify(str) : str; + if (str == null) return ''; + var blob = new Blob([str], { + type: mime + }); + return window.URL.createObjectURL(blob); +} +globalFuncs.getSuccessText = function(str) { + return '

' + str + '

' +} +globalFuncs.getDangerText = function(str) { + return '

' + str + '

' +} +globalFuncs.errorMsgs = [ + "Please enter valid amount. ", + "Your password must be at least 9 characters. Please ensure it is a strong password. ", + "Sorry! We don't have a clue what type of wallet file this is. ", + "This is not a valid wallet file. ", + "This unit doesn\'t exists, please use the one of the following units ", + "Invalid address. ", + "Invalid password. ", + "Invalid amount. ", + "Invalid gas limit. ", + "Invalid data value. ", + "Invalid gas amount. ", + "Invalid nonce. ", + "Invalid signed transaction. ", + "A wallet with this nickname already exists. ", + "Wallet not found. ", + "Whoops. It doesnt look like a proposal with this ID exists yet or there is an error reading this proposal. ", + "A wallet with this address already exists in storage. Please check your wallets page. ", + "You need to have at some ETH in your account to cover the cost of gas. .05ETH should be more than sufficient for a few sends and votes. "]; +globalFuncs.successMsgs = ["Valid address", "Wallet successfully decrypted", "Transaction submitted. TX ID: ", "New wallet added: ", "You have successfully voted. Thank you for being an active participant in The DAO."]; +globalFuncs.scrypt = { + n: 1024 +}; +globalFuncs.postDelay = 300; +globalFuncs.kdf = "scrypt"; +globalFuncs.defaultTxGasLimit = 21000; +globalFuncs.digixClaimTxGasLimit = 150000; +globalFuncs.donateAddress = "0x7cB57B5A97eAbe94205C07890BE4c1aD31E486A8"; +globalFuncs.isNumeric = function(n) { + return !isNaN(parseFloat(n)) && isFinite(n); +} +globalFuncs.urlGet = function(name) { + if (name = (new RegExp('[?&]' + encodeURIComponent(name) + '=([^&]*)')).exec(location.search)) return this.stripTags(decodeURIComponent(name[1])); +} +globalFuncs.stripTags = function(str) { + var SCRIPT_REGEX = /)<[^<]*)*<\/script>/gi; + while (SCRIPT_REGEX.test(str)) { + str = str.replace(SCRIPT_REGEX, ""); + } + return str; +} +globalFuncs.checkAndRedirectHTTPS = function() { + var host = "myetherwallet.com"; + var githost = "kvhnuke.github.io"; + var githostw = "www.kvhnuke.github.io"; + var hostw = "www.myetherwallet.com"; + if ((host == window.location.host || githost == window.location.host || hostw == window.location.host || githostw == window.location.host) && (window.location.protocol != "https:")) window.location.protocol = "https"; +} +globalFuncs.isStrongPass = function(password) { + return password.length > 8; +} +globalFuncs.hexToAscii = function(hex) { + return hex.match(/.{1,2}/g).map(function(v) { + return String.fromCharCode(parseInt(v, 16)); + }).join(''); +} +module.exports = globalFuncs; },{}],27:[function(require,module,exports){ -'use strict'; -var IS_CX = false; -if(typeof chrome != 'undefined') - IS_CX = chrome.windows === undefined ? false : true; -require("babel-polyfill"); -var angular = require('angular'); -var BigNumber = require('bignumber.js'); -window.BigNumber = BigNumber; -var marked = require('marked'); -window.marked = marked; -var ethUtil = require('ethereumjs-util'); -ethUtil.crypto = require('crypto'); -ethUtil.Tx = require('ethereumjs-tx'); -ethUtil.scrypt = require('scryptsy'); -ethUtil.uuid = require('uuid'); -window.ethUtil = ethUtil; -var Wallet = require('./myetherwallet'); -window.Wallet = Wallet; -var globalFuncs = require('./globalFuncs'); -window.globalFuncs = globalFuncs; -var uiFuncs = require('./uiFuncs'); -window.uiFuncs = uiFuncs; -var etherUnits = require('./etherUnits'); -window.etherUnits = etherUnits; -var ajaxReq = require('./ajaxReq'); -window.ajaxReq = ajaxReq; -var ethFuncs = require('./ethFuncs'); -window.ethFuncs = ethFuncs; -if(IS_CX){ - var cxFuncs = require('./cxFuncs'); - window.cxFuncs = cxFuncs; -} -var tabsCtrl = require('./controllers/tabsCtrl'); -var viewCtrl = require('./controllers/viewCtrl'); -var walletGenCtrl = require('./controllers/walletGenCtrl'); -var bulkGenCtrl = require('./controllers/bulkGenCtrl'); -var decryptWalletCtrl = require('./controllers/decryptWalletCtrl'); -var viewWalletCtrl = require('./controllers/viewWalletCtrl'); -var sendTxCtrl = require('./controllers/sendTxCtrl'); -var digixCtrl = require('./controllers/digixCtrl'); -var theDaoCtrl = require('./controllers/theDaoCtrl'); -var theDaoProposalCtrl = require('./controllers/theDaoProposalCtrl'); -var sendOfflineTxCtrl = require('./controllers/sendOfflineTxCtrl'); -var globalService = require('./services/globalService'); -var walletService = require('./services/walletService'); -var blockiesDrtv = require('./directives/blockiesDrtv'); -var QRCodeDrtv = require('./directives/QRCodeDrtv'); -var walletDecryptDrtv = require('./directives/walletDecryptDrtv'); -var cxWalletDecryptDrtv = require('./directives/cxWalletDecryptDrtv'); -var fileReaderDrtv = require('./directives/fileReaderDrtv'); -if(IS_CX){ - var addWalletCtrl = require('./controllers/CX/addWalletCtrl'); - var cxDecryptWalletCtrl = require('./controllers/CX/cxDecryptWalletCtrl'); - var myWalletsCtrl = require('./controllers/CX/myWalletsCtrl'); - var mainPopCtrl = require('./controllers/CX/mainPopCtrl'); - var quickSendCtrl = require('./controllers/CX/quickSendCtrl'); -} -var app = angular.module('mewApp', []); -app.config(['$compileProvider', function($compileProvider) { - $compileProvider.aHrefSanitizationWhitelist(/^\s*(|blob|):/); -}]); -app.factory('globalService', ['$http','$httpParamSerializerJQLike',globalService]); -app.factory('walletService', walletService); -app.directive('blockieAddress', blockiesDrtv); -app.directive('qrCode', QRCodeDrtv); -app.directive('onReadFile', fileReaderDrtv); -app.directive('walletDecryptDrtv', walletDecryptDrtv); -app.directive('cxWalletDecryptDrtv', cxWalletDecryptDrtv); -app.controller('tabsCtrl', ['$scope', 'globalService', tabsCtrl]); -app.controller('viewCtrl', ['$scope', 'globalService', viewCtrl]); -app.controller('walletGenCtrl', ['$scope', walletGenCtrl]); -app.controller('bulkGenCtrl', ['$scope', bulkGenCtrl]); -app.controller('decryptWalletCtrl', ['$scope','$sce','walletService', decryptWalletCtrl]); -app.controller('viewWalletCtrl', ['$scope','walletService', viewWalletCtrl]); -app.controller('sendTxCtrl', ['$scope','$sce','walletService', sendTxCtrl]); -app.controller('digixCtrl', ['$scope','$sce','walletService', digixCtrl]); -app.controller('theDaoCtrl', ['$scope','$sce','walletService', theDaoCtrl]); -app.controller('theDaoProposalCtrl', ['$scope','$sce','walletService', theDaoProposalCtrl]); -app.controller('sendOfflineTxCtrl', ['$scope','$sce','walletService', sendOfflineTxCtrl]); -if(IS_CX){ - app.controller('addWalletCtrl', ['$scope','$sce', addWalletCtrl]); - app.controller('myWalletsCtrl', ['$scope','$sce', myWalletsCtrl]); - app.controller('mainPopCtrl', ['$scope','$sce', mainPopCtrl]); - app.controller('quickSendCtrl', ['$scope','$sce', quickSendCtrl]); - app.controller('cxDecryptWalletCtrl', ['$scope','$sce','walletService', cxDecryptWalletCtrl]); -} - -},{"./ajaxReq":1,"./controllers/CX/addWalletCtrl":2,"./controllers/CX/cxDecryptWalletCtrl":3,"./controllers/CX/mainPopCtrl":4,"./controllers/CX/myWalletsCtrl":5,"./controllers/CX/quickSendCtrl":6,"./controllers/bulkGenCtrl":7,"./controllers/decryptWalletCtrl":8,"./controllers/digixCtrl":9,"./controllers/sendOfflineTxCtrl":10,"./controllers/sendTxCtrl":11,"./controllers/tabsCtrl":12,"./controllers/theDaoCtrl":13,"./controllers/theDaoProposalCtrl":14,"./controllers/viewCtrl":15,"./controllers/viewWalletCtrl":16,"./controllers/walletGenCtrl":17,"./cxFuncs":18,"./directives/QRCodeDrtv":19,"./directives/blockiesDrtv":20,"./directives/cxWalletDecryptDrtv":21,"./directives/fileReaderDrtv":22,"./directives/walletDecryptDrtv":23,"./ethFuncs":24,"./etherUnits":25,"./globalFuncs":26,"./myetherwallet":28,"./services/globalService":29,"./services/walletService":30,"./uiFuncs":31,"angular":33,"babel-polyfill":49,"bignumber.js":51,"crypto":386,"ethereumjs-tx":416,"ethereumjs-util":417,"marked":433,"scryptsy":463,"uuid":483}],28:[function(require,module,exports){ +'use strict'; +var IS_CX = false; +if(typeof chrome != 'undefined') + IS_CX = chrome.windows === undefined ? false : true; +require("babel-polyfill"); +var angular = require('angular'); +var BigNumber = require('bignumber.js'); +window.BigNumber = BigNumber; +var marked = require('marked'); +window.marked = marked; +var ethUtil = require('ethereumjs-util'); +ethUtil.crypto = require('crypto'); +ethUtil.Tx = require('ethereumjs-tx'); +ethUtil.scrypt = require('scryptsy'); +ethUtil.uuid = require('uuid'); +window.ethUtil = ethUtil; +var Wallet = require('./myetherwallet'); +window.Wallet = Wallet; +var globalFuncs = require('./globalFuncs'); +window.globalFuncs = globalFuncs; +var uiFuncs = require('./uiFuncs'); +window.uiFuncs = uiFuncs; +var etherUnits = require('./etherUnits'); +window.etherUnits = etherUnits; +var ajaxReq = require('./ajaxReq'); +window.ajaxReq = ajaxReq; +var ethFuncs = require('./ethFuncs'); +window.ethFuncs = ethFuncs; +if(IS_CX){ + var cxFuncs = require('./cxFuncs'); + window.cxFuncs = cxFuncs; +} +var tabsCtrl = require('./controllers/tabsCtrl'); +var viewCtrl = require('./controllers/viewCtrl'); +var walletGenCtrl = require('./controllers/walletGenCtrl'); +var bulkGenCtrl = require('./controllers/bulkGenCtrl'); +var decryptWalletCtrl = require('./controllers/decryptWalletCtrl'); +var viewWalletCtrl = require('./controllers/viewWalletCtrl'); +var sendTxCtrl = require('./controllers/sendTxCtrl'); +var digixCtrl = require('./controllers/digixCtrl'); +var theDaoCtrl = require('./controllers/theDaoCtrl'); +var theDaoProposalCtrl = require('./controllers/theDaoProposalCtrl'); +var sendOfflineTxCtrl = require('./controllers/sendOfflineTxCtrl'); +var globalService = require('./services/globalService'); +var walletService = require('./services/walletService'); +var blockiesDrtv = require('./directives/blockiesDrtv'); +var QRCodeDrtv = require('./directives/QRCodeDrtv'); +var walletDecryptDrtv = require('./directives/walletDecryptDrtv'); +var cxWalletDecryptDrtv = require('./directives/cxWalletDecryptDrtv'); +var fileReaderDrtv = require('./directives/fileReaderDrtv'); +if(IS_CX){ + var addWalletCtrl = require('./controllers/CX/addWalletCtrl'); + var cxDecryptWalletCtrl = require('./controllers/CX/cxDecryptWalletCtrl'); + var myWalletsCtrl = require('./controllers/CX/myWalletsCtrl'); + var mainPopCtrl = require('./controllers/CX/mainPopCtrl'); + var quickSendCtrl = require('./controllers/CX/quickSendCtrl'); +} +var app = angular.module('mewApp', []); +app.config(['$compileProvider', function($compileProvider) { + $compileProvider.aHrefSanitizationWhitelist(/^\s*(|blob|):/); +}]); +app.factory('globalService', ['$http','$httpParamSerializerJQLike',globalService]); +app.factory('walletService', walletService); +app.directive('blockieAddress', blockiesDrtv); +app.directive('qrCode', QRCodeDrtv); +app.directive('onReadFile', fileReaderDrtv); +app.directive('walletDecryptDrtv', walletDecryptDrtv); +app.directive('cxWalletDecryptDrtv', cxWalletDecryptDrtv); +app.controller('tabsCtrl', ['$scope', 'globalService', tabsCtrl]); +app.controller('viewCtrl', ['$scope', 'globalService', viewCtrl]); +app.controller('walletGenCtrl', ['$scope', walletGenCtrl]); +app.controller('bulkGenCtrl', ['$scope', bulkGenCtrl]); +app.controller('decryptWalletCtrl', ['$scope','$sce','walletService', decryptWalletCtrl]); +app.controller('viewWalletCtrl', ['$scope','walletService', viewWalletCtrl]); +app.controller('sendTxCtrl', ['$scope','$sce','walletService', sendTxCtrl]); +app.controller('digixCtrl', ['$scope','$sce','walletService', digixCtrl]); +app.controller('theDaoCtrl', ['$scope','$sce','walletService', theDaoCtrl]); +app.controller('theDaoProposalCtrl', ['$scope','$sce','walletService', theDaoProposalCtrl]); +app.controller('sendOfflineTxCtrl', ['$scope','$sce','walletService', sendOfflineTxCtrl]); +if(IS_CX){ + app.controller('addWalletCtrl', ['$scope','$sce', addWalletCtrl]); + app.controller('myWalletsCtrl', ['$scope','$sce', myWalletsCtrl]); + app.controller('mainPopCtrl', ['$scope','$sce', mainPopCtrl]); + app.controller('quickSendCtrl', ['$scope','$sce', quickSendCtrl]); + app.controller('cxDecryptWalletCtrl', ['$scope','$sce','walletService', cxDecryptWalletCtrl]); +} + +},{"./ajaxReq":1,"./controllers/CX/addWalletCtrl":2,"./controllers/CX/cxDecryptWalletCtrl":3,"./controllers/CX/mainPopCtrl":4,"./controllers/CX/myWalletsCtrl":5,"./controllers/CX/quickSendCtrl":6,"./controllers/bulkGenCtrl":7,"./controllers/decryptWalletCtrl":8,"./controllers/digixCtrl":9,"./controllers/sendOfflineTxCtrl":10,"./controllers/sendTxCtrl":11,"./controllers/tabsCtrl":12,"./controllers/theDaoCtrl":13,"./controllers/theDaoProposalCtrl":14,"./controllers/viewCtrl":15,"./controllers/viewWalletCtrl":16,"./controllers/walletGenCtrl":17,"./cxFuncs":18,"./directives/QRCodeDrtv":19,"./directives/blockiesDrtv":20,"./directives/cxWalletDecryptDrtv":21,"./directives/fileReaderDrtv":22,"./directives/walletDecryptDrtv":23,"./ethFuncs":24,"./etherUnits":25,"./globalFuncs":26,"./myetherwallet":28,"./services/globalService":29,"./services/walletService":30,"./uiFuncs":31,"angular":33,"babel-polyfill":49,"bignumber.js":52,"crypto":387,"ethereumjs-tx":417,"ethereumjs-util":418,"marked":434,"scryptsy":463,"uuid":483}],28:[function(require,module,exports){ (function (Buffer){ -'use strict'; -var Wallet = function(priv) { - this.privKey = priv.length == 32 ? priv : Buffer(priv, 'hex') -} -Wallet.generate = function(icapDirect) { - if (icapDirect) { - while (true) { - var privKey = ethUtil.crypto.randomBytes(32) - if (ethUtil.privateToAddress(privKey)[0] === 0) { - return new Wallet(privKey) - } - } - } else { - return new Wallet(ethUtil.crypto.randomBytes(32)) - } -} -Wallet.prototype.getPrivateKey = function() { - return this.privKey -} -Wallet.prototype.getPrivateKeyString = function() { - return this.getPrivateKey().toString('hex') -} -Wallet.prototype.getPublicKey = function() { - return ethUtil.privateToPublic(this.privKey) -} -Wallet.prototype.getPublicKeyString = function() { - return '0x' + this.getPublicKey().toString('hex') -} -Wallet.prototype.getAddress = function() { - return ethUtil.privateToAddress(this.privKey) -} -Wallet.prototype.getAddressString = function() { - return '0x' + this.getAddress().toString('hex') -} -Wallet.prototype.getChecksumAddressString = function() { - return ethUtil.toChecksumAddress(this.getAddressString()) -} -Wallet.fromPrivateKey = function(priv) { - return new Wallet(priv) -} -Wallet.prototype.toV3 = function(password, opts) { - opts = opts || {} - var salt = opts.salt || ethUtil.crypto.randomBytes(32) - var iv = opts.iv || ethUtil.crypto.randomBytes(16) - var derivedKey - var kdf = opts.kdf || 'scrypt' - var kdfparams = { - dklen: opts.dklen || 32, - salt: salt.toString('hex') - } - if (kdf === 'pbkdf2') { - kdfparams.c = opts.c || 262144 - kdfparams.prf = 'hmac-sha256' - derivedKey = ethUtil.crypto.pbkdf2Sync(new Buffer(password), salt, kdfparams.c, kdfparams.dklen, 'sha256') - } else if (kdf === 'scrypt') { - // FIXME: support progress reporting callback - kdfparams.n = opts.n || 262144 - kdfparams.r = opts.r || 8 - kdfparams.p = opts.p || 1 - derivedKey = ethUtil.scrypt(new Buffer(password), salt, kdfparams.n, kdfparams.r, kdfparams.p, kdfparams.dklen) - } else { - throw new Error('Unsupported kdf') - } - var cipher = ethUtil.crypto.createCipheriv(opts.cipher || 'aes-128-ctr', derivedKey.slice(0, 16), iv) - if (!cipher) { - throw new Error('Unsupported cipher') - } - var ciphertext = Buffer.concat([cipher.update(this.privKey), cipher.final()]) - var mac = ethUtil.sha3(Buffer.concat([derivedKey.slice(16, 32), new Buffer(ciphertext, 'hex')])) - return { - version: 3, - id: ethUtil.uuid.v4({ - random: opts.uuid || ethUtil.crypto.randomBytes(16) - }), - address: this.getAddress().toString('hex'), - Crypto: { - ciphertext: ciphertext.toString('hex'), - cipherparams: { - iv: iv.toString('hex') - }, - cipher: opts.cipher || 'aes-128-ctr', - kdf: kdf, - kdfparams: kdfparams, - mac: mac.toString('hex') - } - } -} -Wallet.prototype.toJSON = function() { - return { - address: this.getAddressString(), - checksumAddress: this.getChecksumAddressString(), - privKey: this.getPrivateKeyString(), - pubKey: this.getPublicKeyString(), - publisher:"MyEtherWallet", - encrypted:false, - version:2 - } -} -Wallet.fromMyEtherWallet = function(input, password) { - var json = (typeof input === 'object') ? input : JSON.parse(input) - var privKey - if (!json.locked) { - if (json.private.length !== 64) { - throw new Error('Invalid private key length') - } - privKey = new Buffer(json.private, 'hex') - } else { - if (typeof password !== 'string') { - throw new Error('Password required') - } - if (password.length < 7) { - throw new Error('Password must be at least 7 characters') - } - var cipher = json.encrypted ? json.private.slice(0, 128) : json.private - cipher = Wallet.decodeCryptojsSalt(cipher) - var evp = Wallet.evp_kdf(new Buffer(password), cipher.salt, { - keysize: 32, - ivsize: 16 - }) - var decipher = ethUtil.crypto.createDecipheriv('aes-256-cbc', evp.key, evp.iv) - privKey = Wallet.decipherBuffer(decipher, new Buffer(cipher.ciphertext)) - privKey = new Buffer((privKey.toString()), 'hex') - } - var wallet = new Wallet(privKey) - if (wallet.getAddressString() !== json.address) { - throw new Error('Invalid private key or address') - } - return wallet -} -Wallet.fromMyEtherWalletV2 = function (input){ - var json = (typeof input === 'object') ? input : JSON.parse(input); - if (json.privKey.length !== 64) { - throw new Error('Invalid private key length'); - }; - var privKey = new Buffer(json.privKey, 'hex'); - return new Wallet(privKey); -} -Wallet.fromEthSale = function(input, password) { - var json = (typeof input === 'object') ? input : JSON.parse(input) - var encseed = new Buffer(json.encseed, 'hex') - var derivedKey = ethUtil.crypto.pbkdf2Sync(Buffer(password), Buffer(password), 2000, 32, 'sha256').slice(0, 16) - var decipher = ethUtil.crypto.createDecipheriv('aes-128-cbc', derivedKey, encseed.slice(0, 16)) - var seed = Wallet.decipherBuffer(decipher, encseed.slice(16)) - var wallet = new Wallet(ethUtil.sha3(seed)) - if (wallet.getAddress().toString('hex') !== json.ethaddr) { - throw new Error('Decoded key mismatch - possibly wrong passphrase') - } - return wallet -} -Wallet.fromMyEtherWalletKey = function(input, password) { - var cipher = input.slice(0, 128) - cipher = Wallet.decodeCryptojsSalt(cipher) - var evp = Wallet.evp_kdf(new Buffer(password), cipher.salt, { - keysize: 32, - ivsize: 16 - }) - var decipher = ethUtil.crypto.createDecipheriv('aes-256-cbc', evp.key, evp.iv) - var privKey = Wallet.decipherBuffer(decipher, new Buffer(cipher.ciphertext)) - privKey = new Buffer((privKey.toString()), 'hex') - return new Wallet(privKey) -} -Wallet.fromV3 = function(input, password, nonStrict) { - var json = (typeof input === 'object') ? input : JSON.parse(nonStrict ? input.toLowerCase() : input) - if (json.version !== 3) { - throw new Error('Not a V3 wallet') - } - var derivedKey - var kdfparams - if (json.crypto.kdf === 'scrypt') { - kdfparams = json.crypto.kdfparams - derivedKey = ethUtil.scrypt(new Buffer(password), new Buffer(kdfparams.salt, 'hex'), kdfparams.n, kdfparams.r, kdfparams.p, kdfparams.dklen) - } else if (json.crypto.kdf === 'pbkdf2') { - kdfparams = json.crypto.kdfparams - if (kdfparams.prf !== 'hmac-sha256') { - throw new Error('Unsupported parameters to PBKDF2') - } - derivedKey = ethUtil.crypto.pbkdf2Sync(new Buffer(password), new Buffer(kdfparams.salt, 'hex'), kdfparams.c, kdfparams.dklen, 'sha256') - } else { - throw new Error('Unsupported key derivation scheme') - } - var ciphertext = new Buffer(json.crypto.ciphertext, 'hex') - var mac = ethUtil.sha3(Buffer.concat([derivedKey.slice(16, 32), ciphertext])) - if (mac.toString('hex') !== json.crypto.mac) { - throw new Error('Key derivation failed - possibly wrong passphrase') - } - var decipher = ethUtil.crypto.createDecipheriv(json.crypto.cipher, derivedKey.slice(0, 16), new Buffer(json.crypto.cipherparams.iv, 'hex')) - var seed = Wallet.decipherBuffer(decipher, ciphertext, 'hex') - return new Wallet(seed) -} -Wallet.prototype.toV3String = function(password, opts) { - return JSON.stringify(this.toV3(password, opts)) -} -Wallet.prototype.getV3Filename = function (timestamp) { - var ts = timestamp ? new Date(timestamp) : new Date() - return [ - 'UTC--', - ts.toJSON().replace(/:/g, '-'), - '--', - this.getAddress().toString('hex') - ].join('') -} -Wallet.decipherBuffer = function(decipher, data) { - return Buffer.concat([decipher.update(data), decipher.final()]) -} -Wallet.decodeCryptojsSalt = function(input) { - var ciphertext = new Buffer(input, 'base64') - if (ciphertext.slice(0, 8).toString() === 'Salted__') { - return { - salt: ciphertext.slice(8, 16), - ciphertext: ciphertext.slice(16) - } - } else { - return { - ciphertext: ciphertext - } - } -} -Wallet.evp_kdf = function(data, salt, opts) { - // A single EVP iteration, returns `D_i`, where block equlas to `D_(i-1)` - - function iter(block) { - var hash = ethUtil.crypto.createHash(opts.digest || 'md5') - hash.update(block) - hash.update(data) - hash.update(salt) - block = hash.digest() - for (var i = 1; i < (opts.count || 1); i++) { - hash = ethUtil.crypto.createHash(opts.digest || 'md5') - hash.update(block) - block = hash.digest() - } - return block - } - var keysize = opts.keysize || 16 - var ivsize = opts.ivsize || 16 - var ret = [] - var i = 0 - while (Buffer.concat(ret).length < (keysize + ivsize)) { - ret[i] = iter((i === 0) ? new Buffer(0) : ret[i - 1]) - i++ - } - var tmp = Buffer.concat(ret) - return { - key: tmp.slice(0, keysize), - iv: tmp.slice(keysize, keysize + ivsize) - } -} -Wallet.walletRequirePass = function(ethjson) { - var jsonArr; - try { - jsonArr = JSON.parse(ethjson); - } catch (err) { - throw globalFuncs.errorMsgs[3]; - } - if (jsonArr.encseed != null) return true; - else if (jsonArr.Crypto != null || jsonArr.crypto != null) return true - else if (jsonArr.hash != null && jsonArr.locked) return true; - else if (jsonArr.hash != null && !jsonArr.locked) return false; - else if (jsonArr.publisher == "MyEtherWallet" && !jsonArr.encrypted) return false; - else - throw globalFuncs.errorMsgs[2]; -} -Wallet.getWalletFromPrivKeyFile = function(strjson, password) { - var jsonArr = JSON.parse(strjson); - if (jsonArr.encseed != null) return Wallet.fromEthSale(strjson, password); - else if (jsonArr.Crypto != null || jsonArr.crypto != null) return Wallet.fromV3(strjson, password, true); - else if (jsonArr.hash != null) return Wallet.fromMyEtherWallet(strjson, password); - else if (jsonArr.publisher == "MyEtherWallet") return Wallet.fromMyEtherWalletV2(strjson); - else - throw globalFuncs.errorMsgs[2]; -} +'use strict'; +var Wallet = function(priv) { + this.privKey = priv.length == 32 ? priv : Buffer(priv, 'hex') +} +Wallet.generate = function(icapDirect) { + if (icapDirect) { + while (true) { + var privKey = ethUtil.crypto.randomBytes(32) + if (ethUtil.privateToAddress(privKey)[0] === 0) { + return new Wallet(privKey) + } + } + } else { + return new Wallet(ethUtil.crypto.randomBytes(32)) + } +} +Wallet.prototype.getPrivateKey = function() { + return this.privKey +} +Wallet.prototype.getPrivateKeyString = function() { + return this.getPrivateKey().toString('hex') +} +Wallet.prototype.getPublicKey = function() { + return ethUtil.privateToPublic(this.privKey) +} +Wallet.prototype.getPublicKeyString = function() { + return '0x' + this.getPublicKey().toString('hex') +} +Wallet.prototype.getAddress = function() { + return ethUtil.privateToAddress(this.privKey) +} +Wallet.prototype.getAddressString = function() { + return '0x' + this.getAddress().toString('hex') +} +Wallet.prototype.getChecksumAddressString = function() { + return ethUtil.toChecksumAddress(this.getAddressString()) +} +Wallet.fromPrivateKey = function(priv) { + return new Wallet(priv) +} +Wallet.prototype.toV3 = function(password, opts) { + opts = opts || {} + var salt = opts.salt || ethUtil.crypto.randomBytes(32) + var iv = opts.iv || ethUtil.crypto.randomBytes(16) + var derivedKey + var kdf = opts.kdf || 'scrypt' + var kdfparams = { + dklen: opts.dklen || 32, + salt: salt.toString('hex') + } + if (kdf === 'pbkdf2') { + kdfparams.c = opts.c || 262144 + kdfparams.prf = 'hmac-sha256' + derivedKey = ethUtil.crypto.pbkdf2Sync(new Buffer(password), salt, kdfparams.c, kdfparams.dklen, 'sha256') + } else if (kdf === 'scrypt') { + // FIXME: support progress reporting callback + kdfparams.n = opts.n || 262144 + kdfparams.r = opts.r || 8 + kdfparams.p = opts.p || 1 + derivedKey = ethUtil.scrypt(new Buffer(password), salt, kdfparams.n, kdfparams.r, kdfparams.p, kdfparams.dklen) + } else { + throw new Error('Unsupported kdf') + } + var cipher = ethUtil.crypto.createCipheriv(opts.cipher || 'aes-128-ctr', derivedKey.slice(0, 16), iv) + if (!cipher) { + throw new Error('Unsupported cipher') + } + var ciphertext = Buffer.concat([cipher.update(this.privKey), cipher.final()]) + var mac = ethUtil.sha3(Buffer.concat([derivedKey.slice(16, 32), new Buffer(ciphertext, 'hex')])) + return { + version: 3, + id: ethUtil.uuid.v4({ + random: opts.uuid || ethUtil.crypto.randomBytes(16) + }), + address: this.getAddress().toString('hex'), + Crypto: { + ciphertext: ciphertext.toString('hex'), + cipherparams: { + iv: iv.toString('hex') + }, + cipher: opts.cipher || 'aes-128-ctr', + kdf: kdf, + kdfparams: kdfparams, + mac: mac.toString('hex') + } + } +} +Wallet.prototype.toJSON = function() { + return { + address: this.getAddressString(), + checksumAddress: this.getChecksumAddressString(), + privKey: this.getPrivateKeyString(), + pubKey: this.getPublicKeyString(), + publisher:"MyEtherWallet", + encrypted:false, + version:2 + } +} +Wallet.fromMyEtherWallet = function(input, password) { + var json = (typeof input === 'object') ? input : JSON.parse(input) + var privKey + if (!json.locked) { + if (json.private.length !== 64) { + throw new Error('Invalid private key length') + } + privKey = new Buffer(json.private, 'hex') + } else { + if (typeof password !== 'string') { + throw new Error('Password required') + } + if (password.length < 7) { + throw new Error('Password must be at least 7 characters') + } + var cipher = json.encrypted ? json.private.slice(0, 128) : json.private + cipher = Wallet.decodeCryptojsSalt(cipher) + var evp = Wallet.evp_kdf(new Buffer(password), cipher.salt, { + keysize: 32, + ivsize: 16 + }) + var decipher = ethUtil.crypto.createDecipheriv('aes-256-cbc', evp.key, evp.iv) + privKey = Wallet.decipherBuffer(decipher, new Buffer(cipher.ciphertext)) + privKey = new Buffer((privKey.toString()), 'hex') + } + var wallet = new Wallet(privKey) + if (wallet.getAddressString() !== json.address) { + throw new Error('Invalid private key or address') + } + return wallet +} +Wallet.fromMyEtherWalletV2 = function (input){ + var json = (typeof input === 'object') ? input : JSON.parse(input); + if (json.privKey.length !== 64) { + throw new Error('Invalid private key length'); + }; + var privKey = new Buffer(json.privKey, 'hex'); + return new Wallet(privKey); +} +Wallet.fromEthSale = function(input, password) { + var json = (typeof input === 'object') ? input : JSON.parse(input) + var encseed = new Buffer(json.encseed, 'hex') + var derivedKey = ethUtil.crypto.pbkdf2Sync(Buffer(password), Buffer(password), 2000, 32, 'sha256').slice(0, 16) + var decipher = ethUtil.crypto.createDecipheriv('aes-128-cbc', derivedKey, encseed.slice(0, 16)) + var seed = Wallet.decipherBuffer(decipher, encseed.slice(16)) + var wallet = new Wallet(ethUtil.sha3(seed)) + if (wallet.getAddress().toString('hex') !== json.ethaddr) { + throw new Error('Decoded key mismatch - possibly wrong passphrase') + } + return wallet +} +Wallet.fromMyEtherWalletKey = function(input, password) { + var cipher = input.slice(0, 128) + cipher = Wallet.decodeCryptojsSalt(cipher) + var evp = Wallet.evp_kdf(new Buffer(password), cipher.salt, { + keysize: 32, + ivsize: 16 + }) + var decipher = ethUtil.crypto.createDecipheriv('aes-256-cbc', evp.key, evp.iv) + var privKey = Wallet.decipherBuffer(decipher, new Buffer(cipher.ciphertext)) + privKey = new Buffer((privKey.toString()), 'hex') + return new Wallet(privKey) +} +Wallet.fromV3 = function(input, password, nonStrict) { + var json = (typeof input === 'object') ? input : JSON.parse(nonStrict ? input.toLowerCase() : input) + if (json.version !== 3) { + throw new Error('Not a V3 wallet') + } + var derivedKey + var kdfparams + if (json.crypto.kdf === 'scrypt') { + kdfparams = json.crypto.kdfparams + derivedKey = ethUtil.scrypt(new Buffer(password), new Buffer(kdfparams.salt, 'hex'), kdfparams.n, kdfparams.r, kdfparams.p, kdfparams.dklen) + } else if (json.crypto.kdf === 'pbkdf2') { + kdfparams = json.crypto.kdfparams + if (kdfparams.prf !== 'hmac-sha256') { + throw new Error('Unsupported parameters to PBKDF2') + } + derivedKey = ethUtil.crypto.pbkdf2Sync(new Buffer(password), new Buffer(kdfparams.salt, 'hex'), kdfparams.c, kdfparams.dklen, 'sha256') + } else { + throw new Error('Unsupported key derivation scheme') + } + var ciphertext = new Buffer(json.crypto.ciphertext, 'hex') + var mac = ethUtil.sha3(Buffer.concat([derivedKey.slice(16, 32), ciphertext])) + if (mac.toString('hex') !== json.crypto.mac) { + throw new Error('Key derivation failed - possibly wrong passphrase') + } + var decipher = ethUtil.crypto.createDecipheriv(json.crypto.cipher, derivedKey.slice(0, 16), new Buffer(json.crypto.cipherparams.iv, 'hex')) + var seed = Wallet.decipherBuffer(decipher, ciphertext, 'hex') + return new Wallet(seed) +} +Wallet.prototype.toV3String = function(password, opts) { + return JSON.stringify(this.toV3(password, opts)) +} +Wallet.prototype.getV3Filename = function (timestamp) { + var ts = timestamp ? new Date(timestamp) : new Date() + return [ + 'UTC--', + ts.toJSON().replace(/:/g, '-'), + '--', + this.getAddress().toString('hex') + ].join('') +} +Wallet.decipherBuffer = function(decipher, data) { + return Buffer.concat([decipher.update(data), decipher.final()]) +} +Wallet.decodeCryptojsSalt = function(input) { + var ciphertext = new Buffer(input, 'base64') + if (ciphertext.slice(0, 8).toString() === 'Salted__') { + return { + salt: ciphertext.slice(8, 16), + ciphertext: ciphertext.slice(16) + } + } else { + return { + ciphertext: ciphertext + } + } +} +Wallet.evp_kdf = function(data, salt, opts) { + // A single EVP iteration, returns `D_i`, where block equlas to `D_(i-1)` + + function iter(block) { + var hash = ethUtil.crypto.createHash(opts.digest || 'md5') + hash.update(block) + hash.update(data) + hash.update(salt) + block = hash.digest() + for (var i = 1; i < (opts.count || 1); i++) { + hash = ethUtil.crypto.createHash(opts.digest || 'md5') + hash.update(block) + block = hash.digest() + } + return block + } + var keysize = opts.keysize || 16 + var ivsize = opts.ivsize || 16 + var ret = [] + var i = 0 + while (Buffer.concat(ret).length < (keysize + ivsize)) { + ret[i] = iter((i === 0) ? new Buffer(0) : ret[i - 1]) + i++ + } + var tmp = Buffer.concat(ret) + return { + key: tmp.slice(0, keysize), + iv: tmp.slice(keysize, keysize + ivsize) + } +} +Wallet.walletRequirePass = function(ethjson) { + var jsonArr; + try { + jsonArr = JSON.parse(ethjson); + } catch (err) { + throw globalFuncs.errorMsgs[3]; + } + if (jsonArr.encseed != null) return true; + else if (jsonArr.Crypto != null || jsonArr.crypto != null) return true + else if (jsonArr.hash != null && jsonArr.locked) return true; + else if (jsonArr.hash != null && !jsonArr.locked) return false; + else if (jsonArr.publisher == "MyEtherWallet" && !jsonArr.encrypted) return false; + else + throw globalFuncs.errorMsgs[2]; +} +Wallet.getWalletFromPrivKeyFile = function(strjson, password) { + var jsonArr = JSON.parse(strjson); + if (jsonArr.encseed != null) return Wallet.fromEthSale(strjson, password); + else if (jsonArr.Crypto != null || jsonArr.crypto != null) return Wallet.fromV3(strjson, password, true); + else if (jsonArr.hash != null) return Wallet.fromMyEtherWallet(strjson, password); + else if (jsonArr.publisher == "MyEtherWallet") return Wallet.fromMyEtherWalletV2(strjson); + else + throw globalFuncs.errorMsgs[2]; +} module.exports = Wallet; }).call(this,require("buffer").Buffer) -},{"buffer":83}],29:[function(require,module,exports){ -'use strict'; -var globalService = function($http, $httpParamSerializerJQLike) { - globalFuncs.checkAndRedirectHTTPS(); - ajaxReq.http = $http; - ajaxReq.postSerializer = $httpParamSerializerJQLike; - - var tabs = { - generateWallet: { - id: 0, - name: "Generate Wallet", - url: "generate-wallet", - mew: true, - cx: false - }, - bulkGenerate: { - id: 1, - name: "Bulk Generate", - url: "bulk-generate", - mew: false, - cx: false - }, - viewWalletInfo: { - id: 2, - name: "View Wallet Info", - url: "view-wallet-info", - mew: true, - cx: false - }, - myWallet: { - id: 3, - name: "My Wallets", - url: "my-wallet", - mew: false, - cx: true - }, - addWallet: { - id: 4, - name: "Add Wallet", - url: "add-wallet", - mew: false, - cx: true - }, - sendTransaction: { - id: 5, - name: "Send Transaction", - url: "send-transaction", - mew: true, - cx: true - }, - offlineTransaction: { - id: 6, - name: "Offline Transaction", - url:"offline-transaction", - mew: true, - cx: false - }, - dao: { - id: 7, - name: "The DAO", - url: "the-dao", - mew: true, - cx: true - }, - daoproposals: { - id: 8, - name: "DAO Proposals", - url: "dao-proposals", - mew: true, - cx: true - }, - digix: { - id: 9, - name: "Digix", - url: "digix", - mew: true, - cx: true - }, - contracts: { - id: 10, - name: "Contracts", - url:"contracts", - mew: false, - cx: false - }, - help: { - id: 11, - name: "Help", - url: "help", - mew: true, - cx: true - } - }; - var currentTab = 0; - if(typeof chrome != 'undefined') - currentTab = chrome.windows === undefined ? 0 : 3; - return { - tabs: tabs, - currentTab: currentTab - }; -}; -module.exports = globalService; - - +},{"buffer":84}],29:[function(require,module,exports){ +'use strict'; +var globalService = function($http, $httpParamSerializerJQLike) { + globalFuncs.checkAndRedirectHTTPS(); + ajaxReq.http = $http; + ajaxReq.postSerializer = $httpParamSerializerJQLike; + + var tabs = { + generateWallet: { + id: 0, + name: "Generate Wallet", + url: "generate-wallet", + mew: true, + cx: false + }, + bulkGenerate: { + id: 1, + name: "Bulk Generate", + url: "bulk-generate", + mew: false, + cx: false + }, + viewWalletInfo: { + id: 2, + name: "View Wallet Info", + url: "view-wallet-info", + mew: true, + cx: false + }, + myWallet: { + id: 3, + name: "My Wallets", + url: "my-wallet", + mew: false, + cx: true + }, + addWallet: { + id: 4, + name: "Add Wallet", + url: "add-wallet", + mew: false, + cx: true + }, + sendTransaction: { + id: 5, + name: "Send Transaction", + url: "send-transaction", + mew: true, + cx: true + }, + offlineTransaction: { + id: 6, + name: "Offline Transaction", + url:"offline-transaction", + mew: true, + cx: false + }, + dao: { + id: 7, + name: "The DAO", + url: "the-dao", + mew: true, + cx: true + }, + daoproposals: { + id: 8, + name: "DAO Proposals", + url: "dao-proposals", + mew: true, + cx: true + }, + digix: { + id: 9, + name: "Digix", + url: "digix", + mew: true, + cx: true + }, + contracts: { + id: 10, + name: "Contracts", + url:"contracts", + mew: false, + cx: false + }, + help: { + id: 11, + name: "Help", + url: "help", + mew: true, + cx: true + } + }; + var currentTab = 0; + if(typeof chrome != 'undefined') + currentTab = chrome.windows === undefined ? 0 : 3; + return { + tabs: tabs, + currentTab: currentTab + }; +}; +module.exports = globalService; + + },{}],30:[function(require,module,exports){ -'use strict'; -var walletService = function() { - return { - wallet: null, - password:'' - } -}; +'use strict'; +var walletService = function() { + return { + wallet: null, + password:'' + } +}; module.exports = walletService; },{}],31:[function(require,module,exports){ (function (Buffer){ -'use strict'; -var uiFuncs = function() {} -uiFuncs.generateTx = function($scope, $sce, callback) { - try { - if (!ethFuncs.validateEtherAddress($scope.tx.to)) throw globalFuncs.errorMsgs[5]; - else if (!globalFuncs.isNumeric($scope.tx.value) || parseFloat($scope.tx.value) < 0) throw globalFuncs.errorMsgs[7]; - else if (!globalFuncs.isNumeric($scope.tx.gasLimit) || parseFloat($scope.tx.gasLimit) <= 0) throw globalFuncs.errorMsgs[8]; - else if (!ethFuncs.validateHexString($scope.tx.data)) throw globalFuncs.errorMsgs[9]; - ajaxReq.getTransactionData($scope.wallet.getAddressString(), function(data) { - if (data.error) throw data.msg; - data = data.data; - var rawTx = { - nonce: ethFuncs.sanitizeHex(data.nonce), - gasPrice: ethFuncs.sanitizeHex(ethFuncs.addTinyMoreToGas(data.gasprice)), - gasLimit: ethFuncs.sanitizeHex(ethFuncs.decimalToHex($scope.tx.gasLimit)), - to: ethFuncs.sanitizeHex($scope.tx.to), - value: ethFuncs.sanitizeHex(ethFuncs.decimalToHex(etherUnits.toWei($scope.tx.value, $scope.tx.unit))), - data: ethFuncs.sanitizeHex($scope.tx.data) - } - var eTx = new ethUtil.Tx(rawTx); - eTx.sign(new Buffer($scope.wallet.getPrivateKeyString(), 'hex')); - $scope.rawTx = JSON.stringify(rawTx); - $scope.signedTx = '0x' + eTx.serialize().toString('hex'); - $scope.showRaw = true; - if($scope.autoSend){ - uiFuncs.sendTx($scope, $sce); - $scope.autoSend = false; - } - if(callback !== undefined) callback(); - }); - $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText('')); - } catch (e) { - $scope.showRaw = false; - $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } -} -uiFuncs.sendTx = function($scope, $sce) { - if(document.getElementById('sendTransaction')!=null) - new Modal(document.getElementById('sendTransaction')).close(); - ajaxReq.sendRawTx($scope.signedTx, function(data) { - if (data.error) { - $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(data.msg)); - } else { - if( $scope.setBalance !== undefined ) $scope.setBalance(); - $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[2] + " " + data.data)); - } - }); -} -uiFuncs.transferAllBalance = function($scope, $sce) { - try { - ajaxReq.getTransactionData($scope.wallet.getAddressString(), function(data) { - if (data.error) throw data.msg; - data = data.data; - var gasPrice = new BigNumber(ethFuncs.sanitizeHex(ethFuncs.addTinyMoreToGas(data.gasprice))).times($scope.tx.gasLimit); - var maxVal = new BigNumber(data.balance).minus(gasPrice); - $scope.tx.unit = "ether"; - $scope.tx.value = etherUnits.toEther(maxVal, 'wei'); - $scope.tx.value = $scope.tx.value < 0 ? 0 : $scope.tx.value; - }); - } catch (e) { - $scope.showRaw = false; - $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } -} +'use strict'; +var uiFuncs = function() {} +uiFuncs.generateTx = function($scope, $sce, callback) { + try { + if (!ethFuncs.validateEtherAddress($scope.tx.to)) throw globalFuncs.errorMsgs[5]; + else if (!globalFuncs.isNumeric($scope.tx.value) || parseFloat($scope.tx.value) < 0) throw globalFuncs.errorMsgs[7]; + else if (!globalFuncs.isNumeric($scope.tx.gasLimit) || parseFloat($scope.tx.gasLimit) <= 0) throw globalFuncs.errorMsgs[8]; + else if (!ethFuncs.validateHexString($scope.tx.data)) throw globalFuncs.errorMsgs[9]; + ajaxReq.getTransactionData($scope.wallet.getAddressString(), function(data) { + if (data.error) throw data.msg; + data = data.data; + var rawTx = { + nonce: ethFuncs.sanitizeHex(data.nonce), + gasPrice: ethFuncs.sanitizeHex(ethFuncs.addTinyMoreToGas(data.gasprice)), + gasLimit: ethFuncs.sanitizeHex(ethFuncs.decimalToHex($scope.tx.gasLimit)), + to: ethFuncs.sanitizeHex($scope.tx.to), + value: ethFuncs.sanitizeHex(ethFuncs.decimalToHex(etherUnits.toWei($scope.tx.value, $scope.tx.unit))), + data: ethFuncs.sanitizeHex($scope.tx.data) + } + var eTx = new ethUtil.Tx(rawTx); + eTx.sign(new Buffer($scope.wallet.getPrivateKeyString(), 'hex')); + $scope.rawTx = JSON.stringify(rawTx); + $scope.signedTx = '0x' + eTx.serialize().toString('hex'); + $scope.showRaw = true; + if($scope.autoSend){ + uiFuncs.sendTx($scope, $sce); + $scope.autoSend = false; + } + if(callback !== undefined) callback(); + }); + $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText('')); + } catch (e) { + $scope.showRaw = false; + $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } +} +uiFuncs.sendTx = function($scope, $sce) { + if(document.getElementById('sendTransaction')!=null) + new Modal(document.getElementById('sendTransaction')).close(); + ajaxReq.sendRawTx($scope.signedTx, function(data) { + if (data.error) { + $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(data.msg)); + } else { + if( $scope.setBalance !== undefined ) $scope.setBalance(); + $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[2] + " " + data.data)); + } + }); +} +uiFuncs.transferAllBalance = function($scope, $sce) { + try { + ajaxReq.getTransactionData($scope.wallet.getAddressString(), function(data) { + if (data.error) throw data.msg; + data = data.data; + var gasPrice = new BigNumber(ethFuncs.sanitizeHex(ethFuncs.addTinyMoreToGas(data.gasprice))).times($scope.tx.gasLimit); + var maxVal = new BigNumber(data.balance).minus(gasPrice); + $scope.tx.unit = "ether"; + $scope.tx.value = etherUnits.toEther(maxVal, 'wei'); + $scope.tx.value = $scope.tx.value < 0 ? 0 : $scope.tx.value; + }); + } catch (e) { + $scope.showRaw = false; + $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } +} module.exports = uiFuncs; }).call(this,require("buffer").Buffer) -},{"buffer":83}],32:[function(require,module,exports){ +},{"buffer":84}],32:[function(require,module,exports){ /** * @license AngularJS v1.5.6 * (c) 2010-2016 Google, Inc. http://angularjs.org @@ -33565,7 +33507,7 @@ asn1.constants = require('./asn1/constants'); asn1.decoders = require('./asn1/decoders'); asn1.encoders = require('./asn1/encoders'); -},{"./asn1/api":35,"./asn1/base":37,"./asn1/constants":41,"./asn1/decoders":43,"./asn1/encoders":46,"bn.js":53}],35:[function(require,module,exports){ +},{"./asn1/api":35,"./asn1/base":37,"./asn1/constants":41,"./asn1/decoders":43,"./asn1/encoders":46,"bn.js":54}],35:[function(require,module,exports){ var asn1 = require('../asn1'); var inherits = require('inherits'); @@ -33628,7 +33570,7 @@ Entity.prototype.encode = function encode(data, enc, /* internal */ reporter) { return this._getEncoder(enc).encode(data, reporter); }; -},{"../asn1":34,"inherits":428,"vm":484}],36:[function(require,module,exports){ +},{"../asn1":34,"inherits":429,"vm":484}],36:[function(require,module,exports){ var inherits = require('inherits'); var Reporter = require('../base').Reporter; var Buffer = require('buffer').Buffer; @@ -33746,7 +33688,7 @@ EncoderBuffer.prototype.join = function join(out, offset) { return out; }; -},{"../base":37,"buffer":83,"inherits":428}],37:[function(require,module,exports){ +},{"../base":37,"buffer":84,"inherits":429}],37:[function(require,module,exports){ var base = exports; base.Reporter = require('./reporter').Reporter; @@ -34371,7 +34313,7 @@ Node.prototype._isPrintstr = function isPrintstr(str) { return /^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(str); }; -},{"../base":37,"minimalistic-assert":435}],39:[function(require,module,exports){ +},{"../base":37,"minimalistic-assert":436}],39:[function(require,module,exports){ var inherits = require('inherits'); function Reporter(options) { @@ -34475,7 +34417,7 @@ ReporterError.prototype.rethrow = function rethrow(msg) { return this; }; -},{"inherits":428}],40:[function(require,module,exports){ +},{"inherits":429}],40:[function(require,module,exports){ var constants = require('../constants'); exports.tagClass = { @@ -34863,7 +34805,7 @@ function derDecodeLen(buf, primitive, fail) { return len; } -},{"../../asn1":34,"inherits":428}],43:[function(require,module,exports){ +},{"../../asn1":34,"inherits":429}],43:[function(require,module,exports){ var decoders = exports; decoders.der = require('./der'); @@ -34920,7 +34862,7 @@ PEMDecoder.prototype.decode = function decode(data, options) { return DERDecoder.prototype.decode.call(this, input, options); }; -},{"./der":42,"buffer":83,"inherits":428}],45:[function(require,module,exports){ +},{"./der":42,"buffer":84,"inherits":429}],45:[function(require,module,exports){ var inherits = require('inherits'); var Buffer = require('buffer').Buffer; @@ -35215,7 +35157,7 @@ function encodeTag(tag, primitive, cls, reporter) { return res; } -},{"../../asn1":34,"buffer":83,"inherits":428}],46:[function(require,module,exports){ +},{"../../asn1":34,"buffer":84,"inherits":429}],46:[function(require,module,exports){ var encoders = exports; encoders.der = require('./der'); @@ -35244,7 +35186,7 @@ PEMEncoder.prototype.encode = function encode(data, options) { return out.join('\n'); }; -},{"./der":45,"inherits":428}],48:[function(require,module,exports){ +},{"./der":45,"inherits":429}],48:[function(require,module,exports){ // http://wiki.commonjs.org/wiki/Unit_Testing/1.0 // // THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8! @@ -35607,13 +35549,13 @@ var objectKeys = Object.keys || function (obj) { },{"util/":481}],49:[function(require,module,exports){ (function (global){ -"use strict"; +/*istanbul ignore next*/"use strict"; -require("core-js/shim"); +/*istanbul ignore next*/require("core-js/shim"); -require("regenerator-runtime/runtime"); +/*istanbul ignore next*/require("babel-regenerator-runtime"); -require("core-js/fn/regexp/escape"); +/*istanbul ignore next*/require("core-js/fn/regexp/escape"); /* eslint max-len: 0 */ @@ -35640,7 +35582,668 @@ define(String.prototype, "padRight", "".padEnd); [][key] && define(Array, key, Function.call.bind([][key])); }); }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"core-js/fn/regexp/escape":85,"core-js/shim":379,"regenerator-runtime/runtime":460}],50:[function(require,module,exports){ +},{"babel-regenerator-runtime":50,"core-js/fn/regexp/escape":86,"core-js/shim":380}],50:[function(require,module,exports){ +(function (process,global){ +/** + * Copyright (c) 2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * https://raw.github.com/facebook/regenerator/master/LICENSE file. An + * additional grant of patent rights can be found in the PATENTS file in + * the same directory. + */ + +!(function(global) { + "use strict"; + + var hasOwn = Object.prototype.hasOwnProperty; + var undefined; // More compressible than void 0. + var iteratorSymbol = + typeof Symbol === "function" && Symbol.iterator || "@@iterator"; + + var inModule = typeof module === "object"; + var runtime = global.regeneratorRuntime; + if (runtime) { + if (inModule) { + // If regeneratorRuntime is defined globally and we're in a module, + // make the exports object identical to regeneratorRuntime. + module.exports = runtime; + } + // Don't bother evaluating the rest of this file if the runtime was + // already defined globally. + return; + } + + // Define the runtime globally (as expected by generated code) as either + // module.exports (if we're in a module) or a new, empty object. + runtime = global.regeneratorRuntime = inModule ? module.exports : {}; + + function wrap(innerFn, outerFn, self, tryLocsList) { + // If outerFn provided, then outerFn.prototype instanceof Generator. + var generator = Object.create((outerFn || Generator).prototype); + var context = new Context(tryLocsList || []); + + // The ._invoke method unifies the implementations of the .next, + // .throw, and .return methods. + generator._invoke = makeInvokeMethod(innerFn, self, context); + + return generator; + } + runtime.wrap = wrap; + + // Try/catch helper to minimize deoptimizations. Returns a completion + // record like context.tryEntries[i].completion. This interface could + // have been (and was previously) designed to take a closure to be + // invoked without arguments, but in all the cases we care about we + // already have an existing method we want to call, so there's no need + // to create a new function object. We can even get away with assuming + // the method takes exactly one argument, since that happens to be true + // in every case, so we don't have to touch the arguments object. The + // only additional allocation required is the completion record, which + // has a stable shape and so hopefully should be cheap to allocate. + function tryCatch(fn, obj, arg) { + try { + return { type: "normal", arg: fn.call(obj, arg) }; + } catch (err) { + return { type: "throw", arg: err }; + } + } + + var GenStateSuspendedStart = "suspendedStart"; + var GenStateSuspendedYield = "suspendedYield"; + var GenStateExecuting = "executing"; + var GenStateCompleted = "completed"; + + // Returning this object from the innerFn has the same effect as + // breaking out of the dispatch switch statement. + var ContinueSentinel = {}; + + // Dummy constructor functions that we use as the .constructor and + // .constructor.prototype properties for functions that return Generator + // objects. For full spec compliance, you may wish to configure your + // minifier not to mangle the names of these two functions. + function Generator() {} + function GeneratorFunction() {} + function GeneratorFunctionPrototype() {} + + var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype; + GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; + GeneratorFunctionPrototype.constructor = GeneratorFunction; + GeneratorFunction.displayName = "GeneratorFunction"; + + // Helper for defining the .next, .throw, and .return methods of the + // Iterator interface in terms of a single ._invoke method. + function defineIteratorMethods(prototype) { + ["next", "throw", "return"].forEach(function(method) { + prototype[method] = function(arg) { + return this._invoke(method, arg); + }; + }); + } + + runtime.isGeneratorFunction = function(genFun) { + var ctor = typeof genFun === "function" && genFun.constructor; + return ctor + ? ctor === GeneratorFunction || + // For the native GeneratorFunction constructor, the best we can + // do is to check its .name property. + (ctor.displayName || ctor.name) === "GeneratorFunction" + : false; + }; + + runtime.mark = function(genFun) { + if (Object.setPrototypeOf) { + Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); + } else { + genFun.__proto__ = GeneratorFunctionPrototype; + } + genFun.prototype = Object.create(Gp); + return genFun; + }; + + // Within the body of any async function, `await x` is transformed to + // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test + // `value instanceof AwaitArgument` to determine if the yielded value is + // meant to be awaited. Some may consider the name of this method too + // cutesy, but they are curmudgeons. + runtime.awrap = function(arg) { + return new AwaitArgument(arg); + }; + + function AwaitArgument(arg) { + this.arg = arg; + } + + function AsyncIterator(generator) { + // This invoke function is written in a style that assumes some + // calling function (or Promise) will handle exceptions. + function invoke(method, arg) { + var result = generator[method](arg); + var value = result.value; + return value instanceof AwaitArgument + ? Promise.resolve(value.arg).then(invokeNext, invokeThrow) + : Promise.resolve(value).then(function(unwrapped) { + // When a yielded Promise is resolved, its final value becomes + // the .value of the Promise<{value,done}> result for the + // current iteration. If the Promise is rejected, however, the + // result for this iteration will be rejected with the same + // reason. Note that rejections of yielded Promises are not + // thrown back into the generator function, as is the case + // when an awaited Promise is rejected. This difference in + // behavior between yield and await is important, because it + // allows the consumer to decide what to do with the yielded + // rejection (swallow it and continue, manually .throw it back + // into the generator, abandon iteration, whatever). With + // await, by contrast, there is no opportunity to examine the + // rejection reason outside the generator function, so the + // only option is to throw it from the await expression, and + // let the generator function handle the exception. + result.value = unwrapped; + return result; + }); + } + + if (typeof process === "object" && process.domain) { + invoke = process.domain.bind(invoke); + } + + var invokeNext = invoke.bind(generator, "next"); + var invokeThrow = invoke.bind(generator, "throw"); + var invokeReturn = invoke.bind(generator, "return"); + var previousPromise; + + function enqueue(method, arg) { + function callInvokeWithMethodAndArg() { + return invoke(method, arg); + } + + return previousPromise = + // If enqueue has been called before, then we want to wait until + // all previous Promises have been resolved before calling invoke, + // so that results are always delivered in the correct order. If + // enqueue has not been called before, then it is important to + // call invoke immediately, without waiting on a callback to fire, + // so that the async generator function has the opportunity to do + // any necessary setup in a predictable way. This predictability + // is why the Promise constructor synchronously invokes its + // executor callback, and why async functions synchronously + // execute code before the first await. Since we implement simple + // async functions in terms of async generators, it is especially + // important to get this right, even though it requires care. + previousPromise ? previousPromise.then( + callInvokeWithMethodAndArg, + // Avoid propagating failures to Promises returned by later + // invocations of the iterator. + callInvokeWithMethodAndArg + ) : new Promise(function (resolve) { + resolve(callInvokeWithMethodAndArg()); + }); + } + + // Define the unified helper method that is used to implement .next, + // .throw, and .return (see defineIteratorMethods). + this._invoke = enqueue; + } + + defineIteratorMethods(AsyncIterator.prototype); + + // Note that simple async functions are implemented on top of + // AsyncIterator objects; they just return a Promise for the value of + // the final result produced by the iterator. + runtime.async = function(innerFn, outerFn, self, tryLocsList) { + var iter = new AsyncIterator( + wrap(innerFn, outerFn, self, tryLocsList) + ); + + return runtime.isGeneratorFunction(outerFn) + ? iter // If outerFn is a generator, return the full iterator. + : iter.next().then(function(result) { + return result.done ? result.value : iter.next(); + }); + }; + + function makeInvokeMethod(innerFn, self, context) { + var state = GenStateSuspendedStart; + + return function invoke(method, arg) { + if (state === GenStateExecuting) { + throw new Error("Generator is already running"); + } + + if (state === GenStateCompleted) { + if (method === "throw") { + throw arg; + } + + // Be forgiving, per 25.3.3.3.3 of the spec: + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume + return doneResult(); + } + + while (true) { + var delegate = context.delegate; + if (delegate) { + if (method === "return" || + (method === "throw" && delegate.iterator[method] === undefined)) { + // A return or throw (when the delegate iterator has no throw + // method) always terminates the yield* loop. + context.delegate = null; + + // If the delegate iterator has a return method, give it a + // chance to clean up. + var returnMethod = delegate.iterator["return"]; + if (returnMethod) { + var record = tryCatch(returnMethod, delegate.iterator, arg); + if (record.type === "throw") { + // If the return method threw an exception, let that + // exception prevail over the original return or throw. + method = "throw"; + arg = record.arg; + continue; + } + } + + if (method === "return") { + // Continue with the outer return, now that the delegate + // iterator has been terminated. + continue; + } + } + + var record = tryCatch( + delegate.iterator[method], + delegate.iterator, + arg + ); + + if (record.type === "throw") { + context.delegate = null; + + // Like returning generator.throw(uncaught), but without the + // overhead of an extra function call. + method = "throw"; + arg = record.arg; + continue; + } + + // Delegate generator ran and handled its own exceptions so + // regardless of what the method was, we continue as if it is + // "next" with an undefined arg. + method = "next"; + arg = undefined; + + var info = record.arg; + if (info.done) { + context[delegate.resultName] = info.value; + context.next = delegate.nextLoc; + } else { + state = GenStateSuspendedYield; + return info; + } + + context.delegate = null; + } + + if (method === "next") { + context._sent = arg; + + if (state === GenStateSuspendedYield) { + context.sent = arg; + } else { + context.sent = undefined; + } + } else if (method === "throw") { + if (state === GenStateSuspendedStart) { + state = GenStateCompleted; + throw arg; + } + + if (context.dispatchException(arg)) { + // If the dispatched exception was caught by a catch block, + // then let that catch block handle the exception normally. + method = "next"; + arg = undefined; + } + + } else if (method === "return") { + context.abrupt("return", arg); + } + + state = GenStateExecuting; + + var record = tryCatch(innerFn, self, context); + if (record.type === "normal") { + // If an exception is thrown from innerFn, we leave state === + // GenStateExecuting and loop back for another invocation. + state = context.done + ? GenStateCompleted + : GenStateSuspendedYield; + + var info = { + value: record.arg, + done: context.done + }; + + if (record.arg === ContinueSentinel) { + if (context.delegate && method === "next") { + // Deliberately forget the last sent value so that we don't + // accidentally pass it on to the delegate. + arg = undefined; + } + } else { + return info; + } + + } else if (record.type === "throw") { + state = GenStateCompleted; + // Dispatch the exception by looping back around to the + // context.dispatchException(arg) call above. + method = "throw"; + arg = record.arg; + } + } + }; + } + + // Define Generator.prototype.{next,throw,return} in terms of the + // unified ._invoke helper method. + defineIteratorMethods(Gp); + + Gp[iteratorSymbol] = function() { + return this; + }; + + Gp.toString = function() { + return "[object Generator]"; + }; + + function pushTryEntry(locs) { + var entry = { tryLoc: locs[0] }; + + if (1 in locs) { + entry.catchLoc = locs[1]; + } + + if (2 in locs) { + entry.finallyLoc = locs[2]; + entry.afterLoc = locs[3]; + } + + this.tryEntries.push(entry); + } + + function resetTryEntry(entry) { + var record = entry.completion || {}; + record.type = "normal"; + delete record.arg; + entry.completion = record; + } + + function Context(tryLocsList) { + // The root entry object (effectively a try statement without a catch + // or a finally block) gives us a place to store values thrown from + // locations where there is no enclosing try statement. + this.tryEntries = [{ tryLoc: "root" }]; + tryLocsList.forEach(pushTryEntry, this); + this.reset(true); + } + + runtime.keys = function(object) { + var keys = []; + for (var key in object) { + keys.push(key); + } + keys.reverse(); + + // Rather than returning an object with a next method, we keep + // things simple and return the next function itself. + return function next() { + while (keys.length) { + var key = keys.pop(); + if (key in object) { + next.value = key; + next.done = false; + return next; + } + } + + // To avoid creating an additional object, we just hang the .value + // and .done properties off the next function object itself. This + // also ensures that the minifier will not anonymize the function. + next.done = true; + return next; + }; + }; + + function values(iterable) { + if (iterable) { + var iteratorMethod = iterable[iteratorSymbol]; + if (iteratorMethod) { + return iteratorMethod.call(iterable); + } + + if (typeof iterable.next === "function") { + return iterable; + } + + if (!isNaN(iterable.length)) { + var i = -1, next = function next() { + while (++i < iterable.length) { + if (hasOwn.call(iterable, i)) { + next.value = iterable[i]; + next.done = false; + return next; + } + } + + next.value = undefined; + next.done = true; + + return next; + }; + + return next.next = next; + } + } + + // Return an iterator with no values. + return { next: doneResult }; + } + runtime.values = values; + + function doneResult() { + return { value: undefined, done: true }; + } + + Context.prototype = { + constructor: Context, + + reset: function(skipTempReset) { + this.prev = 0; + this.next = 0; + this.sent = undefined; + this.done = false; + this.delegate = null; + + this.tryEntries.forEach(resetTryEntry); + + if (!skipTempReset) { + for (var name in this) { + // Not sure about the optimal order of these conditions: + if (name.charAt(0) === "t" && + hasOwn.call(this, name) && + !isNaN(+name.slice(1))) { + this[name] = undefined; + } + } + } + }, + + stop: function() { + this.done = true; + + var rootEntry = this.tryEntries[0]; + var rootRecord = rootEntry.completion; + if (rootRecord.type === "throw") { + throw rootRecord.arg; + } + + return this.rval; + }, + + dispatchException: function(exception) { + if (this.done) { + throw exception; + } + + var context = this; + function handle(loc, caught) { + record.type = "throw"; + record.arg = exception; + context.next = loc; + return !!caught; + } + + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + var record = entry.completion; + + if (entry.tryLoc === "root") { + // Exception thrown outside of any try block that could handle + // it, so set the completion value of the entire function to + // throw the exception. + return handle("end"); + } + + if (entry.tryLoc <= this.prev) { + var hasCatch = hasOwn.call(entry, "catchLoc"); + var hasFinally = hasOwn.call(entry, "finallyLoc"); + + if (hasCatch && hasFinally) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } else if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + + } else if (hasCatch) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } + + } else if (hasFinally) { + if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + + } else { + throw new Error("try statement without catch or finally"); + } + } + } + }, + + abrupt: function(type, arg) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc <= this.prev && + hasOwn.call(entry, "finallyLoc") && + this.prev < entry.finallyLoc) { + var finallyEntry = entry; + break; + } + } + + if (finallyEntry && + (type === "break" || + type === "continue") && + finallyEntry.tryLoc <= arg && + arg <= finallyEntry.finallyLoc) { + // Ignore the finally entry if control is not jumping to a + // location outside the try/catch block. + finallyEntry = null; + } + + var record = finallyEntry ? finallyEntry.completion : {}; + record.type = type; + record.arg = arg; + + if (finallyEntry) { + this.next = finallyEntry.finallyLoc; + } else { + this.complete(record); + } + + return ContinueSentinel; + }, + + complete: function(record, afterLoc) { + if (record.type === "throw") { + throw record.arg; + } + + if (record.type === "break" || + record.type === "continue") { + this.next = record.arg; + } else if (record.type === "return") { + this.rval = record.arg; + this.next = "end"; + } else if (record.type === "normal" && afterLoc) { + this.next = afterLoc; + } + }, + + finish: function(finallyLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.finallyLoc === finallyLoc) { + this.complete(entry.completion, entry.afterLoc); + resetTryEntry(entry); + return ContinueSentinel; + } + } + }, + + "catch": function(tryLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc === tryLoc) { + var record = entry.completion; + if (record.type === "throw") { + var thrown = record.arg; + resetTryEntry(entry); + } + return thrown; + } + } + + // The context.catch method must only be called with a location + // argument that corresponds to a known catch block. + throw new Error("illegal catch attempt"); + }, + + delegateYield: function(iterable, resultName, nextLoc) { + this.delegate = { + iterator: values(iterable), + resultName: resultName, + nextLoc: nextLoc + }; + + return ContinueSentinel; + } + }; +})( + // Among the various tricks for obtaining a reference to the global + // object, this seems to be the most reliable technique that does not + // use indirect eval (which violates Content Security Policy). + typeof global === "object" ? global : + typeof window === "object" ? window : + typeof self === "object" ? self : this +); + +}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"_process":443}],51:[function(require,module,exports){ 'use strict' exports.toByteArray = toByteArray @@ -35751,7 +36354,7 @@ function fromByteArray (uint8) { return parts.join('') } -},{}],51:[function(require,module,exports){ +},{}],52:[function(require,module,exports){ /*! bignumber.js v2.3.0 https://github.com/MikeMcl/bignumber.js/LICENCE */ ;(function (globalObj) { @@ -38486,7 +39089,7 @@ function fromByteArray (uint8) { } })(this); -},{}],52:[function(require,module,exports){ +},{}],53:[function(require,module,exports){ (function (Buffer){ // Reference https://github.com/bitcoin/bips/blob/master/bip-0066.mediawiki // Format: 0x30 [total-length] 0x02 [R-length] [R] 0x02 [S-length] [S] @@ -38601,7 +39204,7 @@ module.exports = { } }).call(this,require("buffer").Buffer) -},{"buffer":83}],53:[function(require,module,exports){ +},{"buffer":84}],54:[function(require,module,exports){ (function (module, exports) { 'use strict'; @@ -42022,7 +42625,7 @@ module.exports = { }; })(typeof module === 'undefined' || module, this); -},{}],54:[function(require,module,exports){ +},{}],55:[function(require,module,exports){ var r; module.exports = function rand(len) { @@ -42081,9 +42684,9 @@ if (typeof window === 'object') { } } -},{}],55:[function(require,module,exports){ - },{}],56:[function(require,module,exports){ + +},{}],57:[function(require,module,exports){ (function (Buffer){ // based on the aes implimentation in triple sec // https://github.com/keybase/triplesec @@ -42264,7 +42867,7 @@ AES.prototype._doCryptBlock = function (M, keySchedule, SUB_MIX, SBOX) { exports.AES = AES }).call(this,require("buffer").Buffer) -},{"buffer":83}],57:[function(require,module,exports){ +},{"buffer":84}],58:[function(require,module,exports){ (function (Buffer){ var aes = require('./aes') var Transform = require('cipher-base') @@ -42365,7 +42968,7 @@ function xorTest (a, b) { } }).call(this,require("buffer").Buffer) -},{"./aes":56,"./ghash":61,"buffer":83,"buffer-xor":82,"cipher-base":84,"inherits":428}],58:[function(require,module,exports){ +},{"./aes":57,"./ghash":62,"buffer":84,"buffer-xor":83,"cipher-base":85,"inherits":429}],59:[function(require,module,exports){ var ciphers = require('./encrypter') exports.createCipher = exports.Cipher = ciphers.createCipher exports.createCipheriv = exports.Cipheriv = ciphers.createCipheriv @@ -42378,7 +42981,7 @@ function getCiphers () { } exports.listCiphers = exports.getCiphers = getCiphers -},{"./decrypter":59,"./encrypter":60,"./modes":62}],59:[function(require,module,exports){ +},{"./decrypter":60,"./encrypter":61,"./modes":63}],60:[function(require,module,exports){ (function (Buffer){ var aes = require('./aes') var Transform = require('cipher-base') @@ -42519,7 +43122,7 @@ exports.createDecipher = createDecipher exports.createDecipheriv = createDecipheriv }).call(this,require("buffer").Buffer) -},{"./aes":56,"./authCipher":57,"./modes":62,"./modes/cbc":63,"./modes/cfb":64,"./modes/cfb1":65,"./modes/cfb8":66,"./modes/ctr":67,"./modes/ecb":68,"./modes/ofb":69,"./streamCipher":70,"buffer":83,"cipher-base":84,"evp_bytestokey":419,"inherits":428}],60:[function(require,module,exports){ +},{"./aes":57,"./authCipher":58,"./modes":63,"./modes/cbc":64,"./modes/cfb":65,"./modes/cfb1":66,"./modes/cfb8":67,"./modes/ctr":68,"./modes/ecb":69,"./modes/ofb":70,"./streamCipher":71,"buffer":84,"cipher-base":85,"evp_bytestokey":420,"inherits":429}],61:[function(require,module,exports){ (function (Buffer){ var aes = require('./aes') var Transform = require('cipher-base') @@ -42645,7 +43248,7 @@ exports.createCipheriv = createCipheriv exports.createCipher = createCipher }).call(this,require("buffer").Buffer) -},{"./aes":56,"./authCipher":57,"./modes":62,"./modes/cbc":63,"./modes/cfb":64,"./modes/cfb1":65,"./modes/cfb8":66,"./modes/ctr":67,"./modes/ecb":68,"./modes/ofb":69,"./streamCipher":70,"buffer":83,"cipher-base":84,"evp_bytestokey":419,"inherits":428}],61:[function(require,module,exports){ +},{"./aes":57,"./authCipher":58,"./modes":63,"./modes/cbc":64,"./modes/cfb":65,"./modes/cfb1":66,"./modes/cfb8":67,"./modes/ctr":68,"./modes/ecb":69,"./modes/ofb":70,"./streamCipher":71,"buffer":84,"cipher-base":85,"evp_bytestokey":420,"inherits":429}],62:[function(require,module,exports){ (function (Buffer){ var zeros = new Buffer(16) zeros.fill(0) @@ -42747,7 +43350,7 @@ function xor (a, b) { } }).call(this,require("buffer").Buffer) -},{"buffer":83}],62:[function(require,module,exports){ +},{"buffer":84}],63:[function(require,module,exports){ exports['aes-128-ecb'] = { cipher: 'AES', key: 128, @@ -42920,7 +43523,7 @@ exports['aes-256-gcm'] = { type: 'auth' } -},{}],63:[function(require,module,exports){ +},{}],64:[function(require,module,exports){ var xor = require('buffer-xor') exports.encrypt = function (self, block) { @@ -42939,7 +43542,7 @@ exports.decrypt = function (self, block) { return xor(out, pad) } -},{"buffer-xor":82}],64:[function(require,module,exports){ +},{"buffer-xor":83}],65:[function(require,module,exports){ (function (Buffer){ var xor = require('buffer-xor') @@ -42974,7 +43577,7 @@ function encryptStart (self, data, decrypt) { } }).call(this,require("buffer").Buffer) -},{"buffer":83,"buffer-xor":82}],65:[function(require,module,exports){ +},{"buffer":84,"buffer-xor":83}],66:[function(require,module,exports){ (function (Buffer){ function encryptByte (self, byteParam, decrypt) { var pad @@ -43012,7 +43615,7 @@ function shiftIn (buffer, value) { } }).call(this,require("buffer").Buffer) -},{"buffer":83}],66:[function(require,module,exports){ +},{"buffer":84}],67:[function(require,module,exports){ (function (Buffer){ function encryptByte (self, byteParam, decrypt) { var pad = self._cipher.encryptBlock(self._prev) @@ -43031,7 +43634,7 @@ exports.encrypt = function (self, chunk, decrypt) { } }).call(this,require("buffer").Buffer) -},{"buffer":83}],67:[function(require,module,exports){ +},{"buffer":84}],68:[function(require,module,exports){ (function (Buffer){ var xor = require('buffer-xor') @@ -43066,7 +43669,7 @@ exports.encrypt = function (self, chunk) { } }).call(this,require("buffer").Buffer) -},{"buffer":83,"buffer-xor":82}],68:[function(require,module,exports){ +},{"buffer":84,"buffer-xor":83}],69:[function(require,module,exports){ exports.encrypt = function (self, block) { return self._cipher.encryptBlock(block) } @@ -43074,7 +43677,7 @@ exports.decrypt = function (self, block) { return self._cipher.decryptBlock(block) } -},{}],69:[function(require,module,exports){ +},{}],70:[function(require,module,exports){ (function (Buffer){ var xor = require('buffer-xor') @@ -43094,7 +43697,7 @@ exports.encrypt = function (self, chunk) { } }).call(this,require("buffer").Buffer) -},{"buffer":83,"buffer-xor":82}],70:[function(require,module,exports){ +},{"buffer":84,"buffer-xor":83}],71:[function(require,module,exports){ (function (Buffer){ var aes = require('./aes') var Transform = require('cipher-base') @@ -43123,7 +43726,7 @@ StreamCipher.prototype._final = function () { } }).call(this,require("buffer").Buffer) -},{"./aes":56,"buffer":83,"cipher-base":84,"inherits":428}],71:[function(require,module,exports){ +},{"./aes":57,"buffer":84,"cipher-base":85,"inherits":429}],72:[function(require,module,exports){ var ebtk = require('evp_bytestokey') var aes = require('browserify-aes/browser') var DES = require('browserify-des') @@ -43198,7 +43801,7 @@ function getCiphers () { } exports.listCiphers = exports.getCiphers = getCiphers -},{"browserify-aes/browser":58,"browserify-aes/modes":62,"browserify-des":72,"browserify-des/modes":73,"evp_bytestokey":419}],72:[function(require,module,exports){ +},{"browserify-aes/browser":59,"browserify-aes/modes":63,"browserify-des":73,"browserify-des/modes":74,"evp_bytestokey":420}],73:[function(require,module,exports){ (function (Buffer){ var CipherBase = require('cipher-base') var des = require('des.js') @@ -43245,7 +43848,7 @@ DES.prototype._final = function () { } }).call(this,require("buffer").Buffer) -},{"buffer":83,"cipher-base":84,"des.js":387,"inherits":428}],73:[function(require,module,exports){ +},{"buffer":84,"cipher-base":85,"des.js":388,"inherits":429}],74:[function(require,module,exports){ exports['des-ecb'] = { key: 8, iv: 0 @@ -43271,7 +43874,7 @@ exports['des-ede'] = { iv: 0 } -},{}],74:[function(require,module,exports){ +},{}],75:[function(require,module,exports){ (function (Buffer){ var bn = require('bn.js'); var randomBytes = require('randombytes'); @@ -43315,7 +43918,7 @@ function getr(priv) { } }).call(this,require("buffer").Buffer) -},{"bn.js":53,"buffer":83,"randombytes":449}],75:[function(require,module,exports){ +},{"bn.js":54,"buffer":84,"randombytes":450}],76:[function(require,module,exports){ (function (Buffer){ const Sha3 = require('js-sha3') @@ -43353,7 +43956,7 @@ module.exports = { } }).call(this,require("buffer").Buffer) -},{"buffer":83,"js-sha3":431}],76:[function(require,module,exports){ +},{"buffer":84,"js-sha3":432}],77:[function(require,module,exports){ (function (Buffer){ 'use strict' exports['RSA-SHA224'] = exports.sha224WithRSAEncryption = { @@ -43429,7 +44032,7 @@ exports['RSA-MD5'] = exports.md5WithRSAEncryption = { } }).call(this,require("buffer").Buffer) -},{"buffer":83}],77:[function(require,module,exports){ +},{"buffer":84}],78:[function(require,module,exports){ (function (Buffer){ var _algos = require('./algos') var createHash = require('create-hash') @@ -43536,7 +44139,7 @@ module.exports = { } }).call(this,require("buffer").Buffer) -},{"./algos":76,"./sign":79,"./verify":80,"buffer":83,"create-hash":382,"inherits":428,"stream":477}],78:[function(require,module,exports){ +},{"./algos":77,"./sign":80,"./verify":81,"buffer":84,"create-hash":383,"inherits":429,"stream":477}],79:[function(require,module,exports){ 'use strict' exports['1.3.132.0.10'] = 'secp256k1' @@ -43550,7 +44153,7 @@ exports['1.3.132.0.34'] = 'p384' exports['1.3.132.0.35'] = 'p521' -},{}],79:[function(require,module,exports){ +},{}],80:[function(require,module,exports){ (function (Buffer){ // much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js var createHmac = require('create-hmac') @@ -43739,7 +44342,7 @@ module.exports.getKey = getKey module.exports.makeKey = makeKey }).call(this,require("buffer").Buffer) -},{"./curves":78,"bn.js":53,"browserify-rsa":74,"buffer":83,"create-hmac":385,"elliptic":397,"parse-asn1":439}],80:[function(require,module,exports){ +},{"./curves":79,"bn.js":54,"browserify-rsa":75,"buffer":84,"create-hmac":386,"elliptic":398,"parse-asn1":440}],81:[function(require,module,exports){ (function (Buffer){ // much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js var curves = require('./curves') @@ -43846,7 +44449,7 @@ function checkValue (b, q) { module.exports = verify }).call(this,require("buffer").Buffer) -},{"./curves":78,"bn.js":53,"buffer":83,"elliptic":397,"parse-asn1":439}],81:[function(require,module,exports){ +},{"./curves":79,"bn.js":54,"buffer":84,"elliptic":398,"parse-asn1":440}],82:[function(require,module,exports){ (function (global){ 'use strict'; @@ -43958,7 +44561,7 @@ exports.allocUnsafeSlow = function allocUnsafeSlow(size) { } }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"buffer":83}],82:[function(require,module,exports){ +},{"buffer":84}],83:[function(require,module,exports){ (function (Buffer){ module.exports = function xor (a, b) { var length = Math.min(a.length, b.length) @@ -43972,7 +44575,7 @@ module.exports = function xor (a, b) { } }).call(this,require("buffer").Buffer) -},{"buffer":83}],83:[function(require,module,exports){ +},{"buffer":84}],84:[function(require,module,exports){ (function (global){ /*! * The buffer module from node.js, for the browser. @@ -45687,7 +46290,7 @@ function isnan (val) { } }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"base64-js":50,"ieee754":426,"isarray":430}],84:[function(require,module,exports){ +},{"base64-js":51,"ieee754":427,"isarray":431}],85:[function(require,module,exports){ (function (Buffer){ var Transform = require('stream').Transform var inherits = require('inherits') @@ -45781,21 +46384,21 @@ CipherBase.prototype._toString = function (value, enc, final) { } }).call(this,require("buffer").Buffer) -},{"buffer":83,"inherits":428,"stream":477,"string_decoder":478}],85:[function(require,module,exports){ +},{"buffer":84,"inherits":429,"stream":477,"string_decoder":478}],86:[function(require,module,exports){ require('../../modules/core.regexp.escape'); module.exports = require('../../modules/_core').RegExp.escape; -},{"../../modules/_core":106,"../../modules/core.regexp.escape":203}],86:[function(require,module,exports){ +},{"../../modules/_core":107,"../../modules/core.regexp.escape":204}],87:[function(require,module,exports){ module.exports = function(it){ if(typeof it != 'function')throw TypeError(it + ' is not a function!'); return it; }; -},{}],87:[function(require,module,exports){ +},{}],88:[function(require,module,exports){ var cof = require('./_cof'); module.exports = function(it, msg){ if(typeof it != 'number' && cof(it) != 'Number')throw TypeError(msg); return +it; }; -},{"./_cof":101}],88:[function(require,module,exports){ +},{"./_cof":102}],89:[function(require,module,exports){ // 22.1.3.31 Array.prototype[@@unscopables] var UNSCOPABLES = require('./_wks')('unscopables') , ArrayProto = Array.prototype; @@ -45803,19 +46406,19 @@ if(ArrayProto[UNSCOPABLES] == undefined)require('./_hide')(ArrayProto, UNSCOPABL module.exports = function(key){ ArrayProto[UNSCOPABLES][key] = true; }; -},{"./_hide":123,"./_wks":200}],89:[function(require,module,exports){ +},{"./_hide":124,"./_wks":201}],90:[function(require,module,exports){ module.exports = function(it, Constructor, name, forbiddenField){ if(!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)){ throw TypeError(name + ': incorrect invocation!'); } return it; }; -},{}],90:[function(require,module,exports){ +},{}],91:[function(require,module,exports){ var isObject = require('./_is-object'); module.exports = function(it){ if(!isObject(it))throw TypeError(it + ' is not an object!'); return it; }; -},{"./_is-object":132}],91:[function(require,module,exports){ +},{"./_is-object":133}],92:[function(require,module,exports){ // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) 'use strict'; var toObject = require('./_to-object') @@ -45842,7 +46445,7 @@ module.exports = [].copyWithin || function copyWithin(target/*= 0*/, start/*= 0, from += inc; } return O; }; -},{"./_to-index":188,"./_to-length":191,"./_to-object":192}],92:[function(require,module,exports){ +},{"./_to-index":189,"./_to-length":192,"./_to-object":193}],93:[function(require,module,exports){ // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) 'use strict'; var toObject = require('./_to-object') @@ -45858,7 +46461,7 @@ module.exports = function fill(value /*, start = 0, end = @length */){ while(endPos > index)O[index++] = value; return O; }; -},{"./_to-index":188,"./_to-length":191,"./_to-object":192}],93:[function(require,module,exports){ +},{"./_to-index":189,"./_to-length":192,"./_to-object":193}],94:[function(require,module,exports){ var forOf = require('./_for-of'); module.exports = function(iter, ITERATOR){ @@ -45867,7 +46470,7 @@ module.exports = function(iter, ITERATOR){ return result; }; -},{"./_for-of":120}],94:[function(require,module,exports){ +},{"./_for-of":121}],95:[function(require,module,exports){ // false -> Array#indexOf // true -> Array#includes var toIObject = require('./_to-iobject') @@ -45889,7 +46492,7 @@ module.exports = function(IS_INCLUDES){ } return !IS_INCLUDES && -1; }; }; -},{"./_to-index":188,"./_to-iobject":190,"./_to-length":191}],95:[function(require,module,exports){ +},{"./_to-index":189,"./_to-iobject":191,"./_to-length":192}],96:[function(require,module,exports){ // 0 -> Array#forEach // 1 -> Array#map // 2 -> Array#filter @@ -45934,7 +46537,7 @@ module.exports = function(TYPE, $create){ return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; }; }; -},{"./_array-species-create":98,"./_ctx":108,"./_iobject":128,"./_to-length":191,"./_to-object":192}],96:[function(require,module,exports){ +},{"./_array-species-create":99,"./_ctx":109,"./_iobject":129,"./_to-length":192,"./_to-object":193}],97:[function(require,module,exports){ var aFunction = require('./_a-function') , toObject = require('./_to-object') , IObject = require('./_iobject') @@ -45963,7 +46566,7 @@ module.exports = function(that, callbackfn, aLen, memo, isRight){ } return memo; }; -},{"./_a-function":86,"./_iobject":128,"./_to-length":191,"./_to-object":192}],97:[function(require,module,exports){ +},{"./_a-function":87,"./_iobject":129,"./_to-length":192,"./_to-object":193}],98:[function(require,module,exports){ var isObject = require('./_is-object') , isArray = require('./_is-array') , SPECIES = require('./_wks')('species'); @@ -45980,14 +46583,14 @@ module.exports = function(original){ } } return C === undefined ? Array : C; }; -},{"./_is-array":130,"./_is-object":132,"./_wks":200}],98:[function(require,module,exports){ +},{"./_is-array":131,"./_is-object":133,"./_wks":201}],99:[function(require,module,exports){ // 9.4.2.3 ArraySpeciesCreate(originalArray, length) var speciesConstructor = require('./_array-species-constructor'); module.exports = function(original, length){ return new (speciesConstructor(original))(length); }; -},{"./_array-species-constructor":97}],99:[function(require,module,exports){ +},{"./_array-species-constructor":98}],100:[function(require,module,exports){ 'use strict'; var aFunction = require('./_a-function') , isObject = require('./_is-object') @@ -46012,7 +46615,7 @@ module.exports = Function.bind || function bind(that /*, args... */){ if(isObject(fn.prototype))bound.prototype = fn.prototype; return bound; }; -},{"./_a-function":86,"./_invoke":127,"./_is-object":132}],100:[function(require,module,exports){ +},{"./_a-function":87,"./_invoke":128,"./_is-object":133}],101:[function(require,module,exports){ // getting tag from 19.1.3.6 Object.prototype.toString() var cof = require('./_cof') , TAG = require('./_wks')('toStringTag') @@ -46036,13 +46639,13 @@ module.exports = function(it){ // ES3 arguments fallback : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; }; -},{"./_cof":101,"./_wks":200}],101:[function(require,module,exports){ +},{"./_cof":102,"./_wks":201}],102:[function(require,module,exports){ var toString = {}.toString; module.exports = function(it){ return toString.call(it).slice(8, -1); }; -},{}],102:[function(require,module,exports){ +},{}],103:[function(require,module,exports){ 'use strict'; var dP = require('./_object-dp').f , create = require('./_object-create') @@ -46186,7 +46789,7 @@ module.exports = { setSpecies(NAME); } }; -},{"./_an-instance":89,"./_ctx":108,"./_defined":110,"./_descriptors":111,"./_for-of":120,"./_hide":123,"./_iter-define":136,"./_iter-step":138,"./_meta":145,"./_object-create":149,"./_object-dp":150,"./_redefine-all":169,"./_set-species":174}],103:[function(require,module,exports){ +},{"./_an-instance":90,"./_ctx":109,"./_defined":111,"./_descriptors":112,"./_for-of":121,"./_hide":124,"./_iter-define":137,"./_iter-step":139,"./_meta":146,"./_object-create":150,"./_object-dp":151,"./_redefine-all":170,"./_set-species":175}],104:[function(require,module,exports){ // https://github.com/DavidBruant/Map-Set.prototype.toJSON var classof = require('./_classof') , from = require('./_array-from-iterable'); @@ -46196,7 +46799,7 @@ module.exports = function(NAME){ return from(this); }; }; -},{"./_array-from-iterable":93,"./_classof":100}],104:[function(require,module,exports){ +},{"./_array-from-iterable":94,"./_classof":101}],105:[function(require,module,exports){ 'use strict'; var redefineAll = require('./_redefine-all') , getWeak = require('./_meta').getWeak @@ -46280,7 +46883,7 @@ module.exports = { }, ufstore: uncaughtFrozenStore }; -},{"./_an-instance":89,"./_an-object":90,"./_array-methods":95,"./_for-of":120,"./_has":122,"./_is-object":132,"./_meta":145,"./_redefine-all":169}],105:[function(require,module,exports){ +},{"./_an-instance":90,"./_an-object":91,"./_array-methods":96,"./_for-of":121,"./_has":123,"./_is-object":133,"./_meta":146,"./_redefine-all":170}],106:[function(require,module,exports){ 'use strict'; var global = require('./_global') , $export = require('./_export') @@ -46366,10 +46969,10 @@ module.exports = function(NAME, wrapper, methods, common, IS_MAP, IS_WEAK){ return C; }; -},{"./_an-instance":89,"./_export":115,"./_fails":117,"./_for-of":120,"./_global":121,"./_inherit-if-required":126,"./_is-object":132,"./_iter-detect":137,"./_meta":145,"./_redefine":170,"./_redefine-all":169,"./_set-to-string-tag":175}],106:[function(require,module,exports){ +},{"./_an-instance":90,"./_export":116,"./_fails":118,"./_for-of":121,"./_global":122,"./_inherit-if-required":127,"./_is-object":133,"./_iter-detect":138,"./_meta":146,"./_redefine":171,"./_redefine-all":170,"./_set-to-string-tag":176}],107:[function(require,module,exports){ var core = module.exports = {version: '2.4.0'}; if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef -},{}],107:[function(require,module,exports){ +},{}],108:[function(require,module,exports){ 'use strict'; var $defineProperty = require('./_object-dp') , createDesc = require('./_property-desc'); @@ -46378,7 +46981,7 @@ module.exports = function(object, index, value){ if(index in object)$defineProperty.f(object, index, createDesc(0, value)); else object[index] = value; }; -},{"./_object-dp":150,"./_property-desc":168}],108:[function(require,module,exports){ +},{"./_object-dp":151,"./_property-desc":169}],109:[function(require,module,exports){ // optional / simple context binding var aFunction = require('./_a-function'); module.exports = function(fn, that, length){ @@ -46399,7 +47002,7 @@ module.exports = function(fn, that, length){ return fn.apply(that, arguments); }; }; -},{"./_a-function":86}],109:[function(require,module,exports){ +},{"./_a-function":87}],110:[function(require,module,exports){ 'use strict'; var anObject = require('./_an-object') , toPrimitive = require('./_to-primitive') @@ -46409,18 +47012,18 @@ module.exports = function(hint){ if(hint !== 'string' && hint !== NUMBER && hint !== 'default')throw TypeError('Incorrect hint'); return toPrimitive(anObject(this), hint != NUMBER); }; -},{"./_an-object":90,"./_to-primitive":193}],110:[function(require,module,exports){ +},{"./_an-object":91,"./_to-primitive":194}],111:[function(require,module,exports){ // 7.2.1 RequireObjectCoercible(argument) module.exports = function(it){ if(it == undefined)throw TypeError("Can't call method on " + it); return it; }; -},{}],111:[function(require,module,exports){ +},{}],112:[function(require,module,exports){ // Thank's IE8 for his funny defineProperty module.exports = !require('./_fails')(function(){ return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7; }); -},{"./_fails":117}],112:[function(require,module,exports){ +},{"./_fails":118}],113:[function(require,module,exports){ var isObject = require('./_is-object') , document = require('./_global').document // in old IE typeof document.createElement is 'object' @@ -46428,12 +47031,12 @@ var isObject = require('./_is-object') module.exports = function(it){ return is ? document.createElement(it) : {}; }; -},{"./_global":121,"./_is-object":132}],113:[function(require,module,exports){ +},{"./_global":122,"./_is-object":133}],114:[function(require,module,exports){ // IE 8- don't enum bug keys module.exports = ( 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' ).split(','); -},{}],114:[function(require,module,exports){ +},{}],115:[function(require,module,exports){ // all enumerable object keys, includes symbols var getKeys = require('./_object-keys') , gOPS = require('./_object-gops') @@ -46449,7 +47052,7 @@ module.exports = function(it){ while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))result.push(key); } return result; }; -},{"./_object-gops":156,"./_object-keys":159,"./_object-pie":160}],115:[function(require,module,exports){ +},{"./_object-gops":157,"./_object-keys":160,"./_object-pie":161}],116:[function(require,module,exports){ var global = require('./_global') , core = require('./_core') , hide = require('./_hide') @@ -46493,7 +47096,7 @@ $export.W = 32; // wrap $export.U = 64; // safe $export.R = 128; // real proto method for `library` module.exports = $export; -},{"./_core":106,"./_ctx":108,"./_global":121,"./_hide":123,"./_redefine":170}],116:[function(require,module,exports){ +},{"./_core":107,"./_ctx":109,"./_global":122,"./_hide":124,"./_redefine":171}],117:[function(require,module,exports){ var MATCH = require('./_wks')('match'); module.exports = function(KEY){ var re = /./; @@ -46506,7 +47109,7 @@ module.exports = function(KEY){ } catch(f){ /* empty */ } } return true; }; -},{"./_wks":200}],117:[function(require,module,exports){ +},{"./_wks":201}],118:[function(require,module,exports){ module.exports = function(exec){ try { return !!exec(); @@ -46514,7 +47117,7 @@ module.exports = function(exec){ return true; } }; -},{}],118:[function(require,module,exports){ +},{}],119:[function(require,module,exports){ 'use strict'; var hide = require('./_hide') , redefine = require('./_redefine') @@ -46543,7 +47146,7 @@ module.exports = function(KEY, length, exec){ ); } }; -},{"./_defined":110,"./_fails":117,"./_hide":123,"./_redefine":170,"./_wks":200}],119:[function(require,module,exports){ +},{"./_defined":111,"./_fails":118,"./_hide":124,"./_redefine":171,"./_wks":201}],120:[function(require,module,exports){ 'use strict'; // 21.2.5.3 get RegExp.prototype.flags var anObject = require('./_an-object'); @@ -46557,7 +47160,7 @@ module.exports = function(){ if(that.sticky) result += 'y'; return result; }; -},{"./_an-object":90}],120:[function(require,module,exports){ +},{"./_an-object":91}],121:[function(require,module,exports){ var ctx = require('./_ctx') , call = require('./_iter-call') , isArrayIter = require('./_is-array-iter') @@ -46583,17 +47186,17 @@ var exports = module.exports = function(iterable, entries, fn, that, ITERATOR){ }; exports.BREAK = BREAK; exports.RETURN = RETURN; -},{"./_an-object":90,"./_ctx":108,"./_is-array-iter":129,"./_iter-call":134,"./_to-length":191,"./core.get-iterator-method":201}],121:[function(require,module,exports){ +},{"./_an-object":91,"./_ctx":109,"./_is-array-iter":130,"./_iter-call":135,"./_to-length":192,"./core.get-iterator-method":202}],122:[function(require,module,exports){ // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 var global = module.exports = typeof window != 'undefined' && window.Math == Math ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')(); if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef -},{}],122:[function(require,module,exports){ +},{}],123:[function(require,module,exports){ var hasOwnProperty = {}.hasOwnProperty; module.exports = function(it, key){ return hasOwnProperty.call(it, key); }; -},{}],123:[function(require,module,exports){ +},{}],124:[function(require,module,exports){ var dP = require('./_object-dp') , createDesc = require('./_property-desc'); module.exports = require('./_descriptors') ? function(object, key, value){ @@ -46602,13 +47205,13 @@ module.exports = require('./_descriptors') ? function(object, key, value){ object[key] = value; return object; }; -},{"./_descriptors":111,"./_object-dp":150,"./_property-desc":168}],124:[function(require,module,exports){ +},{"./_descriptors":112,"./_object-dp":151,"./_property-desc":169}],125:[function(require,module,exports){ module.exports = require('./_global').document && document.documentElement; -},{"./_global":121}],125:[function(require,module,exports){ +},{"./_global":122}],126:[function(require,module,exports){ module.exports = !require('./_descriptors') && !require('./_fails')(function(){ return Object.defineProperty(require('./_dom-create')('div'), 'a', {get: function(){ return 7; }}).a != 7; }); -},{"./_descriptors":111,"./_dom-create":112,"./_fails":117}],126:[function(require,module,exports){ +},{"./_descriptors":112,"./_dom-create":113,"./_fails":118}],127:[function(require,module,exports){ var isObject = require('./_is-object') , setPrototypeOf = require('./_set-proto').set; module.exports = function(that, target, C){ @@ -46617,7 +47220,7 @@ module.exports = function(that, target, C){ setPrototypeOf(that, P); } return that; }; -},{"./_is-object":132,"./_set-proto":173}],127:[function(require,module,exports){ +},{"./_is-object":133,"./_set-proto":174}],128:[function(require,module,exports){ // fast apply, http://jsperf.lnkit.com/fast-apply/5 module.exports = function(fn, args, that){ var un = that === undefined; @@ -46634,13 +47237,13 @@ module.exports = function(fn, args, that){ : fn.call(that, args[0], args[1], args[2], args[3]); } return fn.apply(that, args); }; -},{}],128:[function(require,module,exports){ +},{}],129:[function(require,module,exports){ // fallback for non-array-like ES3 and non-enumerable old V8 strings var cof = require('./_cof'); module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){ return cof(it) == 'String' ? it.split('') : Object(it); }; -},{"./_cof":101}],129:[function(require,module,exports){ +},{"./_cof":102}],130:[function(require,module,exports){ // check on default Array iterator var Iterators = require('./_iterators') , ITERATOR = require('./_wks')('iterator') @@ -46649,24 +47252,24 @@ var Iterators = require('./_iterators') module.exports = function(it){ return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); }; -},{"./_iterators":139,"./_wks":200}],130:[function(require,module,exports){ +},{"./_iterators":140,"./_wks":201}],131:[function(require,module,exports){ // 7.2.2 IsArray(argument) var cof = require('./_cof'); module.exports = Array.isArray || function isArray(arg){ return cof(arg) == 'Array'; }; -},{"./_cof":101}],131:[function(require,module,exports){ +},{"./_cof":102}],132:[function(require,module,exports){ // 20.1.2.3 Number.isInteger(number) var isObject = require('./_is-object') , floor = Math.floor; module.exports = function isInteger(it){ return !isObject(it) && isFinite(it) && floor(it) === it; }; -},{"./_is-object":132}],132:[function(require,module,exports){ +},{"./_is-object":133}],133:[function(require,module,exports){ module.exports = function(it){ return typeof it === 'object' ? it !== null : typeof it === 'function'; }; -},{}],133:[function(require,module,exports){ +},{}],134:[function(require,module,exports){ // 7.2.8 IsRegExp(argument) var isObject = require('./_is-object') , cof = require('./_cof') @@ -46675,7 +47278,7 @@ module.exports = function(it){ var isRegExp; return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp'); }; -},{"./_cof":101,"./_is-object":132,"./_wks":200}],134:[function(require,module,exports){ +},{"./_cof":102,"./_is-object":133,"./_wks":201}],135:[function(require,module,exports){ // call something on iterator step with safe closing on error var anObject = require('./_an-object'); module.exports = function(iterator, fn, value, entries){ @@ -46688,7 +47291,7 @@ module.exports = function(iterator, fn, value, entries){ throw e; } }; -},{"./_an-object":90}],135:[function(require,module,exports){ +},{"./_an-object":91}],136:[function(require,module,exports){ 'use strict'; var create = require('./_object-create') , descriptor = require('./_property-desc') @@ -46702,7 +47305,7 @@ module.exports = function(Constructor, NAME, next){ Constructor.prototype = create(IteratorPrototype, {next: descriptor(1, next)}); setToStringTag(Constructor, NAME + ' Iterator'); }; -},{"./_hide":123,"./_object-create":149,"./_property-desc":168,"./_set-to-string-tag":175,"./_wks":200}],136:[function(require,module,exports){ +},{"./_hide":124,"./_object-create":150,"./_property-desc":169,"./_set-to-string-tag":176,"./_wks":201}],137:[function(require,module,exports){ 'use strict'; var LIBRARY = require('./_library') , $export = require('./_export') @@ -46773,7 +47376,7 @@ module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED } return methods; }; -},{"./_export":115,"./_has":122,"./_hide":123,"./_iter-create":135,"./_iterators":139,"./_library":141,"./_object-gpo":157,"./_redefine":170,"./_set-to-string-tag":175,"./_wks":200}],137:[function(require,module,exports){ +},{"./_export":116,"./_has":123,"./_hide":124,"./_iter-create":136,"./_iterators":140,"./_library":142,"./_object-gpo":158,"./_redefine":171,"./_set-to-string-tag":176,"./_wks":201}],138:[function(require,module,exports){ var ITERATOR = require('./_wks')('iterator') , SAFE_CLOSING = false; @@ -46795,13 +47398,13 @@ module.exports = function(exec, skipClosing){ } catch(e){ /* empty */ } return safe; }; -},{"./_wks":200}],138:[function(require,module,exports){ +},{"./_wks":201}],139:[function(require,module,exports){ module.exports = function(done, value){ return {value: value, done: !!done}; }; -},{}],139:[function(require,module,exports){ -module.exports = {}; },{}],140:[function(require,module,exports){ +module.exports = {}; +},{}],141:[function(require,module,exports){ var getKeys = require('./_object-keys') , toIObject = require('./_to-iobject'); module.exports = function(object, el){ @@ -46812,9 +47415,9 @@ module.exports = function(object, el){ , key; while(length > index)if(O[key = keys[index++]] === el)return key; }; -},{"./_object-keys":159,"./_to-iobject":190}],141:[function(require,module,exports){ +},{"./_object-keys":160,"./_to-iobject":191}],142:[function(require,module,exports){ module.exports = false; -},{}],142:[function(require,module,exports){ +},{}],143:[function(require,module,exports){ // 20.2.2.14 Math.expm1(x) var $expm1 = Math.expm1; module.exports = (!$expm1 @@ -46825,17 +47428,17 @@ module.exports = (!$expm1 ) ? function expm1(x){ return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1; } : $expm1; -},{}],143:[function(require,module,exports){ +},{}],144:[function(require,module,exports){ // 20.2.2.20 Math.log1p(x) module.exports = Math.log1p || function log1p(x){ return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x); }; -},{}],144:[function(require,module,exports){ +},{}],145:[function(require,module,exports){ // 20.2.2.28 Math.sign(x) module.exports = Math.sign || function sign(x){ return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; }; -},{}],145:[function(require,module,exports){ +},{}],146:[function(require,module,exports){ var META = require('./_uid')('meta') , isObject = require('./_is-object') , has = require('./_has') @@ -46889,7 +47492,7 @@ var meta = module.exports = { getWeak: getWeak, onFreeze: onFreeze }; -},{"./_fails":117,"./_has":122,"./_is-object":132,"./_object-dp":150,"./_uid":197}],146:[function(require,module,exports){ +},{"./_fails":118,"./_has":123,"./_is-object":133,"./_object-dp":151,"./_uid":198}],147:[function(require,module,exports){ var Map = require('./es6.map') , $export = require('./_export') , shared = require('./_shared')('metadata') @@ -46941,7 +47544,7 @@ module.exports = { key: toMetaKey, exp: exp }; -},{"./_export":115,"./_shared":177,"./es6.map":233,"./es6.weak-map":339}],147:[function(require,module,exports){ +},{"./_export":116,"./_shared":178,"./es6.map":234,"./es6.weak-map":340}],148:[function(require,module,exports){ var global = require('./_global') , macrotask = require('./_task').set , Observer = global.MutationObserver || global.WebKitMutationObserver @@ -47010,7 +47613,7 @@ module.exports = function(){ } last = task; }; }; -},{"./_cof":101,"./_global":121,"./_task":187}],148:[function(require,module,exports){ +},{"./_cof":102,"./_global":122,"./_task":188}],149:[function(require,module,exports){ 'use strict'; // 19.1.2.1 Object.assign(target, source, ...) var getKeys = require('./_object-keys') @@ -47044,7 +47647,7 @@ module.exports = !$assign || require('./_fails')(function(){ while(length > j)if(isEnum.call(S, key = keys[j++]))T[key] = S[key]; } return T; } : $assign; -},{"./_fails":117,"./_iobject":128,"./_object-gops":156,"./_object-keys":159,"./_object-pie":160,"./_to-object":192}],149:[function(require,module,exports){ +},{"./_fails":118,"./_iobject":129,"./_object-gops":157,"./_object-keys":160,"./_object-pie":161,"./_to-object":193}],150:[function(require,module,exports){ // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) var anObject = require('./_an-object') , dPs = require('./_object-dps') @@ -47085,7 +47688,7 @@ module.exports = Object.create || function create(O, Properties){ } else result = createDict(); return Properties === undefined ? result : dPs(result, Properties); }; -},{"./_an-object":90,"./_dom-create":112,"./_enum-bug-keys":113,"./_html":124,"./_object-dps":151,"./_shared-key":176}],150:[function(require,module,exports){ +},{"./_an-object":91,"./_dom-create":113,"./_enum-bug-keys":114,"./_html":125,"./_object-dps":152,"./_shared-key":177}],151:[function(require,module,exports){ var anObject = require('./_an-object') , IE8_DOM_DEFINE = require('./_ie8-dom-define') , toPrimitive = require('./_to-primitive') @@ -47102,7 +47705,7 @@ exports.f = require('./_descriptors') ? Object.defineProperty : function defineP if('value' in Attributes)O[P] = Attributes.value; return O; }; -},{"./_an-object":90,"./_descriptors":111,"./_ie8-dom-define":125,"./_to-primitive":193}],151:[function(require,module,exports){ +},{"./_an-object":91,"./_descriptors":112,"./_ie8-dom-define":126,"./_to-primitive":194}],152:[function(require,module,exports){ var dP = require('./_object-dp') , anObject = require('./_an-object') , getKeys = require('./_object-keys'); @@ -47116,7 +47719,7 @@ module.exports = require('./_descriptors') ? Object.defineProperties : function while(length > i)dP.f(O, P = keys[i++], Properties[P]); return O; }; -},{"./_an-object":90,"./_descriptors":111,"./_object-dp":150,"./_object-keys":159}],152:[function(require,module,exports){ +},{"./_an-object":91,"./_descriptors":112,"./_object-dp":151,"./_object-keys":160}],153:[function(require,module,exports){ // Forced replacement prototype accessors methods module.exports = require('./_library')|| !require('./_fails')(function(){ var K = Math.random(); @@ -47124,7 +47727,7 @@ module.exports = require('./_library')|| !require('./_fails')(function(){ __defineSetter__.call(null, K, function(){ /* empty */}); delete require('./_global')[K]; }); -},{"./_fails":117,"./_global":121,"./_library":141}],153:[function(require,module,exports){ +},{"./_fails":118,"./_global":122,"./_library":142}],154:[function(require,module,exports){ var pIE = require('./_object-pie') , createDesc = require('./_property-desc') , toIObject = require('./_to-iobject') @@ -47141,7 +47744,7 @@ exports.f = require('./_descriptors') ? gOPD : function getOwnPropertyDescriptor } catch(e){ /* empty */ } if(has(O, P))return createDesc(!pIE.f.call(O, P), O[P]); }; -},{"./_descriptors":111,"./_has":122,"./_ie8-dom-define":125,"./_object-pie":160,"./_property-desc":168,"./_to-iobject":190,"./_to-primitive":193}],154:[function(require,module,exports){ +},{"./_descriptors":112,"./_has":123,"./_ie8-dom-define":126,"./_object-pie":161,"./_property-desc":169,"./_to-iobject":191,"./_to-primitive":194}],155:[function(require,module,exports){ // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window var toIObject = require('./_to-iobject') , gOPN = require('./_object-gopn').f @@ -47162,7 +47765,7 @@ module.exports.f = function getOwnPropertyNames(it){ return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it)); }; -},{"./_object-gopn":155,"./_to-iobject":190}],155:[function(require,module,exports){ +},{"./_object-gopn":156,"./_to-iobject":191}],156:[function(require,module,exports){ // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) var $keys = require('./_object-keys-internal') , hiddenKeys = require('./_enum-bug-keys').concat('length', 'prototype'); @@ -47170,9 +47773,9 @@ var $keys = require('./_object-keys-internal') exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O){ return $keys(O, hiddenKeys); }; -},{"./_enum-bug-keys":113,"./_object-keys-internal":158}],156:[function(require,module,exports){ +},{"./_enum-bug-keys":114,"./_object-keys-internal":159}],157:[function(require,module,exports){ exports.f = Object.getOwnPropertySymbols; -},{}],157:[function(require,module,exports){ +},{}],158:[function(require,module,exports){ // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) var has = require('./_has') , toObject = require('./_to-object') @@ -47186,7 +47789,7 @@ module.exports = Object.getPrototypeOf || function(O){ return O.constructor.prototype; } return O instanceof Object ? ObjectProto : null; }; -},{"./_has":122,"./_shared-key":176,"./_to-object":192}],158:[function(require,module,exports){ +},{"./_has":123,"./_shared-key":177,"./_to-object":193}],159:[function(require,module,exports){ var has = require('./_has') , toIObject = require('./_to-iobject') , arrayIndexOf = require('./_array-includes')(false) @@ -47204,7 +47807,7 @@ module.exports = function(object, names){ } return result; }; -},{"./_array-includes":94,"./_has":122,"./_shared-key":176,"./_to-iobject":190}],159:[function(require,module,exports){ +},{"./_array-includes":95,"./_has":123,"./_shared-key":177,"./_to-iobject":191}],160:[function(require,module,exports){ // 19.1.2.14 / 15.2.3.14 Object.keys(O) var $keys = require('./_object-keys-internal') , enumBugKeys = require('./_enum-bug-keys'); @@ -47212,9 +47815,9 @@ var $keys = require('./_object-keys-internal') module.exports = Object.keys || function keys(O){ return $keys(O, enumBugKeys); }; -},{"./_enum-bug-keys":113,"./_object-keys-internal":158}],160:[function(require,module,exports){ +},{"./_enum-bug-keys":114,"./_object-keys-internal":159}],161:[function(require,module,exports){ exports.f = {}.propertyIsEnumerable; -},{}],161:[function(require,module,exports){ +},{}],162:[function(require,module,exports){ // most Object methods by ES6 should accept primitives var $export = require('./_export') , core = require('./_core') @@ -47225,7 +47828,7 @@ module.exports = function(KEY, exec){ exp[KEY] = exec(fn); $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp); }; -},{"./_core":106,"./_export":115,"./_fails":117}],162:[function(require,module,exports){ +},{"./_core":107,"./_export":116,"./_fails":118}],163:[function(require,module,exports){ var getKeys = require('./_object-keys') , toIObject = require('./_to-iobject') , isEnum = require('./_object-pie').f; @@ -47242,7 +47845,7 @@ module.exports = function(isEntries){ } return result; }; }; -},{"./_object-keys":159,"./_object-pie":160,"./_to-iobject":190}],163:[function(require,module,exports){ +},{"./_object-keys":160,"./_object-pie":161,"./_to-iobject":191}],164:[function(require,module,exports){ // all object keys, includes non-enumerable and symbols var gOPN = require('./_object-gopn') , gOPS = require('./_object-gops') @@ -47253,7 +47856,7 @@ module.exports = Reflect && Reflect.ownKeys || function ownKeys(it){ , getSymbols = gOPS.f; return getSymbols ? keys.concat(getSymbols(it)) : keys; }; -},{"./_an-object":90,"./_global":121,"./_object-gopn":155,"./_object-gops":156}],164:[function(require,module,exports){ +},{"./_an-object":91,"./_global":122,"./_object-gopn":156,"./_object-gops":157}],165:[function(require,module,exports){ var $parseFloat = require('./_global').parseFloat , $trim = require('./_string-trim').trim; @@ -47262,7 +47865,7 @@ module.exports = 1 / $parseFloat(require('./_string-ws') + '-0') !== -Infinity ? , result = $parseFloat(string); return result === 0 && string.charAt(0) == '-' ? -0 : result; } : $parseFloat; -},{"./_global":121,"./_string-trim":185,"./_string-ws":186}],165:[function(require,module,exports){ +},{"./_global":122,"./_string-trim":186,"./_string-ws":187}],166:[function(require,module,exports){ var $parseInt = require('./_global').parseInt , $trim = require('./_string-trim').trim , ws = require('./_string-ws') @@ -47272,7 +47875,7 @@ module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? f var string = $trim(String(str), 3); return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10)); } : $parseInt; -},{"./_global":121,"./_string-trim":185,"./_string-ws":186}],166:[function(require,module,exports){ +},{"./_global":122,"./_string-trim":186,"./_string-ws":187}],167:[function(require,module,exports){ 'use strict'; var path = require('./_path') , invoke = require('./_invoke') @@ -47296,9 +47899,9 @@ module.exports = function(/* ...pargs */){ return invoke(fn, args, that); }; }; -},{"./_a-function":86,"./_invoke":127,"./_path":167}],167:[function(require,module,exports){ +},{"./_a-function":87,"./_invoke":128,"./_path":168}],168:[function(require,module,exports){ module.exports = require('./_global'); -},{"./_global":121}],168:[function(require,module,exports){ +},{"./_global":122}],169:[function(require,module,exports){ module.exports = function(bitmap, value){ return { enumerable : !(bitmap & 1), @@ -47307,13 +47910,13 @@ module.exports = function(bitmap, value){ value : value }; }; -},{}],169:[function(require,module,exports){ +},{}],170:[function(require,module,exports){ var redefine = require('./_redefine'); module.exports = function(target, src, safe){ for(var key in src)redefine(target, key, src[key], safe); return target; }; -},{"./_redefine":170}],170:[function(require,module,exports){ +},{"./_redefine":171}],171:[function(require,module,exports){ var global = require('./_global') , hide = require('./_hide') , has = require('./_has') @@ -47346,7 +47949,7 @@ require('./_core').inspectSource = function(it){ })(Function.prototype, TO_STRING, function toString(){ return typeof this == 'function' && this[SRC] || $toString.call(this); }); -},{"./_core":106,"./_global":121,"./_has":122,"./_hide":123,"./_uid":197}],171:[function(require,module,exports){ +},{"./_core":107,"./_global":122,"./_has":123,"./_hide":124,"./_uid":198}],172:[function(require,module,exports){ module.exports = function(regExp, replace){ var replacer = replace === Object(replace) ? function(part){ return replace[part]; @@ -47355,12 +47958,12 @@ module.exports = function(regExp, replace){ return String(it).replace(regExp, replacer); }; }; -},{}],172:[function(require,module,exports){ +},{}],173:[function(require,module,exports){ // 7.2.9 SameValue(x, y) module.exports = Object.is || function is(x, y){ return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; }; -},{}],173:[function(require,module,exports){ +},{}],174:[function(require,module,exports){ // Works with __proto__ only. Old v8 can't work with null proto objects. /* eslint-disable no-proto */ var isObject = require('./_is-object') @@ -47386,7 +47989,7 @@ module.exports = { }({}, false) : undefined), check: check }; -},{"./_an-object":90,"./_ctx":108,"./_is-object":132,"./_object-gopd":153}],174:[function(require,module,exports){ +},{"./_an-object":91,"./_ctx":109,"./_is-object":133,"./_object-gopd":154}],175:[function(require,module,exports){ 'use strict'; var global = require('./_global') , dP = require('./_object-dp') @@ -47400,7 +48003,7 @@ module.exports = function(KEY){ get: function(){ return this; } }); }; -},{"./_descriptors":111,"./_global":121,"./_object-dp":150,"./_wks":200}],175:[function(require,module,exports){ +},{"./_descriptors":112,"./_global":122,"./_object-dp":151,"./_wks":201}],176:[function(require,module,exports){ var def = require('./_object-dp').f , has = require('./_has') , TAG = require('./_wks')('toStringTag'); @@ -47408,20 +48011,20 @@ var def = require('./_object-dp').f module.exports = function(it, tag, stat){ if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag}); }; -},{"./_has":122,"./_object-dp":150,"./_wks":200}],176:[function(require,module,exports){ +},{"./_has":123,"./_object-dp":151,"./_wks":201}],177:[function(require,module,exports){ var shared = require('./_shared')('keys') , uid = require('./_uid'); module.exports = function(key){ return shared[key] || (shared[key] = uid(key)); }; -},{"./_shared":177,"./_uid":197}],177:[function(require,module,exports){ +},{"./_shared":178,"./_uid":198}],178:[function(require,module,exports){ var global = require('./_global') , SHARED = '__core-js_shared__' , store = global[SHARED] || (global[SHARED] = {}); module.exports = function(key){ return store[key] || (store[key] = {}); }; -},{"./_global":121}],178:[function(require,module,exports){ +},{"./_global":122}],179:[function(require,module,exports){ // 7.3.20 SpeciesConstructor(O, defaultConstructor) var anObject = require('./_an-object') , aFunction = require('./_a-function') @@ -47430,7 +48033,7 @@ module.exports = function(O, D){ var C = anObject(O).constructor, S; return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); }; -},{"./_a-function":86,"./_an-object":90,"./_wks":200}],179:[function(require,module,exports){ +},{"./_a-function":87,"./_an-object":91,"./_wks":201}],180:[function(require,module,exports){ var fails = require('./_fails'); module.exports = function(method, arg){ @@ -47438,7 +48041,7 @@ module.exports = function(method, arg){ arg ? method.call(null, function(){}, 1) : method.call(null); }); }; -},{"./_fails":117}],180:[function(require,module,exports){ +},{"./_fails":118}],181:[function(require,module,exports){ var toInteger = require('./_to-integer') , defined = require('./_defined'); // true -> String#at @@ -47456,7 +48059,7 @@ module.exports = function(TO_STRING){ : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; }; }; -},{"./_defined":110,"./_to-integer":189}],181:[function(require,module,exports){ +},{"./_defined":111,"./_to-integer":190}],182:[function(require,module,exports){ // helper for String#{startsWith, endsWith, includes} var isRegExp = require('./_is-regexp') , defined = require('./_defined'); @@ -47465,7 +48068,7 @@ module.exports = function(that, searchString, NAME){ if(isRegExp(searchString))throw TypeError('String#' + NAME + " doesn't accept regex!"); return String(defined(that)); }; -},{"./_defined":110,"./_is-regexp":133}],182:[function(require,module,exports){ +},{"./_defined":111,"./_is-regexp":134}],183:[function(require,module,exports){ var $export = require('./_export') , fails = require('./_fails') , defined = require('./_defined') @@ -47485,7 +48088,7 @@ module.exports = function(NAME, exec){ return test !== test.toLowerCase() || test.split('"').length > 3; }), 'String', O); }; -},{"./_defined":110,"./_export":115,"./_fails":117}],183:[function(require,module,exports){ +},{"./_defined":111,"./_export":116,"./_fails":118}],184:[function(require,module,exports){ // https://github.com/tc39/proposal-string-pad-start-end var toLength = require('./_to-length') , repeat = require('./_string-repeat') @@ -47503,7 +48106,7 @@ module.exports = function(that, maxLength, fillString, left){ return left ? stringFiller + S : S + stringFiller; }; -},{"./_defined":110,"./_string-repeat":184,"./_to-length":191}],184:[function(require,module,exports){ +},{"./_defined":111,"./_string-repeat":185,"./_to-length":192}],185:[function(require,module,exports){ 'use strict'; var toInteger = require('./_to-integer') , defined = require('./_defined'); @@ -47516,7 +48119,7 @@ module.exports = function repeat(count){ for(;n > 0; (n >>>= 1) && (str += str))if(n & 1)res += str; return res; }; -},{"./_defined":110,"./_to-integer":189}],185:[function(require,module,exports){ +},{"./_defined":111,"./_to-integer":190}],186:[function(require,module,exports){ var $export = require('./_export') , defined = require('./_defined') , fails = require('./_fails') @@ -47547,10 +48150,10 @@ var trim = exporter.trim = function(string, TYPE){ }; module.exports = exporter; -},{"./_defined":110,"./_export":115,"./_fails":117,"./_string-ws":186}],186:[function(require,module,exports){ +},{"./_defined":111,"./_export":116,"./_fails":118,"./_string-ws":187}],187:[function(require,module,exports){ module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; -},{}],187:[function(require,module,exports){ +},{}],188:[function(require,module,exports){ var ctx = require('./_ctx') , invoke = require('./_invoke') , html = require('./_html') @@ -47626,7 +48229,7 @@ module.exports = { set: setTask, clear: clearTask }; -},{"./_cof":101,"./_ctx":108,"./_dom-create":112,"./_global":121,"./_html":124,"./_invoke":127}],188:[function(require,module,exports){ +},{"./_cof":102,"./_ctx":109,"./_dom-create":113,"./_global":122,"./_html":125,"./_invoke":128}],189:[function(require,module,exports){ var toInteger = require('./_to-integer') , max = Math.max , min = Math.min; @@ -47634,34 +48237,34 @@ module.exports = function(index, length){ index = toInteger(index); return index < 0 ? max(index + length, 0) : min(index, length); }; -},{"./_to-integer":189}],189:[function(require,module,exports){ +},{"./_to-integer":190}],190:[function(require,module,exports){ // 7.1.4 ToInteger var ceil = Math.ceil , floor = Math.floor; module.exports = function(it){ return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); }; -},{}],190:[function(require,module,exports){ +},{}],191:[function(require,module,exports){ // to indexed object, toObject with fallback for non-array-like ES3 strings var IObject = require('./_iobject') , defined = require('./_defined'); module.exports = function(it){ return IObject(defined(it)); }; -},{"./_defined":110,"./_iobject":128}],191:[function(require,module,exports){ +},{"./_defined":111,"./_iobject":129}],192:[function(require,module,exports){ // 7.1.15 ToLength var toInteger = require('./_to-integer') , min = Math.min; module.exports = function(it){ return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 }; -},{"./_to-integer":189}],192:[function(require,module,exports){ +},{"./_to-integer":190}],193:[function(require,module,exports){ // 7.1.13 ToObject(argument) var defined = require('./_defined'); module.exports = function(it){ return Object(defined(it)); }; -},{"./_defined":110}],193:[function(require,module,exports){ +},{"./_defined":111}],194:[function(require,module,exports){ // 7.1.1 ToPrimitive(input [, PreferredType]) var isObject = require('./_is-object'); // instead of the ES6 spec version, we didn't implement @@toPrimitive case @@ -47674,7 +48277,7 @@ module.exports = function(it, S){ if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; throw TypeError("Can't convert object to primitive value"); }; -},{"./_is-object":132}],194:[function(require,module,exports){ +},{"./_is-object":133}],195:[function(require,module,exports){ 'use strict'; if(require('./_descriptors')){ var LIBRARY = require('./_library') @@ -48156,7 +48759,7 @@ if(require('./_descriptors')){ if(!LIBRARY && !CORRECT_ITER_NAME)hide(TypedArrayPrototype, ITERATOR, $iterator); }; } else module.exports = function(){ /* empty */ }; -},{"./_an-instance":89,"./_array-copy-within":91,"./_array-fill":92,"./_array-includes":94,"./_array-methods":95,"./_classof":100,"./_ctx":108,"./_descriptors":111,"./_export":115,"./_fails":117,"./_global":121,"./_has":122,"./_hide":123,"./_is-array-iter":129,"./_is-integer":131,"./_is-object":132,"./_iter-detect":137,"./_iterators":139,"./_library":141,"./_object-create":149,"./_object-dp":150,"./_object-gopd":153,"./_object-gopn":155,"./_object-gpo":157,"./_property-desc":168,"./_redefine-all":169,"./_same-value":172,"./_set-species":174,"./_species-constructor":178,"./_to-index":188,"./_to-integer":189,"./_to-length":191,"./_to-object":192,"./_to-primitive":193,"./_typed":196,"./_typed-buffer":195,"./_uid":197,"./_wks":200,"./core.get-iterator-method":201,"./core.is-iterable":202,"./es6.array.iterator":214}],195:[function(require,module,exports){ +},{"./_an-instance":90,"./_array-copy-within":92,"./_array-fill":93,"./_array-includes":95,"./_array-methods":96,"./_classof":101,"./_ctx":109,"./_descriptors":112,"./_export":116,"./_fails":118,"./_global":122,"./_has":123,"./_hide":124,"./_is-array-iter":130,"./_is-integer":132,"./_is-object":133,"./_iter-detect":138,"./_iterators":140,"./_library":142,"./_object-create":150,"./_object-dp":151,"./_object-gopd":154,"./_object-gopn":156,"./_object-gpo":158,"./_property-desc":169,"./_redefine-all":170,"./_same-value":173,"./_set-species":175,"./_species-constructor":179,"./_to-index":189,"./_to-integer":190,"./_to-length":192,"./_to-object":193,"./_to-primitive":194,"./_typed":197,"./_typed-buffer":196,"./_uid":198,"./_wks":201,"./core.get-iterator-method":202,"./core.is-iterable":203,"./es6.array.iterator":215}],196:[function(require,module,exports){ 'use strict'; var global = require('./_global') , DESCRIPTORS = require('./_descriptors') @@ -48432,7 +49035,7 @@ setToStringTag($DataView, DATA_VIEW); hide($DataView[PROTOTYPE], $typed.VIEW, true); exports[ARRAY_BUFFER] = $ArrayBuffer; exports[DATA_VIEW] = $DataView; -},{"./_an-instance":89,"./_array-fill":92,"./_descriptors":111,"./_fails":117,"./_global":121,"./_hide":123,"./_library":141,"./_object-dp":150,"./_object-gopn":155,"./_redefine-all":169,"./_set-to-string-tag":175,"./_to-integer":189,"./_to-length":191,"./_typed":196}],196:[function(require,module,exports){ +},{"./_an-instance":90,"./_array-fill":93,"./_descriptors":112,"./_fails":118,"./_global":122,"./_hide":124,"./_library":142,"./_object-dp":151,"./_object-gopn":156,"./_redefine-all":170,"./_set-to-string-tag":176,"./_to-integer":190,"./_to-length":192,"./_typed":197}],197:[function(require,module,exports){ var global = require('./_global') , hide = require('./_hide') , uid = require('./_uid') @@ -48459,13 +49062,13 @@ module.exports = { TYPED: TYPED, VIEW: VIEW }; -},{"./_global":121,"./_hide":123,"./_uid":197}],197:[function(require,module,exports){ +},{"./_global":122,"./_hide":124,"./_uid":198}],198:[function(require,module,exports){ var id = 0 , px = Math.random(); module.exports = function(key){ return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); }; -},{}],198:[function(require,module,exports){ +},{}],199:[function(require,module,exports){ var global = require('./_global') , core = require('./_core') , LIBRARY = require('./_library') @@ -48475,9 +49078,9 @@ module.exports = function(name){ var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); if(name.charAt(0) != '_' && !(name in $Symbol))defineProperty($Symbol, name, {value: wksExt.f(name)}); }; -},{"./_core":106,"./_global":121,"./_library":141,"./_object-dp":150,"./_wks-ext":199}],199:[function(require,module,exports){ +},{"./_core":107,"./_global":122,"./_library":142,"./_object-dp":151,"./_wks-ext":200}],200:[function(require,module,exports){ exports.f = require('./_wks'); -},{"./_wks":200}],200:[function(require,module,exports){ +},{"./_wks":201}],201:[function(require,module,exports){ var store = require('./_shared')('wks') , uid = require('./_uid') , Symbol = require('./_global').Symbol @@ -48489,7 +49092,7 @@ var $exports = module.exports = function(name){ }; $exports.store = store; -},{"./_global":121,"./_shared":177,"./_uid":197}],201:[function(require,module,exports){ +},{"./_global":122,"./_shared":178,"./_uid":198}],202:[function(require,module,exports){ var classof = require('./_classof') , ITERATOR = require('./_wks')('iterator') , Iterators = require('./_iterators'); @@ -48498,7 +49101,7 @@ module.exports = require('./_core').getIteratorMethod = function(it){ || it['@@iterator'] || Iterators[classof(it)]; }; -},{"./_classof":100,"./_core":106,"./_iterators":139,"./_wks":200}],202:[function(require,module,exports){ +},{"./_classof":101,"./_core":107,"./_iterators":140,"./_wks":201}],203:[function(require,module,exports){ var classof = require('./_classof') , ITERATOR = require('./_wks')('iterator') , Iterators = require('./_iterators'); @@ -48508,21 +49111,21 @@ module.exports = require('./_core').isIterable = function(it){ || '@@iterator' in O || Iterators.hasOwnProperty(classof(O)); }; -},{"./_classof":100,"./_core":106,"./_iterators":139,"./_wks":200}],203:[function(require,module,exports){ +},{"./_classof":101,"./_core":107,"./_iterators":140,"./_wks":201}],204:[function(require,module,exports){ // https://github.com/benjamingr/RexExp.escape var $export = require('./_export') , $re = require('./_replacer')(/[\\^$*+?.()|[\]{}]/g, '\\$&'); $export($export.S, 'RegExp', {escape: function escape(it){ return $re(it); }}); -},{"./_export":115,"./_replacer":171}],204:[function(require,module,exports){ +},{"./_export":116,"./_replacer":172}],205:[function(require,module,exports){ // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) var $export = require('./_export'); $export($export.P, 'Array', {copyWithin: require('./_array-copy-within')}); require('./_add-to-unscopables')('copyWithin'); -},{"./_add-to-unscopables":88,"./_array-copy-within":91,"./_export":115}],205:[function(require,module,exports){ +},{"./_add-to-unscopables":89,"./_array-copy-within":92,"./_export":116}],206:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $every = require('./_array-methods')(4); @@ -48533,14 +49136,14 @@ $export($export.P + $export.F * !require('./_strict-method')([].every, true), 'A return $every(this, callbackfn, arguments[1]); } }); -},{"./_array-methods":95,"./_export":115,"./_strict-method":179}],206:[function(require,module,exports){ +},{"./_array-methods":96,"./_export":116,"./_strict-method":180}],207:[function(require,module,exports){ // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) var $export = require('./_export'); $export($export.P, 'Array', {fill: require('./_array-fill')}); require('./_add-to-unscopables')('fill'); -},{"./_add-to-unscopables":88,"./_array-fill":92,"./_export":115}],207:[function(require,module,exports){ +},{"./_add-to-unscopables":89,"./_array-fill":93,"./_export":116}],208:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $filter = require('./_array-methods')(2); @@ -48551,7 +49154,7 @@ $export($export.P + $export.F * !require('./_strict-method')([].filter, true), ' return $filter(this, callbackfn, arguments[1]); } }); -},{"./_array-methods":95,"./_export":115,"./_strict-method":179}],208:[function(require,module,exports){ +},{"./_array-methods":96,"./_export":116,"./_strict-method":180}],209:[function(require,module,exports){ 'use strict'; // 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined) var $export = require('./_export') @@ -48566,7 +49169,7 @@ $export($export.P + $export.F * forced, 'Array', { } }); require('./_add-to-unscopables')(KEY); -},{"./_add-to-unscopables":88,"./_array-methods":95,"./_export":115}],209:[function(require,module,exports){ +},{"./_add-to-unscopables":89,"./_array-methods":96,"./_export":116}],210:[function(require,module,exports){ 'use strict'; // 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined) var $export = require('./_export') @@ -48581,7 +49184,7 @@ $export($export.P + $export.F * forced, 'Array', { } }); require('./_add-to-unscopables')(KEY); -},{"./_add-to-unscopables":88,"./_array-methods":95,"./_export":115}],210:[function(require,module,exports){ +},{"./_add-to-unscopables":89,"./_array-methods":96,"./_export":116}],211:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $forEach = require('./_array-methods')(0) @@ -48593,7 +49196,7 @@ $export($export.P + $export.F * !STRICT, 'Array', { return $forEach(this, callbackfn, arguments[1]); } }); -},{"./_array-methods":95,"./_export":115,"./_strict-method":179}],211:[function(require,module,exports){ +},{"./_array-methods":96,"./_export":116,"./_strict-method":180}],212:[function(require,module,exports){ 'use strict'; var ctx = require('./_ctx') , $export = require('./_export') @@ -48632,7 +49235,7 @@ $export($export.S + $export.F * !require('./_iter-detect')(function(iter){ Array } }); -},{"./_create-property":107,"./_ctx":108,"./_export":115,"./_is-array-iter":129,"./_iter-call":134,"./_iter-detect":137,"./_to-length":191,"./_to-object":192,"./core.get-iterator-method":201}],212:[function(require,module,exports){ +},{"./_create-property":108,"./_ctx":109,"./_export":116,"./_is-array-iter":130,"./_iter-call":135,"./_iter-detect":138,"./_to-length":192,"./_to-object":193,"./core.get-iterator-method":202}],213:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $indexOf = require('./_array-includes')(false) @@ -48648,12 +49251,12 @@ $export($export.P + $export.F * (NEGATIVE_ZERO || !require('./_strict-method')($ : $indexOf(this, searchElement, arguments[1]); } }); -},{"./_array-includes":94,"./_export":115,"./_strict-method":179}],213:[function(require,module,exports){ +},{"./_array-includes":95,"./_export":116,"./_strict-method":180}],214:[function(require,module,exports){ // 22.1.2.2 / 15.4.3.2 Array.isArray(arg) var $export = require('./_export'); $export($export.S, 'Array', {isArray: require('./_is-array')}); -},{"./_export":115,"./_is-array":130}],214:[function(require,module,exports){ +},{"./_export":116,"./_is-array":131}],215:[function(require,module,exports){ 'use strict'; var addToUnscopables = require('./_add-to-unscopables') , step = require('./_iter-step') @@ -48688,7 +49291,7 @@ Iterators.Arguments = Iterators.Array; addToUnscopables('keys'); addToUnscopables('values'); addToUnscopables('entries'); -},{"./_add-to-unscopables":88,"./_iter-define":136,"./_iter-step":138,"./_iterators":139,"./_to-iobject":190}],215:[function(require,module,exports){ +},{"./_add-to-unscopables":89,"./_iter-define":137,"./_iter-step":139,"./_iterators":140,"./_to-iobject":191}],216:[function(require,module,exports){ 'use strict'; // 22.1.3.13 Array.prototype.join(separator) var $export = require('./_export') @@ -48701,7 +49304,7 @@ $export($export.P + $export.F * (require('./_iobject') != Object || !require('./ return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator); } }); -},{"./_export":115,"./_iobject":128,"./_strict-method":179,"./_to-iobject":190}],216:[function(require,module,exports){ +},{"./_export":116,"./_iobject":129,"./_strict-method":180,"./_to-iobject":191}],217:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , toIObject = require('./_to-iobject') @@ -48724,7 +49327,7 @@ $export($export.P + $export.F * (NEGATIVE_ZERO || !require('./_strict-method')($ return -1; } }); -},{"./_export":115,"./_strict-method":179,"./_to-integer":189,"./_to-iobject":190,"./_to-length":191}],217:[function(require,module,exports){ +},{"./_export":116,"./_strict-method":180,"./_to-integer":190,"./_to-iobject":191,"./_to-length":192}],218:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $map = require('./_array-methods')(1); @@ -48735,7 +49338,7 @@ $export($export.P + $export.F * !require('./_strict-method')([].map, true), 'Arr return $map(this, callbackfn, arguments[1]); } }); -},{"./_array-methods":95,"./_export":115,"./_strict-method":179}],218:[function(require,module,exports){ +},{"./_array-methods":96,"./_export":116,"./_strict-method":180}],219:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , createProperty = require('./_create-property'); @@ -48755,7 +49358,7 @@ $export($export.S + $export.F * require('./_fails')(function(){ return result; } }); -},{"./_create-property":107,"./_export":115,"./_fails":117}],219:[function(require,module,exports){ +},{"./_create-property":108,"./_export":116,"./_fails":118}],220:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $reduce = require('./_array-reduce'); @@ -48766,7 +49369,7 @@ $export($export.P + $export.F * !require('./_strict-method')([].reduceRight, tru return $reduce(this, callbackfn, arguments.length, arguments[1], true); } }); -},{"./_array-reduce":96,"./_export":115,"./_strict-method":179}],220:[function(require,module,exports){ +},{"./_array-reduce":97,"./_export":116,"./_strict-method":180}],221:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $reduce = require('./_array-reduce'); @@ -48777,7 +49380,7 @@ $export($export.P + $export.F * !require('./_strict-method')([].reduce, true), ' return $reduce(this, callbackfn, arguments.length, arguments[1], false); } }); -},{"./_array-reduce":96,"./_export":115,"./_strict-method":179}],221:[function(require,module,exports){ +},{"./_array-reduce":97,"./_export":116,"./_strict-method":180}],222:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , html = require('./_html') @@ -48806,7 +49409,7 @@ $export($export.P + $export.F * require('./_fails')(function(){ return cloned; } }); -},{"./_cof":101,"./_export":115,"./_fails":117,"./_html":124,"./_to-index":188,"./_to-length":191}],222:[function(require,module,exports){ +},{"./_cof":102,"./_export":116,"./_fails":118,"./_html":125,"./_to-index":189,"./_to-length":192}],223:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $some = require('./_array-methods')(3); @@ -48817,7 +49420,7 @@ $export($export.P + $export.F * !require('./_strict-method')([].some, true), 'Ar return $some(this, callbackfn, arguments[1]); } }); -},{"./_array-methods":95,"./_export":115,"./_strict-method":179}],223:[function(require,module,exports){ +},{"./_array-methods":96,"./_export":116,"./_strict-method":180}],224:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , aFunction = require('./_a-function') @@ -48841,14 +49444,14 @@ $export($export.P + $export.F * (fails(function(){ : $sort.call(toObject(this), aFunction(comparefn)); } }); -},{"./_a-function":86,"./_export":115,"./_fails":117,"./_strict-method":179,"./_to-object":192}],224:[function(require,module,exports){ +},{"./_a-function":87,"./_export":116,"./_fails":118,"./_strict-method":180,"./_to-object":193}],225:[function(require,module,exports){ require('./_set-species')('Array'); -},{"./_set-species":174}],225:[function(require,module,exports){ +},{"./_set-species":175}],226:[function(require,module,exports){ // 20.3.3.1 / 15.9.4.4 Date.now() var $export = require('./_export'); $export($export.S, 'Date', {now: function(){ return new Date().getTime(); }}); -},{"./_export":115}],226:[function(require,module,exports){ +},{"./_export":116}],227:[function(require,module,exports){ 'use strict'; // 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() var $export = require('./_export') @@ -48877,7 +49480,7 @@ $export($export.P + $export.F * (fails(function(){ ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z'; } }); -},{"./_export":115,"./_fails":117}],227:[function(require,module,exports){ +},{"./_export":116,"./_fails":118}],228:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , toObject = require('./_to-object') @@ -48892,12 +49495,12 @@ $export($export.P + $export.F * require('./_fails')(function(){ return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString(); } }); -},{"./_export":115,"./_fails":117,"./_to-object":192,"./_to-primitive":193}],228:[function(require,module,exports){ +},{"./_export":116,"./_fails":118,"./_to-object":193,"./_to-primitive":194}],229:[function(require,module,exports){ var TO_PRIMITIVE = require('./_wks')('toPrimitive') , proto = Date.prototype; if(!(TO_PRIMITIVE in proto))require('./_hide')(proto, TO_PRIMITIVE, require('./_date-to-primitive')); -},{"./_date-to-primitive":109,"./_hide":123,"./_wks":200}],229:[function(require,module,exports){ +},{"./_date-to-primitive":110,"./_hide":124,"./_wks":201}],230:[function(require,module,exports){ var DateProto = Date.prototype , INVALID_DATE = 'Invalid Date' , TO_STRING = 'toString' @@ -48909,12 +49512,12 @@ if(new Date(NaN) + '' != INVALID_DATE){ return value === value ? $toString.call(this) : INVALID_DATE; }); } -},{"./_redefine":170}],230:[function(require,module,exports){ +},{"./_redefine":171}],231:[function(require,module,exports){ // 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...) var $export = require('./_export'); $export($export.P, 'Function', {bind: require('./_bind')}); -},{"./_bind":99,"./_export":115}],231:[function(require,module,exports){ +},{"./_bind":100,"./_export":116}],232:[function(require,module,exports){ 'use strict'; var isObject = require('./_is-object') , getPrototypeOf = require('./_object-gpo') @@ -48928,7 +49531,7 @@ if(!(HAS_INSTANCE in FunctionProto))require('./_object-dp').f(FunctionProto, HAS while(O = getPrototypeOf(O))if(this.prototype === O)return true; return false; }}); -},{"./_is-object":132,"./_object-dp":150,"./_object-gpo":157,"./_wks":200}],232:[function(require,module,exports){ +},{"./_is-object":133,"./_object-dp":151,"./_object-gpo":158,"./_wks":201}],233:[function(require,module,exports){ var dP = require('./_object-dp').f , createDesc = require('./_property-desc') , has = require('./_has') @@ -48954,7 +49557,7 @@ NAME in FProto || require('./_descriptors') && dP(FProto, NAME, { } } }); -},{"./_descriptors":111,"./_has":122,"./_object-dp":150,"./_property-desc":168}],233:[function(require,module,exports){ +},{"./_descriptors":112,"./_has":123,"./_object-dp":151,"./_property-desc":169}],234:[function(require,module,exports){ 'use strict'; var strong = require('./_collection-strong'); @@ -48972,7 +49575,7 @@ module.exports = require('./_collection')('Map', function(get){ return strong.def(this, key === 0 ? 0 : key, value); } }, strong, true); -},{"./_collection":105,"./_collection-strong":102}],234:[function(require,module,exports){ +},{"./_collection":106,"./_collection-strong":103}],235:[function(require,module,exports){ // 20.2.2.3 Math.acosh(x) var $export = require('./_export') , log1p = require('./_math-log1p') @@ -48991,7 +49594,7 @@ $export($export.S + $export.F * !($acosh : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1)); } }); -},{"./_export":115,"./_math-log1p":143}],235:[function(require,module,exports){ +},{"./_export":116,"./_math-log1p":144}],236:[function(require,module,exports){ // 20.2.2.5 Math.asinh(x) var $export = require('./_export') , $asinh = Math.asinh; @@ -49002,7 +49605,7 @@ function asinh(x){ // Tor Browser bug: Math.asinh(0) -> -0 $export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', {asinh: asinh}); -},{"./_export":115}],236:[function(require,module,exports){ +},{"./_export":116}],237:[function(require,module,exports){ // 20.2.2.7 Math.atanh(x) var $export = require('./_export') , $atanh = Math.atanh; @@ -49013,7 +49616,7 @@ $export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', { return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2; } }); -},{"./_export":115}],237:[function(require,module,exports){ +},{"./_export":116}],238:[function(require,module,exports){ // 20.2.2.9 Math.cbrt(x) var $export = require('./_export') , sign = require('./_math-sign'); @@ -49023,7 +49626,7 @@ $export($export.S, 'Math', { return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3); } }); -},{"./_export":115,"./_math-sign":144}],238:[function(require,module,exports){ +},{"./_export":116,"./_math-sign":145}],239:[function(require,module,exports){ // 20.2.2.11 Math.clz32(x) var $export = require('./_export'); @@ -49032,7 +49635,7 @@ $export($export.S, 'Math', { return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32; } }); -},{"./_export":115}],239:[function(require,module,exports){ +},{"./_export":116}],240:[function(require,module,exports){ // 20.2.2.12 Math.cosh(x) var $export = require('./_export') , exp = Math.exp; @@ -49042,13 +49645,13 @@ $export($export.S, 'Math', { return (exp(x = +x) + exp(-x)) / 2; } }); -},{"./_export":115}],240:[function(require,module,exports){ +},{"./_export":116}],241:[function(require,module,exports){ // 20.2.2.14 Math.expm1(x) var $export = require('./_export') , $expm1 = require('./_math-expm1'); $export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', {expm1: $expm1}); -},{"./_export":115,"./_math-expm1":142}],241:[function(require,module,exports){ +},{"./_export":116,"./_math-expm1":143}],242:[function(require,module,exports){ // 20.2.2.16 Math.fround(x) var $export = require('./_export') , sign = require('./_math-sign') @@ -49075,7 +49678,7 @@ $export($export.S, 'Math', { return $sign * result; } }); -},{"./_export":115,"./_math-sign":144}],242:[function(require,module,exports){ +},{"./_export":116,"./_math-sign":145}],243:[function(require,module,exports){ // 20.2.2.17 Math.hypot([value1[, value2[, … ]]]) var $export = require('./_export') , abs = Math.abs; @@ -49101,7 +49704,7 @@ $export($export.S, 'Math', { return larg === Infinity ? Infinity : larg * Math.sqrt(sum); } }); -},{"./_export":115}],243:[function(require,module,exports){ +},{"./_export":116}],244:[function(require,module,exports){ // 20.2.2.18 Math.imul(x, y) var $export = require('./_export') , $imul = Math.imul; @@ -49119,7 +49722,7 @@ $export($export.S + $export.F * require('./_fails')(function(){ return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0); } }); -},{"./_export":115,"./_fails":117}],244:[function(require,module,exports){ +},{"./_export":116,"./_fails":118}],245:[function(require,module,exports){ // 20.2.2.21 Math.log10(x) var $export = require('./_export'); @@ -49128,12 +49731,12 @@ $export($export.S, 'Math', { return Math.log(x) / Math.LN10; } }); -},{"./_export":115}],245:[function(require,module,exports){ +},{"./_export":116}],246:[function(require,module,exports){ // 20.2.2.20 Math.log1p(x) var $export = require('./_export'); $export($export.S, 'Math', {log1p: require('./_math-log1p')}); -},{"./_export":115,"./_math-log1p":143}],246:[function(require,module,exports){ +},{"./_export":116,"./_math-log1p":144}],247:[function(require,module,exports){ // 20.2.2.22 Math.log2(x) var $export = require('./_export'); @@ -49142,12 +49745,12 @@ $export($export.S, 'Math', { return Math.log(x) / Math.LN2; } }); -},{"./_export":115}],247:[function(require,module,exports){ +},{"./_export":116}],248:[function(require,module,exports){ // 20.2.2.28 Math.sign(x) var $export = require('./_export'); $export($export.S, 'Math', {sign: require('./_math-sign')}); -},{"./_export":115,"./_math-sign":144}],248:[function(require,module,exports){ +},{"./_export":116,"./_math-sign":145}],249:[function(require,module,exports){ // 20.2.2.30 Math.sinh(x) var $export = require('./_export') , expm1 = require('./_math-expm1') @@ -49163,7 +49766,7 @@ $export($export.S + $export.F * require('./_fails')(function(){ : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2); } }); -},{"./_export":115,"./_fails":117,"./_math-expm1":142}],249:[function(require,module,exports){ +},{"./_export":116,"./_fails":118,"./_math-expm1":143}],250:[function(require,module,exports){ // 20.2.2.33 Math.tanh(x) var $export = require('./_export') , expm1 = require('./_math-expm1') @@ -49176,7 +49779,7 @@ $export($export.S, 'Math', { return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x)); } }); -},{"./_export":115,"./_math-expm1":142}],250:[function(require,module,exports){ +},{"./_export":116,"./_math-expm1":143}],251:[function(require,module,exports){ // 20.2.2.34 Math.trunc(x) var $export = require('./_export'); @@ -49185,7 +49788,7 @@ $export($export.S, 'Math', { return (it > 0 ? Math.floor : Math.ceil)(it); } }); -},{"./_export":115}],251:[function(require,module,exports){ +},{"./_export":116}],252:[function(require,module,exports){ 'use strict'; var global = require('./_global') , has = require('./_has') @@ -49255,12 +49858,12 @@ if(!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')){ proto.constructor = $Number; require('./_redefine')(global, NUMBER, $Number); } -},{"./_cof":101,"./_descriptors":111,"./_fails":117,"./_global":121,"./_has":122,"./_inherit-if-required":126,"./_object-create":149,"./_object-dp":150,"./_object-gopd":153,"./_object-gopn":155,"./_redefine":170,"./_string-trim":185,"./_to-primitive":193}],252:[function(require,module,exports){ +},{"./_cof":102,"./_descriptors":112,"./_fails":118,"./_global":122,"./_has":123,"./_inherit-if-required":127,"./_object-create":150,"./_object-dp":151,"./_object-gopd":154,"./_object-gopn":156,"./_redefine":171,"./_string-trim":186,"./_to-primitive":194}],253:[function(require,module,exports){ // 20.1.2.1 Number.EPSILON var $export = require('./_export'); $export($export.S, 'Number', {EPSILON: Math.pow(2, -52)}); -},{"./_export":115}],253:[function(require,module,exports){ +},{"./_export":116}],254:[function(require,module,exports){ // 20.1.2.2 Number.isFinite(number) var $export = require('./_export') , _isFinite = require('./_global').isFinite; @@ -49270,12 +49873,12 @@ $export($export.S, 'Number', { return typeof it == 'number' && _isFinite(it); } }); -},{"./_export":115,"./_global":121}],254:[function(require,module,exports){ +},{"./_export":116,"./_global":122}],255:[function(require,module,exports){ // 20.1.2.3 Number.isInteger(number) var $export = require('./_export'); $export($export.S, 'Number', {isInteger: require('./_is-integer')}); -},{"./_export":115,"./_is-integer":131}],255:[function(require,module,exports){ +},{"./_export":116,"./_is-integer":132}],256:[function(require,module,exports){ // 20.1.2.4 Number.isNaN(number) var $export = require('./_export'); @@ -49284,7 +49887,7 @@ $export($export.S, 'Number', { return number != number; } }); -},{"./_export":115}],256:[function(require,module,exports){ +},{"./_export":116}],257:[function(require,module,exports){ // 20.1.2.5 Number.isSafeInteger(number) var $export = require('./_export') , isInteger = require('./_is-integer') @@ -49295,27 +49898,27 @@ $export($export.S, 'Number', { return isInteger(number) && abs(number) <= 0x1fffffffffffff; } }); -},{"./_export":115,"./_is-integer":131}],257:[function(require,module,exports){ +},{"./_export":116,"./_is-integer":132}],258:[function(require,module,exports){ // 20.1.2.6 Number.MAX_SAFE_INTEGER var $export = require('./_export'); $export($export.S, 'Number', {MAX_SAFE_INTEGER: 0x1fffffffffffff}); -},{"./_export":115}],258:[function(require,module,exports){ +},{"./_export":116}],259:[function(require,module,exports){ // 20.1.2.10 Number.MIN_SAFE_INTEGER var $export = require('./_export'); $export($export.S, 'Number', {MIN_SAFE_INTEGER: -0x1fffffffffffff}); -},{"./_export":115}],259:[function(require,module,exports){ +},{"./_export":116}],260:[function(require,module,exports){ var $export = require('./_export') , $parseFloat = require('./_parse-float'); // 20.1.2.12 Number.parseFloat(string) $export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', {parseFloat: $parseFloat}); -},{"./_export":115,"./_parse-float":164}],260:[function(require,module,exports){ +},{"./_export":116,"./_parse-float":165}],261:[function(require,module,exports){ var $export = require('./_export') , $parseInt = require('./_parse-int'); // 20.1.2.13 Number.parseInt(string, radix) $export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', {parseInt: $parseInt}); -},{"./_export":115,"./_parse-int":165}],261:[function(require,module,exports){ +},{"./_export":116,"./_parse-int":166}],262:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , anInstance = require('./_an-instance') @@ -49430,7 +50033,7 @@ $export($export.P + $export.F * (!!$toFixed && ( } return m; } }); -},{"./_a-number-value":87,"./_an-instance":89,"./_export":115,"./_fails":117,"./_string-repeat":184,"./_to-integer":189}],262:[function(require,module,exports){ +},{"./_a-number-value":88,"./_an-instance":90,"./_export":116,"./_fails":118,"./_string-repeat":185,"./_to-integer":190}],263:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $fails = require('./_fails') @@ -49449,24 +50052,24 @@ $export($export.P + $export.F * ($fails(function(){ return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision); } }); -},{"./_a-number-value":87,"./_export":115,"./_fails":117}],263:[function(require,module,exports){ +},{"./_a-number-value":88,"./_export":116,"./_fails":118}],264:[function(require,module,exports){ // 19.1.3.1 Object.assign(target, source) var $export = require('./_export'); $export($export.S + $export.F, 'Object', {assign: require('./_object-assign')}); -},{"./_export":115,"./_object-assign":148}],264:[function(require,module,exports){ +},{"./_export":116,"./_object-assign":149}],265:[function(require,module,exports){ var $export = require('./_export') // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) $export($export.S, 'Object', {create: require('./_object-create')}); -},{"./_export":115,"./_object-create":149}],265:[function(require,module,exports){ +},{"./_export":116,"./_object-create":150}],266:[function(require,module,exports){ var $export = require('./_export'); // 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) $export($export.S + $export.F * !require('./_descriptors'), 'Object', {defineProperties: require('./_object-dps')}); -},{"./_descriptors":111,"./_export":115,"./_object-dps":151}],266:[function(require,module,exports){ +},{"./_descriptors":112,"./_export":116,"./_object-dps":152}],267:[function(require,module,exports){ var $export = require('./_export'); // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) $export($export.S + $export.F * !require('./_descriptors'), 'Object', {defineProperty: require('./_object-dp').f}); -},{"./_descriptors":111,"./_export":115,"./_object-dp":150}],267:[function(require,module,exports){ +},{"./_descriptors":112,"./_export":116,"./_object-dp":151}],268:[function(require,module,exports){ // 19.1.2.5 Object.freeze(O) var isObject = require('./_is-object') , meta = require('./_meta').onFreeze; @@ -49476,7 +50079,7 @@ require('./_object-sap')('freeze', function($freeze){ return $freeze && isObject(it) ? $freeze(meta(it)) : it; }; }); -},{"./_is-object":132,"./_meta":145,"./_object-sap":161}],268:[function(require,module,exports){ +},{"./_is-object":133,"./_meta":146,"./_object-sap":162}],269:[function(require,module,exports){ // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) var toIObject = require('./_to-iobject') , $getOwnPropertyDescriptor = require('./_object-gopd').f; @@ -49486,12 +50089,12 @@ require('./_object-sap')('getOwnPropertyDescriptor', function(){ return $getOwnPropertyDescriptor(toIObject(it), key); }; }); -},{"./_object-gopd":153,"./_object-sap":161,"./_to-iobject":190}],269:[function(require,module,exports){ +},{"./_object-gopd":154,"./_object-sap":162,"./_to-iobject":191}],270:[function(require,module,exports){ // 19.1.2.7 Object.getOwnPropertyNames(O) require('./_object-sap')('getOwnPropertyNames', function(){ return require('./_object-gopn-ext').f; }); -},{"./_object-gopn-ext":154,"./_object-sap":161}],270:[function(require,module,exports){ +},{"./_object-gopn-ext":155,"./_object-sap":162}],271:[function(require,module,exports){ // 19.1.2.9 Object.getPrototypeOf(O) var toObject = require('./_to-object') , $getPrototypeOf = require('./_object-gpo'); @@ -49501,7 +50104,7 @@ require('./_object-sap')('getPrototypeOf', function(){ return $getPrototypeOf(toObject(it)); }; }); -},{"./_object-gpo":157,"./_object-sap":161,"./_to-object":192}],271:[function(require,module,exports){ +},{"./_object-gpo":158,"./_object-sap":162,"./_to-object":193}],272:[function(require,module,exports){ // 19.1.2.11 Object.isExtensible(O) var isObject = require('./_is-object'); @@ -49510,7 +50113,7 @@ require('./_object-sap')('isExtensible', function($isExtensible){ return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false; }; }); -},{"./_is-object":132,"./_object-sap":161}],272:[function(require,module,exports){ +},{"./_is-object":133,"./_object-sap":162}],273:[function(require,module,exports){ // 19.1.2.12 Object.isFrozen(O) var isObject = require('./_is-object'); @@ -49519,7 +50122,7 @@ require('./_object-sap')('isFrozen', function($isFrozen){ return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true; }; }); -},{"./_is-object":132,"./_object-sap":161}],273:[function(require,module,exports){ +},{"./_is-object":133,"./_object-sap":162}],274:[function(require,module,exports){ // 19.1.2.13 Object.isSealed(O) var isObject = require('./_is-object'); @@ -49528,11 +50131,11 @@ require('./_object-sap')('isSealed', function($isSealed){ return isObject(it) ? $isSealed ? $isSealed(it) : false : true; }; }); -},{"./_is-object":132,"./_object-sap":161}],274:[function(require,module,exports){ +},{"./_is-object":133,"./_object-sap":162}],275:[function(require,module,exports){ // 19.1.3.10 Object.is(value1, value2) var $export = require('./_export'); $export($export.S, 'Object', {is: require('./_same-value')}); -},{"./_export":115,"./_same-value":172}],275:[function(require,module,exports){ +},{"./_export":116,"./_same-value":173}],276:[function(require,module,exports){ // 19.1.2.14 Object.keys(O) var toObject = require('./_to-object') , $keys = require('./_object-keys'); @@ -49542,7 +50145,7 @@ require('./_object-sap')('keys', function(){ return $keys(toObject(it)); }; }); -},{"./_object-keys":159,"./_object-sap":161,"./_to-object":192}],276:[function(require,module,exports){ +},{"./_object-keys":160,"./_object-sap":162,"./_to-object":193}],277:[function(require,module,exports){ // 19.1.2.15 Object.preventExtensions(O) var isObject = require('./_is-object') , meta = require('./_meta').onFreeze; @@ -49552,7 +50155,7 @@ require('./_object-sap')('preventExtensions', function($preventExtensions){ return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it; }; }); -},{"./_is-object":132,"./_meta":145,"./_object-sap":161}],277:[function(require,module,exports){ +},{"./_is-object":133,"./_meta":146,"./_object-sap":162}],278:[function(require,module,exports){ // 19.1.2.17 Object.seal(O) var isObject = require('./_is-object') , meta = require('./_meta').onFreeze; @@ -49562,11 +50165,11 @@ require('./_object-sap')('seal', function($seal){ return $seal && isObject(it) ? $seal(meta(it)) : it; }; }); -},{"./_is-object":132,"./_meta":145,"./_object-sap":161}],278:[function(require,module,exports){ +},{"./_is-object":133,"./_meta":146,"./_object-sap":162}],279:[function(require,module,exports){ // 19.1.3.19 Object.setPrototypeOf(O, proto) var $export = require('./_export'); $export($export.S, 'Object', {setPrototypeOf: require('./_set-proto').set}); -},{"./_export":115,"./_set-proto":173}],279:[function(require,module,exports){ +},{"./_export":116,"./_set-proto":174}],280:[function(require,module,exports){ 'use strict'; // 19.1.3.6 Object.prototype.toString() var classof = require('./_classof') @@ -49577,17 +50180,17 @@ if(test + '' != '[object z]'){ return '[object ' + classof(this) + ']'; }, true); } -},{"./_classof":100,"./_redefine":170,"./_wks":200}],280:[function(require,module,exports){ +},{"./_classof":101,"./_redefine":171,"./_wks":201}],281:[function(require,module,exports){ var $export = require('./_export') , $parseFloat = require('./_parse-float'); // 18.2.4 parseFloat(string) $export($export.G + $export.F * (parseFloat != $parseFloat), {parseFloat: $parseFloat}); -},{"./_export":115,"./_parse-float":164}],281:[function(require,module,exports){ +},{"./_export":116,"./_parse-float":165}],282:[function(require,module,exports){ var $export = require('./_export') , $parseInt = require('./_parse-int'); // 18.2.5 parseInt(string, radix) $export($export.G + $export.F * (parseInt != $parseInt), {parseInt: $parseInt}); -},{"./_export":115,"./_parse-int":165}],282:[function(require,module,exports){ +},{"./_export":116,"./_parse-int":166}],283:[function(require,module,exports){ 'use strict'; var LIBRARY = require('./_library') , global = require('./_global') @@ -49889,7 +50492,7 @@ $export($export.S + $export.F * !(USE_NATIVE && require('./_iter-detect')(functi return capability.promise; } }); -},{"./_a-function":86,"./_an-instance":89,"./_an-object":90,"./_classof":100,"./_core":106,"./_ctx":108,"./_export":115,"./_for-of":120,"./_global":121,"./_is-object":132,"./_iter-detect":137,"./_library":141,"./_microtask":147,"./_redefine-all":169,"./_set-proto":173,"./_set-species":174,"./_set-to-string-tag":175,"./_species-constructor":178,"./_task":187,"./_wks":200}],283:[function(require,module,exports){ +},{"./_a-function":87,"./_an-instance":90,"./_an-object":91,"./_classof":101,"./_core":107,"./_ctx":109,"./_export":116,"./_for-of":121,"./_global":122,"./_is-object":133,"./_iter-detect":138,"./_library":142,"./_microtask":148,"./_redefine-all":170,"./_set-proto":174,"./_set-species":175,"./_set-to-string-tag":176,"./_species-constructor":179,"./_task":188,"./_wks":201}],284:[function(require,module,exports){ // 26.1.1 Reflect.apply(target, thisArgument, argumentsList) var $export = require('./_export') , aFunction = require('./_a-function') @@ -49901,7 +50504,7 @@ $export($export.S, 'Reflect', { return _apply.call(aFunction(target), thisArgument, anObject(argumentsList)); } }); -},{"./_a-function":86,"./_an-object":90,"./_export":115}],284:[function(require,module,exports){ +},{"./_a-function":87,"./_an-object":91,"./_export":116}],285:[function(require,module,exports){ // 26.1.2 Reflect.construct(target, argumentsList [, newTarget]) var $export = require('./_export') , create = require('./_object-create') @@ -49941,7 +50544,7 @@ $export($export.S + $export.F * require('./_fails')(function(){ return isObject(result) ? result : instance; } }); -},{"./_a-function":86,"./_an-object":90,"./_bind":99,"./_export":115,"./_fails":117,"./_is-object":132,"./_object-create":149}],285:[function(require,module,exports){ +},{"./_a-function":87,"./_an-object":91,"./_bind":100,"./_export":116,"./_fails":118,"./_is-object":133,"./_object-create":150}],286:[function(require,module,exports){ // 26.1.3 Reflect.defineProperty(target, propertyKey, attributes) var dP = require('./_object-dp') , $export = require('./_export') @@ -49964,7 +50567,7 @@ $export($export.S + $export.F * require('./_fails')(function(){ } } }); -},{"./_an-object":90,"./_export":115,"./_fails":117,"./_object-dp":150,"./_to-primitive":193}],286:[function(require,module,exports){ +},{"./_an-object":91,"./_export":116,"./_fails":118,"./_object-dp":151,"./_to-primitive":194}],287:[function(require,module,exports){ // 26.1.4 Reflect.deleteProperty(target, propertyKey) var $export = require('./_export') , gOPD = require('./_object-gopd').f @@ -49976,7 +50579,7 @@ $export($export.S, 'Reflect', { return desc && !desc.configurable ? false : delete target[propertyKey]; } }); -},{"./_an-object":90,"./_export":115,"./_object-gopd":153}],287:[function(require,module,exports){ +},{"./_an-object":91,"./_export":116,"./_object-gopd":154}],288:[function(require,module,exports){ 'use strict'; // 26.1.5 Reflect.enumerate(target) var $export = require('./_export') @@ -50003,7 +50606,7 @@ $export($export.S, 'Reflect', { return new Enumerate(target); } }); -},{"./_an-object":90,"./_export":115,"./_iter-create":135}],288:[function(require,module,exports){ +},{"./_an-object":91,"./_export":116,"./_iter-create":136}],289:[function(require,module,exports){ // 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey) var gOPD = require('./_object-gopd') , $export = require('./_export') @@ -50014,7 +50617,7 @@ $export($export.S, 'Reflect', { return gOPD.f(anObject(target), propertyKey); } }); -},{"./_an-object":90,"./_export":115,"./_object-gopd":153}],289:[function(require,module,exports){ +},{"./_an-object":91,"./_export":116,"./_object-gopd":154}],290:[function(require,module,exports){ // 26.1.8 Reflect.getPrototypeOf(target) var $export = require('./_export') , getProto = require('./_object-gpo') @@ -50025,7 +50628,7 @@ $export($export.S, 'Reflect', { return getProto(anObject(target)); } }); -},{"./_an-object":90,"./_export":115,"./_object-gpo":157}],290:[function(require,module,exports){ +},{"./_an-object":91,"./_export":116,"./_object-gpo":158}],291:[function(require,module,exports){ // 26.1.6 Reflect.get(target, propertyKey [, receiver]) var gOPD = require('./_object-gopd') , getPrototypeOf = require('./_object-gpo') @@ -50047,7 +50650,7 @@ function get(target, propertyKey/*, receiver*/){ } $export($export.S, 'Reflect', {get: get}); -},{"./_an-object":90,"./_export":115,"./_has":122,"./_is-object":132,"./_object-gopd":153,"./_object-gpo":157}],291:[function(require,module,exports){ +},{"./_an-object":91,"./_export":116,"./_has":123,"./_is-object":133,"./_object-gopd":154,"./_object-gpo":158}],292:[function(require,module,exports){ // 26.1.9 Reflect.has(target, propertyKey) var $export = require('./_export'); @@ -50056,7 +50659,7 @@ $export($export.S, 'Reflect', { return propertyKey in target; } }); -},{"./_export":115}],292:[function(require,module,exports){ +},{"./_export":116}],293:[function(require,module,exports){ // 26.1.10 Reflect.isExtensible(target) var $export = require('./_export') , anObject = require('./_an-object') @@ -50068,12 +50671,12 @@ $export($export.S, 'Reflect', { return $isExtensible ? $isExtensible(target) : true; } }); -},{"./_an-object":90,"./_export":115}],293:[function(require,module,exports){ +},{"./_an-object":91,"./_export":116}],294:[function(require,module,exports){ // 26.1.11 Reflect.ownKeys(target) var $export = require('./_export'); $export($export.S, 'Reflect', {ownKeys: require('./_own-keys')}); -},{"./_export":115,"./_own-keys":163}],294:[function(require,module,exports){ +},{"./_export":116,"./_own-keys":164}],295:[function(require,module,exports){ // 26.1.12 Reflect.preventExtensions(target) var $export = require('./_export') , anObject = require('./_an-object') @@ -50090,7 +50693,7 @@ $export($export.S, 'Reflect', { } } }); -},{"./_an-object":90,"./_export":115}],295:[function(require,module,exports){ +},{"./_an-object":91,"./_export":116}],296:[function(require,module,exports){ // 26.1.14 Reflect.setPrototypeOf(target, proto) var $export = require('./_export') , setProto = require('./_set-proto'); @@ -50106,7 +50709,7 @@ if(setProto)$export($export.S, 'Reflect', { } } }); -},{"./_export":115,"./_set-proto":173}],296:[function(require,module,exports){ +},{"./_export":116,"./_set-proto":174}],297:[function(require,module,exports){ // 26.1.13 Reflect.set(target, propertyKey, V [, receiver]) var dP = require('./_object-dp') , gOPD = require('./_object-gopd') @@ -50138,7 +50741,7 @@ function set(target, propertyKey, V/*, receiver*/){ } $export($export.S, 'Reflect', {set: set}); -},{"./_an-object":90,"./_export":115,"./_has":122,"./_is-object":132,"./_object-dp":150,"./_object-gopd":153,"./_object-gpo":157,"./_property-desc":168}],297:[function(require,module,exports){ +},{"./_an-object":91,"./_export":116,"./_has":123,"./_is-object":133,"./_object-dp":151,"./_object-gopd":154,"./_object-gpo":158,"./_property-desc":169}],298:[function(require,module,exports){ var global = require('./_global') , inheritIfRequired = require('./_inherit-if-required') , dP = require('./_object-dp').f @@ -50182,13 +50785,13 @@ if(require('./_descriptors') && (!CORRECT_NEW || require('./_fails')(function(){ } require('./_set-species')('RegExp'); -},{"./_descriptors":111,"./_fails":117,"./_flags":119,"./_global":121,"./_inherit-if-required":126,"./_is-regexp":133,"./_object-dp":150,"./_object-gopn":155,"./_redefine":170,"./_set-species":174,"./_wks":200}],298:[function(require,module,exports){ +},{"./_descriptors":112,"./_fails":118,"./_flags":120,"./_global":122,"./_inherit-if-required":127,"./_is-regexp":134,"./_object-dp":151,"./_object-gopn":156,"./_redefine":171,"./_set-species":175,"./_wks":201}],299:[function(require,module,exports){ // 21.2.5.3 get RegExp.prototype.flags() if(require('./_descriptors') && /./g.flags != 'g')require('./_object-dp').f(RegExp.prototype, 'flags', { configurable: true, get: require('./_flags') }); -},{"./_descriptors":111,"./_flags":119,"./_object-dp":150}],299:[function(require,module,exports){ +},{"./_descriptors":112,"./_flags":120,"./_object-dp":151}],300:[function(require,module,exports){ // @@match logic require('./_fix-re-wks')('match', 1, function(defined, MATCH, $match){ // 21.1.3.11 String.prototype.match(regexp) @@ -50199,7 +50802,7 @@ require('./_fix-re-wks')('match', 1, function(defined, MATCH, $match){ return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O)); }, $match]; }); -},{"./_fix-re-wks":118}],300:[function(require,module,exports){ +},{"./_fix-re-wks":119}],301:[function(require,module,exports){ // @@replace logic require('./_fix-re-wks')('replace', 2, function(defined, REPLACE, $replace){ // 21.1.3.14 String.prototype.replace(searchValue, replaceValue) @@ -50212,7 +50815,7 @@ require('./_fix-re-wks')('replace', 2, function(defined, REPLACE, $replace){ : $replace.call(String(O), searchValue, replaceValue); }, $replace]; }); -},{"./_fix-re-wks":118}],301:[function(require,module,exports){ +},{"./_fix-re-wks":119}],302:[function(require,module,exports){ // @@search logic require('./_fix-re-wks')('search', 1, function(defined, SEARCH, $search){ // 21.1.3.15 String.prototype.search(regexp) @@ -50223,7 +50826,7 @@ require('./_fix-re-wks')('search', 1, function(defined, SEARCH, $search){ return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O)); }, $search]; }); -},{"./_fix-re-wks":118}],302:[function(require,module,exports){ +},{"./_fix-re-wks":119}],303:[function(require,module,exports){ // @@split logic require('./_fix-re-wks')('split', 2, function(defined, SPLIT, $split){ 'use strict'; @@ -50294,7 +50897,7 @@ require('./_fix-re-wks')('split', 2, function(defined, SPLIT, $split){ return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit); }, $split]; }); -},{"./_fix-re-wks":118,"./_is-regexp":133}],303:[function(require,module,exports){ +},{"./_fix-re-wks":119,"./_is-regexp":134}],304:[function(require,module,exports){ 'use strict'; require('./es6.regexp.flags'); var anObject = require('./_an-object') @@ -50320,7 +50923,7 @@ if(require('./_fails')(function(){ return $toString.call({source: 'a', flags: 'b return $toString.call(this); }); } -},{"./_an-object":90,"./_descriptors":111,"./_fails":117,"./_flags":119,"./_redefine":170,"./es6.regexp.flags":298}],304:[function(require,module,exports){ +},{"./_an-object":91,"./_descriptors":112,"./_fails":118,"./_flags":120,"./_redefine":171,"./es6.regexp.flags":299}],305:[function(require,module,exports){ 'use strict'; var strong = require('./_collection-strong'); @@ -50333,7 +50936,7 @@ module.exports = require('./_collection')('Set', function(get){ return strong.def(this, value = value === 0 ? 0 : value, value); } }, strong); -},{"./_collection":105,"./_collection-strong":102}],305:[function(require,module,exports){ +},{"./_collection":106,"./_collection-strong":103}],306:[function(require,module,exports){ 'use strict'; // B.2.3.2 String.prototype.anchor(name) require('./_string-html')('anchor', function(createHTML){ @@ -50341,7 +50944,7 @@ require('./_string-html')('anchor', function(createHTML){ return createHTML(this, 'a', 'name', name); } }); -},{"./_string-html":182}],306:[function(require,module,exports){ +},{"./_string-html":183}],307:[function(require,module,exports){ 'use strict'; // B.2.3.3 String.prototype.big() require('./_string-html')('big', function(createHTML){ @@ -50349,7 +50952,7 @@ require('./_string-html')('big', function(createHTML){ return createHTML(this, 'big', '', ''); } }); -},{"./_string-html":182}],307:[function(require,module,exports){ +},{"./_string-html":183}],308:[function(require,module,exports){ 'use strict'; // B.2.3.4 String.prototype.blink() require('./_string-html')('blink', function(createHTML){ @@ -50357,7 +50960,7 @@ require('./_string-html')('blink', function(createHTML){ return createHTML(this, 'blink', '', ''); } }); -},{"./_string-html":182}],308:[function(require,module,exports){ +},{"./_string-html":183}],309:[function(require,module,exports){ 'use strict'; // B.2.3.5 String.prototype.bold() require('./_string-html')('bold', function(createHTML){ @@ -50365,7 +50968,7 @@ require('./_string-html')('bold', function(createHTML){ return createHTML(this, 'b', '', ''); } }); -},{"./_string-html":182}],309:[function(require,module,exports){ +},{"./_string-html":183}],310:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $at = require('./_string-at')(false); @@ -50375,7 +50978,7 @@ $export($export.P, 'String', { return $at(this, pos); } }); -},{"./_export":115,"./_string-at":180}],310:[function(require,module,exports){ +},{"./_export":116,"./_string-at":181}],311:[function(require,module,exports){ // 21.1.3.6 String.prototype.endsWith(searchString [, endPosition]) 'use strict'; var $export = require('./_export') @@ -50396,7 +50999,7 @@ $export($export.P + $export.F * require('./_fails-is-regexp')(ENDS_WITH), 'Strin : that.slice(end - search.length, end) === search; } }); -},{"./_export":115,"./_fails-is-regexp":116,"./_string-context":181,"./_to-length":191}],311:[function(require,module,exports){ +},{"./_export":116,"./_fails-is-regexp":117,"./_string-context":182,"./_to-length":192}],312:[function(require,module,exports){ 'use strict'; // B.2.3.6 String.prototype.fixed() require('./_string-html')('fixed', function(createHTML){ @@ -50404,7 +51007,7 @@ require('./_string-html')('fixed', function(createHTML){ return createHTML(this, 'tt', '', ''); } }); -},{"./_string-html":182}],312:[function(require,module,exports){ +},{"./_string-html":183}],313:[function(require,module,exports){ 'use strict'; // B.2.3.7 String.prototype.fontcolor(color) require('./_string-html')('fontcolor', function(createHTML){ @@ -50412,7 +51015,7 @@ require('./_string-html')('fontcolor', function(createHTML){ return createHTML(this, 'font', 'color', color); } }); -},{"./_string-html":182}],313:[function(require,module,exports){ +},{"./_string-html":183}],314:[function(require,module,exports){ 'use strict'; // B.2.3.8 String.prototype.fontsize(size) require('./_string-html')('fontsize', function(createHTML){ @@ -50420,7 +51023,7 @@ require('./_string-html')('fontsize', function(createHTML){ return createHTML(this, 'font', 'size', size); } }); -},{"./_string-html":182}],314:[function(require,module,exports){ +},{"./_string-html":183}],315:[function(require,module,exports){ var $export = require('./_export') , toIndex = require('./_to-index') , fromCharCode = String.fromCharCode @@ -50444,7 +51047,7 @@ $export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1) } return res.join(''); } }); -},{"./_export":115,"./_to-index":188}],315:[function(require,module,exports){ +},{"./_export":116,"./_to-index":189}],316:[function(require,module,exports){ // 21.1.3.7 String.prototype.includes(searchString, position = 0) 'use strict'; var $export = require('./_export') @@ -50457,7 +51060,7 @@ $export($export.P + $export.F * require('./_fails-is-regexp')(INCLUDES), 'String .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined); } }); -},{"./_export":115,"./_fails-is-regexp":116,"./_string-context":181}],316:[function(require,module,exports){ +},{"./_export":116,"./_fails-is-regexp":117,"./_string-context":182}],317:[function(require,module,exports){ 'use strict'; // B.2.3.9 String.prototype.italics() require('./_string-html')('italics', function(createHTML){ @@ -50465,7 +51068,7 @@ require('./_string-html')('italics', function(createHTML){ return createHTML(this, 'i', '', ''); } }); -},{"./_string-html":182}],317:[function(require,module,exports){ +},{"./_string-html":183}],318:[function(require,module,exports){ 'use strict'; var $at = require('./_string-at')(true); @@ -50483,7 +51086,7 @@ require('./_iter-define')(String, 'String', function(iterated){ this._i += point.length; return {value: point, done: false}; }); -},{"./_iter-define":136,"./_string-at":180}],318:[function(require,module,exports){ +},{"./_iter-define":137,"./_string-at":181}],319:[function(require,module,exports){ 'use strict'; // B.2.3.10 String.prototype.link(url) require('./_string-html')('link', function(createHTML){ @@ -50491,7 +51094,7 @@ require('./_string-html')('link', function(createHTML){ return createHTML(this, 'a', 'href', url); } }); -},{"./_string-html":182}],319:[function(require,module,exports){ +},{"./_string-html":183}],320:[function(require,module,exports){ var $export = require('./_export') , toIObject = require('./_to-iobject') , toLength = require('./_to-length'); @@ -50510,14 +51113,14 @@ $export($export.S, 'String', { } return res.join(''); } }); -},{"./_export":115,"./_to-iobject":190,"./_to-length":191}],320:[function(require,module,exports){ +},{"./_export":116,"./_to-iobject":191,"./_to-length":192}],321:[function(require,module,exports){ var $export = require('./_export'); $export($export.P, 'String', { // 21.1.3.13 String.prototype.repeat(count) repeat: require('./_string-repeat') }); -},{"./_export":115,"./_string-repeat":184}],321:[function(require,module,exports){ +},{"./_export":116,"./_string-repeat":185}],322:[function(require,module,exports){ 'use strict'; // B.2.3.11 String.prototype.small() require('./_string-html')('small', function(createHTML){ @@ -50525,7 +51128,7 @@ require('./_string-html')('small', function(createHTML){ return createHTML(this, 'small', '', ''); } }); -},{"./_string-html":182}],322:[function(require,module,exports){ +},{"./_string-html":183}],323:[function(require,module,exports){ // 21.1.3.18 String.prototype.startsWith(searchString [, position ]) 'use strict'; var $export = require('./_export') @@ -50544,7 +51147,7 @@ $export($export.P + $export.F * require('./_fails-is-regexp')(STARTS_WITH), 'Str : that.slice(index, index + search.length) === search; } }); -},{"./_export":115,"./_fails-is-regexp":116,"./_string-context":181,"./_to-length":191}],323:[function(require,module,exports){ +},{"./_export":116,"./_fails-is-regexp":117,"./_string-context":182,"./_to-length":192}],324:[function(require,module,exports){ 'use strict'; // B.2.3.12 String.prototype.strike() require('./_string-html')('strike', function(createHTML){ @@ -50552,7 +51155,7 @@ require('./_string-html')('strike', function(createHTML){ return createHTML(this, 'strike', '', ''); } }); -},{"./_string-html":182}],324:[function(require,module,exports){ +},{"./_string-html":183}],325:[function(require,module,exports){ 'use strict'; // B.2.3.13 String.prototype.sub() require('./_string-html')('sub', function(createHTML){ @@ -50560,7 +51163,7 @@ require('./_string-html')('sub', function(createHTML){ return createHTML(this, 'sub', '', ''); } }); -},{"./_string-html":182}],325:[function(require,module,exports){ +},{"./_string-html":183}],326:[function(require,module,exports){ 'use strict'; // B.2.3.14 String.prototype.sup() require('./_string-html')('sup', function(createHTML){ @@ -50568,7 +51171,7 @@ require('./_string-html')('sup', function(createHTML){ return createHTML(this, 'sup', '', ''); } }); -},{"./_string-html":182}],326:[function(require,module,exports){ +},{"./_string-html":183}],327:[function(require,module,exports){ 'use strict'; // 21.1.3.25 String.prototype.trim() require('./_string-trim')('trim', function($trim){ @@ -50576,7 +51179,7 @@ require('./_string-trim')('trim', function($trim){ return $trim(this, 3); }; }); -},{"./_string-trim":185}],327:[function(require,module,exports){ +},{"./_string-trim":186}],328:[function(require,module,exports){ 'use strict'; // ECMAScript 6 symbols shim var global = require('./_global') @@ -50812,7 +51415,7 @@ setToStringTag($Symbol, 'Symbol'); setToStringTag(Math, 'Math', true); // 24.3.3 JSON[@@toStringTag] setToStringTag(global.JSON, 'JSON', true); -},{"./_an-object":90,"./_descriptors":111,"./_enum-keys":114,"./_export":115,"./_fails":117,"./_global":121,"./_has":122,"./_hide":123,"./_is-array":130,"./_keyof":140,"./_library":141,"./_meta":145,"./_object-create":149,"./_object-dp":150,"./_object-gopd":153,"./_object-gopn":155,"./_object-gopn-ext":154,"./_object-gops":156,"./_object-keys":159,"./_object-pie":160,"./_property-desc":168,"./_redefine":170,"./_set-to-string-tag":175,"./_shared":177,"./_to-iobject":190,"./_to-primitive":193,"./_uid":197,"./_wks":200,"./_wks-define":198,"./_wks-ext":199}],328:[function(require,module,exports){ +},{"./_an-object":91,"./_descriptors":112,"./_enum-keys":115,"./_export":116,"./_fails":118,"./_global":122,"./_has":123,"./_hide":124,"./_is-array":131,"./_keyof":141,"./_library":142,"./_meta":146,"./_object-create":150,"./_object-dp":151,"./_object-gopd":154,"./_object-gopn":156,"./_object-gopn-ext":155,"./_object-gops":157,"./_object-keys":160,"./_object-pie":161,"./_property-desc":169,"./_redefine":171,"./_set-to-string-tag":176,"./_shared":178,"./_to-iobject":191,"./_to-primitive":194,"./_uid":198,"./_wks":201,"./_wks-define":199,"./_wks-ext":200}],329:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $typed = require('./_typed') @@ -50860,66 +51463,66 @@ $export($export.P + $export.U + $export.F * require('./_fails')(function(){ }); require('./_set-species')(ARRAY_BUFFER); -},{"./_an-object":90,"./_export":115,"./_fails":117,"./_global":121,"./_is-object":132,"./_set-species":174,"./_species-constructor":178,"./_to-index":188,"./_to-length":191,"./_typed":196,"./_typed-buffer":195,"./_wks":200}],329:[function(require,module,exports){ +},{"./_an-object":91,"./_export":116,"./_fails":118,"./_global":122,"./_is-object":133,"./_set-species":175,"./_species-constructor":179,"./_to-index":189,"./_to-length":192,"./_typed":197,"./_typed-buffer":196,"./_wks":201}],330:[function(require,module,exports){ var $export = require('./_export'); $export($export.G + $export.W + $export.F * !require('./_typed').ABV, { DataView: require('./_typed-buffer').DataView }); -},{"./_export":115,"./_typed":196,"./_typed-buffer":195}],330:[function(require,module,exports){ +},{"./_export":116,"./_typed":197,"./_typed-buffer":196}],331:[function(require,module,exports){ require('./_typed-array')('Float32', 4, function(init){ return function Float32Array(data, byteOffset, length){ return init(this, data, byteOffset, length); }; }); -},{"./_typed-array":194}],331:[function(require,module,exports){ +},{"./_typed-array":195}],332:[function(require,module,exports){ require('./_typed-array')('Float64', 8, function(init){ return function Float64Array(data, byteOffset, length){ return init(this, data, byteOffset, length); }; }); -},{"./_typed-array":194}],332:[function(require,module,exports){ +},{"./_typed-array":195}],333:[function(require,module,exports){ require('./_typed-array')('Int16', 2, function(init){ return function Int16Array(data, byteOffset, length){ return init(this, data, byteOffset, length); }; }); -},{"./_typed-array":194}],333:[function(require,module,exports){ +},{"./_typed-array":195}],334:[function(require,module,exports){ require('./_typed-array')('Int32', 4, function(init){ return function Int32Array(data, byteOffset, length){ return init(this, data, byteOffset, length); }; }); -},{"./_typed-array":194}],334:[function(require,module,exports){ +},{"./_typed-array":195}],335:[function(require,module,exports){ require('./_typed-array')('Int8', 1, function(init){ return function Int8Array(data, byteOffset, length){ return init(this, data, byteOffset, length); }; }); -},{"./_typed-array":194}],335:[function(require,module,exports){ +},{"./_typed-array":195}],336:[function(require,module,exports){ require('./_typed-array')('Uint16', 2, function(init){ return function Uint16Array(data, byteOffset, length){ return init(this, data, byteOffset, length); }; }); -},{"./_typed-array":194}],336:[function(require,module,exports){ +},{"./_typed-array":195}],337:[function(require,module,exports){ require('./_typed-array')('Uint32', 4, function(init){ return function Uint32Array(data, byteOffset, length){ return init(this, data, byteOffset, length); }; }); -},{"./_typed-array":194}],337:[function(require,module,exports){ +},{"./_typed-array":195}],338:[function(require,module,exports){ require('./_typed-array')('Uint8', 1, function(init){ return function Uint8Array(data, byteOffset, length){ return init(this, data, byteOffset, length); }; }); -},{"./_typed-array":194}],338:[function(require,module,exports){ +},{"./_typed-array":195}],339:[function(require,module,exports){ require('./_typed-array')('Uint8', 1, function(init){ return function Uint8ClampedArray(data, byteOffset, length){ return init(this, data, byteOffset, length); }; }, true); -},{"./_typed-array":194}],339:[function(require,module,exports){ +},{"./_typed-array":195}],340:[function(require,module,exports){ 'use strict'; var each = require('./_array-methods')(0) , redefine = require('./_redefine') @@ -50977,7 +51580,7 @@ if(new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7){ }); }); } -},{"./_array-methods":95,"./_collection":105,"./_collection-weak":104,"./_has":122,"./_is-object":132,"./_meta":145,"./_object-assign":148,"./_redefine":170}],340:[function(require,module,exports){ +},{"./_array-methods":96,"./_collection":106,"./_collection-weak":105,"./_has":123,"./_is-object":133,"./_meta":146,"./_object-assign":149,"./_redefine":171}],341:[function(require,module,exports){ 'use strict'; var weak = require('./_collection-weak'); @@ -50990,7 +51593,7 @@ require('./_collection')('WeakSet', function(get){ return weak.def(this, value, true); } }, weak, false, true); -},{"./_collection":105,"./_collection-weak":104}],341:[function(require,module,exports){ +},{"./_collection":106,"./_collection-weak":105}],342:[function(require,module,exports){ 'use strict'; // https://github.com/tc39/Array.prototype.includes var $export = require('./_export') @@ -51003,7 +51606,7 @@ $export($export.P, 'Array', { }); require('./_add-to-unscopables')('includes'); -},{"./_add-to-unscopables":88,"./_array-includes":94,"./_export":115}],342:[function(require,module,exports){ +},{"./_add-to-unscopables":89,"./_array-includes":95,"./_export":116}],343:[function(require,module,exports){ // https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask var $export = require('./_export') , microtask = require('./_microtask')() @@ -51016,7 +51619,7 @@ $export($export.G, { microtask(domain ? domain.bind(fn) : fn); } }); -},{"./_cof":101,"./_export":115,"./_global":121,"./_microtask":147}],343:[function(require,module,exports){ +},{"./_cof":102,"./_export":116,"./_global":122,"./_microtask":148}],344:[function(require,module,exports){ // https://github.com/ljharb/proposal-is-error var $export = require('./_export') , cof = require('./_cof'); @@ -51026,12 +51629,12 @@ $export($export.S, 'Error', { return cof(it) === 'Error'; } }); -},{"./_cof":101,"./_export":115}],344:[function(require,module,exports){ +},{"./_cof":102,"./_export":116}],345:[function(require,module,exports){ // https://github.com/DavidBruant/Map-Set.prototype.toJSON var $export = require('./_export'); $export($export.P + $export.R, 'Map', {toJSON: require('./_collection-to-json')('Map')}); -},{"./_collection-to-json":103,"./_export":115}],345:[function(require,module,exports){ +},{"./_collection-to-json":104,"./_export":116}],346:[function(require,module,exports){ // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 var $export = require('./_export'); @@ -51043,7 +51646,7 @@ $export($export.S, 'Math', { return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0; } }); -},{"./_export":115}],346:[function(require,module,exports){ +},{"./_export":116}],347:[function(require,module,exports){ // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 var $export = require('./_export'); @@ -51060,7 +51663,7 @@ $export($export.S, 'Math', { return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16); } }); -},{"./_export":115}],347:[function(require,module,exports){ +},{"./_export":116}],348:[function(require,module,exports){ // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 var $export = require('./_export'); @@ -51072,7 +51675,7 @@ $export($export.S, 'Math', { return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0; } }); -},{"./_export":115}],348:[function(require,module,exports){ +},{"./_export":116}],349:[function(require,module,exports){ // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 var $export = require('./_export'); @@ -51089,7 +51692,7 @@ $export($export.S, 'Math', { return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16); } }); -},{"./_export":115}],349:[function(require,module,exports){ +},{"./_export":116}],350:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , toObject = require('./_to-object') @@ -51102,7 +51705,7 @@ require('./_descriptors') && $export($export.P + require('./_object-forced-pam') $defineProperty.f(toObject(this), P, {get: aFunction(getter), enumerable: true, configurable: true}); } }); -},{"./_a-function":86,"./_descriptors":111,"./_export":115,"./_object-dp":150,"./_object-forced-pam":152,"./_to-object":192}],350:[function(require,module,exports){ +},{"./_a-function":87,"./_descriptors":112,"./_export":116,"./_object-dp":151,"./_object-forced-pam":153,"./_to-object":193}],351:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , toObject = require('./_to-object') @@ -51115,7 +51718,7 @@ require('./_descriptors') && $export($export.P + require('./_object-forced-pam') $defineProperty.f(toObject(this), P, {set: aFunction(setter), enumerable: true, configurable: true}); } }); -},{"./_a-function":86,"./_descriptors":111,"./_export":115,"./_object-dp":150,"./_object-forced-pam":152,"./_to-object":192}],351:[function(require,module,exports){ +},{"./_a-function":87,"./_descriptors":112,"./_export":116,"./_object-dp":151,"./_object-forced-pam":153,"./_to-object":193}],352:[function(require,module,exports){ // https://github.com/tc39/proposal-object-values-entries var $export = require('./_export') , $entries = require('./_object-to-array')(true); @@ -51125,7 +51728,7 @@ $export($export.S, 'Object', { return $entries(it); } }); -},{"./_export":115,"./_object-to-array":162}],352:[function(require,module,exports){ +},{"./_export":116,"./_object-to-array":163}],353:[function(require,module,exports){ // https://github.com/tc39/proposal-object-getownpropertydescriptors var $export = require('./_export') , ownKeys = require('./_own-keys') @@ -51145,7 +51748,7 @@ $export($export.S, 'Object', { return result; } }); -},{"./_create-property":107,"./_export":115,"./_object-gopd":153,"./_own-keys":163,"./_to-iobject":190}],353:[function(require,module,exports){ +},{"./_create-property":108,"./_export":116,"./_object-gopd":154,"./_own-keys":164,"./_to-iobject":191}],354:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , toObject = require('./_to-object') @@ -51164,7 +51767,7 @@ require('./_descriptors') && $export($export.P + require('./_object-forced-pam') } while(O = getPrototypeOf(O)); } }); -},{"./_descriptors":111,"./_export":115,"./_object-forced-pam":152,"./_object-gopd":153,"./_object-gpo":157,"./_to-object":192,"./_to-primitive":193}],354:[function(require,module,exports){ +},{"./_descriptors":112,"./_export":116,"./_object-forced-pam":153,"./_object-gopd":154,"./_object-gpo":158,"./_to-object":193,"./_to-primitive":194}],355:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , toObject = require('./_to-object') @@ -51183,7 +51786,7 @@ require('./_descriptors') && $export($export.P + require('./_object-forced-pam') } while(O = getPrototypeOf(O)); } }); -},{"./_descriptors":111,"./_export":115,"./_object-forced-pam":152,"./_object-gopd":153,"./_object-gpo":157,"./_to-object":192,"./_to-primitive":193}],355:[function(require,module,exports){ +},{"./_descriptors":112,"./_export":116,"./_object-forced-pam":153,"./_object-gopd":154,"./_object-gpo":158,"./_to-object":193,"./_to-primitive":194}],356:[function(require,module,exports){ // https://github.com/tc39/proposal-object-values-entries var $export = require('./_export') , $values = require('./_object-to-array')(false); @@ -51193,7 +51796,7 @@ $export($export.S, 'Object', { return $values(it); } }); -},{"./_export":115,"./_object-to-array":162}],356:[function(require,module,exports){ +},{"./_export":116,"./_object-to-array":163}],357:[function(require,module,exports){ 'use strict'; // https://github.com/zenparsing/es-observable var $export = require('./_export') @@ -51393,7 +51996,7 @@ hide($Observable.prototype, OBSERVABLE, function(){ return this; }); $export($export.G, {Observable: $Observable}); require('./_set-species')('Observable'); -},{"./_a-function":86,"./_an-instance":89,"./_an-object":90,"./_core":106,"./_export":115,"./_for-of":120,"./_global":121,"./_hide":123,"./_microtask":147,"./_redefine-all":169,"./_set-species":174,"./_wks":200}],357:[function(require,module,exports){ +},{"./_a-function":87,"./_an-instance":90,"./_an-object":91,"./_core":107,"./_export":116,"./_for-of":121,"./_global":122,"./_hide":124,"./_microtask":148,"./_redefine-all":170,"./_set-species":175,"./_wks":201}],358:[function(require,module,exports){ var metadata = require('./_metadata') , anObject = require('./_an-object') , toMetaKey = metadata.key @@ -51402,7 +52005,7 @@ var metadata = require('./_metadata') metadata.exp({defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey){ ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey)); }}); -},{"./_an-object":90,"./_metadata":146}],358:[function(require,module,exports){ +},{"./_an-object":91,"./_metadata":147}],359:[function(require,module,exports){ var metadata = require('./_metadata') , anObject = require('./_an-object') , toMetaKey = metadata.key @@ -51418,7 +52021,7 @@ metadata.exp({deleteMetadata: function deleteMetadata(metadataKey, target /*, ta targetMetadata['delete'](targetKey); return !!targetMetadata.size || store['delete'](target); }}); -},{"./_an-object":90,"./_metadata":146}],359:[function(require,module,exports){ +},{"./_an-object":91,"./_metadata":147}],360:[function(require,module,exports){ var Set = require('./es6.set') , from = require('./_array-from-iterable') , metadata = require('./_metadata') @@ -51438,7 +52041,7 @@ var ordinaryMetadataKeys = function(O, P){ metadata.exp({getMetadataKeys: function getMetadataKeys(target /*, targetKey */){ return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); }}); -},{"./_an-object":90,"./_array-from-iterable":93,"./_metadata":146,"./_object-gpo":157,"./es6.set":304}],360:[function(require,module,exports){ +},{"./_an-object":91,"./_array-from-iterable":94,"./_metadata":147,"./_object-gpo":158,"./es6.set":305}],361:[function(require,module,exports){ var metadata = require('./_metadata') , anObject = require('./_an-object') , getPrototypeOf = require('./_object-gpo') @@ -51456,7 +52059,7 @@ var ordinaryGetMetadata = function(MetadataKey, O, P){ metadata.exp({getMetadata: function getMetadata(metadataKey, target /*, targetKey */){ return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); }}); -},{"./_an-object":90,"./_metadata":146,"./_object-gpo":157}],361:[function(require,module,exports){ +},{"./_an-object":91,"./_metadata":147,"./_object-gpo":158}],362:[function(require,module,exports){ var metadata = require('./_metadata') , anObject = require('./_an-object') , ordinaryOwnMetadataKeys = metadata.keys @@ -51465,7 +52068,7 @@ var metadata = require('./_metadata') metadata.exp({getOwnMetadataKeys: function getOwnMetadataKeys(target /*, targetKey */){ return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); }}); -},{"./_an-object":90,"./_metadata":146}],362:[function(require,module,exports){ +},{"./_an-object":91,"./_metadata":147}],363:[function(require,module,exports){ var metadata = require('./_metadata') , anObject = require('./_an-object') , ordinaryGetOwnMetadata = metadata.get @@ -51475,7 +52078,7 @@ metadata.exp({getOwnMetadata: function getOwnMetadata(metadataKey, target /*, ta return ordinaryGetOwnMetadata(metadataKey, anObject(target) , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); }}); -},{"./_an-object":90,"./_metadata":146}],363:[function(require,module,exports){ +},{"./_an-object":91,"./_metadata":147}],364:[function(require,module,exports){ var metadata = require('./_metadata') , anObject = require('./_an-object') , getPrototypeOf = require('./_object-gpo') @@ -51492,7 +52095,7 @@ var ordinaryHasMetadata = function(MetadataKey, O, P){ metadata.exp({hasMetadata: function hasMetadata(metadataKey, target /*, targetKey */){ return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); }}); -},{"./_an-object":90,"./_metadata":146,"./_object-gpo":157}],364:[function(require,module,exports){ +},{"./_an-object":91,"./_metadata":147,"./_object-gpo":158}],365:[function(require,module,exports){ var metadata = require('./_metadata') , anObject = require('./_an-object') , ordinaryHasOwnMetadata = metadata.has @@ -51502,7 +52105,7 @@ metadata.exp({hasOwnMetadata: function hasOwnMetadata(metadataKey, target /*, ta return ordinaryHasOwnMetadata(metadataKey, anObject(target) , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); }}); -},{"./_an-object":90,"./_metadata":146}],365:[function(require,module,exports){ +},{"./_an-object":91,"./_metadata":147}],366:[function(require,module,exports){ var metadata = require('./_metadata') , anObject = require('./_an-object') , aFunction = require('./_a-function') @@ -51518,12 +52121,12 @@ metadata.exp({metadata: function metadata(metadataKey, metadataValue){ ); }; }}); -},{"./_a-function":86,"./_an-object":90,"./_metadata":146}],366:[function(require,module,exports){ +},{"./_a-function":87,"./_an-object":91,"./_metadata":147}],367:[function(require,module,exports){ // https://github.com/DavidBruant/Map-Set.prototype.toJSON var $export = require('./_export'); $export($export.P + $export.R, 'Set', {toJSON: require('./_collection-to-json')('Set')}); -},{"./_collection-to-json":103,"./_export":115}],367:[function(require,module,exports){ +},{"./_collection-to-json":104,"./_export":116}],368:[function(require,module,exports){ 'use strict'; // https://github.com/mathiasbynens/String.prototype.at var $export = require('./_export') @@ -51534,7 +52137,7 @@ $export($export.P, 'String', { return $at(this, pos); } }); -},{"./_export":115,"./_string-at":180}],368:[function(require,module,exports){ +},{"./_export":116,"./_string-at":181}],369:[function(require,module,exports){ 'use strict'; // https://tc39.github.io/String.prototype.matchAll/ var $export = require('./_export') @@ -51565,7 +52168,7 @@ $export($export.P, 'String', { return new $RegExpStringIterator(rx, S); } }); -},{"./_defined":110,"./_export":115,"./_flags":119,"./_is-regexp":133,"./_iter-create":135,"./_to-length":191}],369:[function(require,module,exports){ +},{"./_defined":111,"./_export":116,"./_flags":120,"./_is-regexp":134,"./_iter-create":136,"./_to-length":192}],370:[function(require,module,exports){ 'use strict'; // https://github.com/tc39/proposal-string-pad-start-end var $export = require('./_export') @@ -51576,7 +52179,7 @@ $export($export.P, 'String', { return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false); } }); -},{"./_export":115,"./_string-pad":183}],370:[function(require,module,exports){ +},{"./_export":116,"./_string-pad":184}],371:[function(require,module,exports){ 'use strict'; // https://github.com/tc39/proposal-string-pad-start-end var $export = require('./_export') @@ -51587,7 +52190,7 @@ $export($export.P, 'String', { return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true); } }); -},{"./_export":115,"./_string-pad":183}],371:[function(require,module,exports){ +},{"./_export":116,"./_string-pad":184}],372:[function(require,module,exports){ 'use strict'; // https://github.com/sebmarkbage/ecmascript-string-left-right-trim require('./_string-trim')('trimLeft', function($trim){ @@ -51595,7 +52198,7 @@ require('./_string-trim')('trimLeft', function($trim){ return $trim(this, 1); }; }, 'trimStart'); -},{"./_string-trim":185}],372:[function(require,module,exports){ +},{"./_string-trim":186}],373:[function(require,module,exports){ 'use strict'; // https://github.com/sebmarkbage/ecmascript-string-left-right-trim require('./_string-trim')('trimRight', function($trim){ @@ -51603,16 +52206,16 @@ require('./_string-trim')('trimRight', function($trim){ return $trim(this, 2); }; }, 'trimEnd'); -},{"./_string-trim":185}],373:[function(require,module,exports){ +},{"./_string-trim":186}],374:[function(require,module,exports){ require('./_wks-define')('asyncIterator'); -},{"./_wks-define":198}],374:[function(require,module,exports){ +},{"./_wks-define":199}],375:[function(require,module,exports){ require('./_wks-define')('observable'); -},{"./_wks-define":198}],375:[function(require,module,exports){ +},{"./_wks-define":199}],376:[function(require,module,exports){ // https://github.com/ljharb/proposal-global var $export = require('./_export'); $export($export.S, 'System', {global: require('./_global')}); -},{"./_export":115,"./_global":121}],376:[function(require,module,exports){ +},{"./_export":116,"./_global":122}],377:[function(require,module,exports){ var $iterators = require('./es6.array.iterator') , redefine = require('./_redefine') , global = require('./_global') @@ -51635,14 +52238,14 @@ for(var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList' for(key in $iterators)if(!proto[key])redefine(proto, key, $iterators[key], true); } } -},{"./_global":121,"./_hide":123,"./_iterators":139,"./_redefine":170,"./_wks":200,"./es6.array.iterator":214}],377:[function(require,module,exports){ +},{"./_global":122,"./_hide":124,"./_iterators":140,"./_redefine":171,"./_wks":201,"./es6.array.iterator":215}],378:[function(require,module,exports){ var $export = require('./_export') , $task = require('./_task'); $export($export.G + $export.B, { setImmediate: $task.set, clearImmediate: $task.clear }); -},{"./_export":115,"./_task":187}],378:[function(require,module,exports){ +},{"./_export":116,"./_task":188}],379:[function(require,module,exports){ // ie9- setTimeout & setInterval additional parameters fix var global = require('./_global') , $export = require('./_export') @@ -51663,7 +52266,7 @@ $export($export.G + $export.B + $export.F * MSIE, { setTimeout: wrap(global.setTimeout), setInterval: wrap(global.setInterval) }); -},{"./_export":115,"./_global":121,"./_invoke":127,"./_partial":166}],379:[function(require,module,exports){ +},{"./_export":116,"./_global":122,"./_invoke":128,"./_partial":167}],380:[function(require,module,exports){ require('./modules/es6.symbol'); require('./modules/es6.object.create'); require('./modules/es6.object.define-property'); @@ -51840,7 +52443,7 @@ require('./modules/web.timers'); require('./modules/web.immediate'); require('./modules/web.dom.iterable'); module.exports = require('./modules/_core'); -},{"./modules/_core":106,"./modules/es6.array.copy-within":204,"./modules/es6.array.every":205,"./modules/es6.array.fill":206,"./modules/es6.array.filter":207,"./modules/es6.array.find":209,"./modules/es6.array.find-index":208,"./modules/es6.array.for-each":210,"./modules/es6.array.from":211,"./modules/es6.array.index-of":212,"./modules/es6.array.is-array":213,"./modules/es6.array.iterator":214,"./modules/es6.array.join":215,"./modules/es6.array.last-index-of":216,"./modules/es6.array.map":217,"./modules/es6.array.of":218,"./modules/es6.array.reduce":220,"./modules/es6.array.reduce-right":219,"./modules/es6.array.slice":221,"./modules/es6.array.some":222,"./modules/es6.array.sort":223,"./modules/es6.array.species":224,"./modules/es6.date.now":225,"./modules/es6.date.to-iso-string":226,"./modules/es6.date.to-json":227,"./modules/es6.date.to-primitive":228,"./modules/es6.date.to-string":229,"./modules/es6.function.bind":230,"./modules/es6.function.has-instance":231,"./modules/es6.function.name":232,"./modules/es6.map":233,"./modules/es6.math.acosh":234,"./modules/es6.math.asinh":235,"./modules/es6.math.atanh":236,"./modules/es6.math.cbrt":237,"./modules/es6.math.clz32":238,"./modules/es6.math.cosh":239,"./modules/es6.math.expm1":240,"./modules/es6.math.fround":241,"./modules/es6.math.hypot":242,"./modules/es6.math.imul":243,"./modules/es6.math.log10":244,"./modules/es6.math.log1p":245,"./modules/es6.math.log2":246,"./modules/es6.math.sign":247,"./modules/es6.math.sinh":248,"./modules/es6.math.tanh":249,"./modules/es6.math.trunc":250,"./modules/es6.number.constructor":251,"./modules/es6.number.epsilon":252,"./modules/es6.number.is-finite":253,"./modules/es6.number.is-integer":254,"./modules/es6.number.is-nan":255,"./modules/es6.number.is-safe-integer":256,"./modules/es6.number.max-safe-integer":257,"./modules/es6.number.min-safe-integer":258,"./modules/es6.number.parse-float":259,"./modules/es6.number.parse-int":260,"./modules/es6.number.to-fixed":261,"./modules/es6.number.to-precision":262,"./modules/es6.object.assign":263,"./modules/es6.object.create":264,"./modules/es6.object.define-properties":265,"./modules/es6.object.define-property":266,"./modules/es6.object.freeze":267,"./modules/es6.object.get-own-property-descriptor":268,"./modules/es6.object.get-own-property-names":269,"./modules/es6.object.get-prototype-of":270,"./modules/es6.object.is":274,"./modules/es6.object.is-extensible":271,"./modules/es6.object.is-frozen":272,"./modules/es6.object.is-sealed":273,"./modules/es6.object.keys":275,"./modules/es6.object.prevent-extensions":276,"./modules/es6.object.seal":277,"./modules/es6.object.set-prototype-of":278,"./modules/es6.object.to-string":279,"./modules/es6.parse-float":280,"./modules/es6.parse-int":281,"./modules/es6.promise":282,"./modules/es6.reflect.apply":283,"./modules/es6.reflect.construct":284,"./modules/es6.reflect.define-property":285,"./modules/es6.reflect.delete-property":286,"./modules/es6.reflect.enumerate":287,"./modules/es6.reflect.get":290,"./modules/es6.reflect.get-own-property-descriptor":288,"./modules/es6.reflect.get-prototype-of":289,"./modules/es6.reflect.has":291,"./modules/es6.reflect.is-extensible":292,"./modules/es6.reflect.own-keys":293,"./modules/es6.reflect.prevent-extensions":294,"./modules/es6.reflect.set":296,"./modules/es6.reflect.set-prototype-of":295,"./modules/es6.regexp.constructor":297,"./modules/es6.regexp.flags":298,"./modules/es6.regexp.match":299,"./modules/es6.regexp.replace":300,"./modules/es6.regexp.search":301,"./modules/es6.regexp.split":302,"./modules/es6.regexp.to-string":303,"./modules/es6.set":304,"./modules/es6.string.anchor":305,"./modules/es6.string.big":306,"./modules/es6.string.blink":307,"./modules/es6.string.bold":308,"./modules/es6.string.code-point-at":309,"./modules/es6.string.ends-with":310,"./modules/es6.string.fixed":311,"./modules/es6.string.fontcolor":312,"./modules/es6.string.fontsize":313,"./modules/es6.string.from-code-point":314,"./modules/es6.string.includes":315,"./modules/es6.string.italics":316,"./modules/es6.string.iterator":317,"./modules/es6.string.link":318,"./modules/es6.string.raw":319,"./modules/es6.string.repeat":320,"./modules/es6.string.small":321,"./modules/es6.string.starts-with":322,"./modules/es6.string.strike":323,"./modules/es6.string.sub":324,"./modules/es6.string.sup":325,"./modules/es6.string.trim":326,"./modules/es6.symbol":327,"./modules/es6.typed.array-buffer":328,"./modules/es6.typed.data-view":329,"./modules/es6.typed.float32-array":330,"./modules/es6.typed.float64-array":331,"./modules/es6.typed.int16-array":332,"./modules/es6.typed.int32-array":333,"./modules/es6.typed.int8-array":334,"./modules/es6.typed.uint16-array":335,"./modules/es6.typed.uint32-array":336,"./modules/es6.typed.uint8-array":337,"./modules/es6.typed.uint8-clamped-array":338,"./modules/es6.weak-map":339,"./modules/es6.weak-set":340,"./modules/es7.array.includes":341,"./modules/es7.asap":342,"./modules/es7.error.is-error":343,"./modules/es7.map.to-json":344,"./modules/es7.math.iaddh":345,"./modules/es7.math.imulh":346,"./modules/es7.math.isubh":347,"./modules/es7.math.umulh":348,"./modules/es7.object.define-getter":349,"./modules/es7.object.define-setter":350,"./modules/es7.object.entries":351,"./modules/es7.object.get-own-property-descriptors":352,"./modules/es7.object.lookup-getter":353,"./modules/es7.object.lookup-setter":354,"./modules/es7.object.values":355,"./modules/es7.observable":356,"./modules/es7.reflect.define-metadata":357,"./modules/es7.reflect.delete-metadata":358,"./modules/es7.reflect.get-metadata":360,"./modules/es7.reflect.get-metadata-keys":359,"./modules/es7.reflect.get-own-metadata":362,"./modules/es7.reflect.get-own-metadata-keys":361,"./modules/es7.reflect.has-metadata":363,"./modules/es7.reflect.has-own-metadata":364,"./modules/es7.reflect.metadata":365,"./modules/es7.set.to-json":366,"./modules/es7.string.at":367,"./modules/es7.string.match-all":368,"./modules/es7.string.pad-end":369,"./modules/es7.string.pad-start":370,"./modules/es7.string.trim-left":371,"./modules/es7.string.trim-right":372,"./modules/es7.symbol.async-iterator":373,"./modules/es7.symbol.observable":374,"./modules/es7.system.global":375,"./modules/web.dom.iterable":376,"./modules/web.immediate":377,"./modules/web.timers":378}],380:[function(require,module,exports){ +},{"./modules/_core":107,"./modules/es6.array.copy-within":205,"./modules/es6.array.every":206,"./modules/es6.array.fill":207,"./modules/es6.array.filter":208,"./modules/es6.array.find":210,"./modules/es6.array.find-index":209,"./modules/es6.array.for-each":211,"./modules/es6.array.from":212,"./modules/es6.array.index-of":213,"./modules/es6.array.is-array":214,"./modules/es6.array.iterator":215,"./modules/es6.array.join":216,"./modules/es6.array.last-index-of":217,"./modules/es6.array.map":218,"./modules/es6.array.of":219,"./modules/es6.array.reduce":221,"./modules/es6.array.reduce-right":220,"./modules/es6.array.slice":222,"./modules/es6.array.some":223,"./modules/es6.array.sort":224,"./modules/es6.array.species":225,"./modules/es6.date.now":226,"./modules/es6.date.to-iso-string":227,"./modules/es6.date.to-json":228,"./modules/es6.date.to-primitive":229,"./modules/es6.date.to-string":230,"./modules/es6.function.bind":231,"./modules/es6.function.has-instance":232,"./modules/es6.function.name":233,"./modules/es6.map":234,"./modules/es6.math.acosh":235,"./modules/es6.math.asinh":236,"./modules/es6.math.atanh":237,"./modules/es6.math.cbrt":238,"./modules/es6.math.clz32":239,"./modules/es6.math.cosh":240,"./modules/es6.math.expm1":241,"./modules/es6.math.fround":242,"./modules/es6.math.hypot":243,"./modules/es6.math.imul":244,"./modules/es6.math.log10":245,"./modules/es6.math.log1p":246,"./modules/es6.math.log2":247,"./modules/es6.math.sign":248,"./modules/es6.math.sinh":249,"./modules/es6.math.tanh":250,"./modules/es6.math.trunc":251,"./modules/es6.number.constructor":252,"./modules/es6.number.epsilon":253,"./modules/es6.number.is-finite":254,"./modules/es6.number.is-integer":255,"./modules/es6.number.is-nan":256,"./modules/es6.number.is-safe-integer":257,"./modules/es6.number.max-safe-integer":258,"./modules/es6.number.min-safe-integer":259,"./modules/es6.number.parse-float":260,"./modules/es6.number.parse-int":261,"./modules/es6.number.to-fixed":262,"./modules/es6.number.to-precision":263,"./modules/es6.object.assign":264,"./modules/es6.object.create":265,"./modules/es6.object.define-properties":266,"./modules/es6.object.define-property":267,"./modules/es6.object.freeze":268,"./modules/es6.object.get-own-property-descriptor":269,"./modules/es6.object.get-own-property-names":270,"./modules/es6.object.get-prototype-of":271,"./modules/es6.object.is":275,"./modules/es6.object.is-extensible":272,"./modules/es6.object.is-frozen":273,"./modules/es6.object.is-sealed":274,"./modules/es6.object.keys":276,"./modules/es6.object.prevent-extensions":277,"./modules/es6.object.seal":278,"./modules/es6.object.set-prototype-of":279,"./modules/es6.object.to-string":280,"./modules/es6.parse-float":281,"./modules/es6.parse-int":282,"./modules/es6.promise":283,"./modules/es6.reflect.apply":284,"./modules/es6.reflect.construct":285,"./modules/es6.reflect.define-property":286,"./modules/es6.reflect.delete-property":287,"./modules/es6.reflect.enumerate":288,"./modules/es6.reflect.get":291,"./modules/es6.reflect.get-own-property-descriptor":289,"./modules/es6.reflect.get-prototype-of":290,"./modules/es6.reflect.has":292,"./modules/es6.reflect.is-extensible":293,"./modules/es6.reflect.own-keys":294,"./modules/es6.reflect.prevent-extensions":295,"./modules/es6.reflect.set":297,"./modules/es6.reflect.set-prototype-of":296,"./modules/es6.regexp.constructor":298,"./modules/es6.regexp.flags":299,"./modules/es6.regexp.match":300,"./modules/es6.regexp.replace":301,"./modules/es6.regexp.search":302,"./modules/es6.regexp.split":303,"./modules/es6.regexp.to-string":304,"./modules/es6.set":305,"./modules/es6.string.anchor":306,"./modules/es6.string.big":307,"./modules/es6.string.blink":308,"./modules/es6.string.bold":309,"./modules/es6.string.code-point-at":310,"./modules/es6.string.ends-with":311,"./modules/es6.string.fixed":312,"./modules/es6.string.fontcolor":313,"./modules/es6.string.fontsize":314,"./modules/es6.string.from-code-point":315,"./modules/es6.string.includes":316,"./modules/es6.string.italics":317,"./modules/es6.string.iterator":318,"./modules/es6.string.link":319,"./modules/es6.string.raw":320,"./modules/es6.string.repeat":321,"./modules/es6.string.small":322,"./modules/es6.string.starts-with":323,"./modules/es6.string.strike":324,"./modules/es6.string.sub":325,"./modules/es6.string.sup":326,"./modules/es6.string.trim":327,"./modules/es6.symbol":328,"./modules/es6.typed.array-buffer":329,"./modules/es6.typed.data-view":330,"./modules/es6.typed.float32-array":331,"./modules/es6.typed.float64-array":332,"./modules/es6.typed.int16-array":333,"./modules/es6.typed.int32-array":334,"./modules/es6.typed.int8-array":335,"./modules/es6.typed.uint16-array":336,"./modules/es6.typed.uint32-array":337,"./modules/es6.typed.uint8-array":338,"./modules/es6.typed.uint8-clamped-array":339,"./modules/es6.weak-map":340,"./modules/es6.weak-set":341,"./modules/es7.array.includes":342,"./modules/es7.asap":343,"./modules/es7.error.is-error":344,"./modules/es7.map.to-json":345,"./modules/es7.math.iaddh":346,"./modules/es7.math.imulh":347,"./modules/es7.math.isubh":348,"./modules/es7.math.umulh":349,"./modules/es7.object.define-getter":350,"./modules/es7.object.define-setter":351,"./modules/es7.object.entries":352,"./modules/es7.object.get-own-property-descriptors":353,"./modules/es7.object.lookup-getter":354,"./modules/es7.object.lookup-setter":355,"./modules/es7.object.values":356,"./modules/es7.observable":357,"./modules/es7.reflect.define-metadata":358,"./modules/es7.reflect.delete-metadata":359,"./modules/es7.reflect.get-metadata":361,"./modules/es7.reflect.get-metadata-keys":360,"./modules/es7.reflect.get-own-metadata":363,"./modules/es7.reflect.get-own-metadata-keys":362,"./modules/es7.reflect.has-metadata":364,"./modules/es7.reflect.has-own-metadata":365,"./modules/es7.reflect.metadata":366,"./modules/es7.set.to-json":367,"./modules/es7.string.at":368,"./modules/es7.string.match-all":369,"./modules/es7.string.pad-end":370,"./modules/es7.string.pad-start":371,"./modules/es7.string.trim-left":372,"./modules/es7.string.trim-right":373,"./modules/es7.symbol.async-iterator":374,"./modules/es7.symbol.observable":375,"./modules/es7.system.global":376,"./modules/web.dom.iterable":377,"./modules/web.immediate":378,"./modules/web.timers":379}],381:[function(require,module,exports){ (function (Buffer){ // Copyright Joyent, Inc. and other Node contributors. // @@ -51951,7 +52554,7 @@ function objectToString(o) { } }).call(this,{"isBuffer":require("../../is-buffer/index.js")}) -},{"../../is-buffer/index.js":429}],381:[function(require,module,exports){ +},{"../../is-buffer/index.js":430}],382:[function(require,module,exports){ (function (Buffer){ var elliptic = require('elliptic'); var BN = require('bn.js'); @@ -52077,7 +52680,7 @@ function formatReturnValue(bn, enc, len) { } }).call(this,require("buffer").Buffer) -},{"bn.js":53,"buffer":83,"elliptic":397}],382:[function(require,module,exports){ +},{"bn.js":54,"buffer":84,"elliptic":398}],383:[function(require,module,exports){ (function (Buffer){ 'use strict'; var inherits = require('inherits') @@ -52133,7 +52736,7 @@ module.exports = function createHash (alg) { } }).call(this,require("buffer").Buffer) -},{"./md5":384,"buffer":83,"cipher-base":84,"inherits":428,"ripemd160":461,"sha.js":470}],383:[function(require,module,exports){ +},{"./md5":385,"buffer":84,"cipher-base":85,"inherits":429,"ripemd160":461,"sha.js":470}],384:[function(require,module,exports){ (function (Buffer){ 'use strict'; var intSize = 4; @@ -52170,7 +52773,7 @@ function hash(buf, fn, hashSize, bigEndian) { } exports.hash = hash; }).call(this,require("buffer").Buffer) -},{"buffer":83}],384:[function(require,module,exports){ +},{"buffer":84}],385:[function(require,module,exports){ 'use strict'; /* * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message @@ -52327,7 +52930,7 @@ function bit_rol(num, cnt) module.exports = function md5(buf) { return helpers.hash(buf, core_md5, 16); }; -},{"./helpers":383}],385:[function(require,module,exports){ +},{"./helpers":384}],386:[function(require,module,exports){ (function (Buffer){ 'use strict'; var createHash = require('create-hash/browser'); @@ -52399,7 +53002,7 @@ module.exports = function createHmac(alg, key) { } }).call(this,require("buffer").Buffer) -},{"buffer":83,"create-hash/browser":382,"inherits":428,"stream":477}],386:[function(require,module,exports){ +},{"buffer":84,"create-hash/browser":383,"inherits":429,"stream":477}],387:[function(require,module,exports){ 'use strict' exports.randomBytes = exports.rng = exports.pseudoRandomBytes = exports.prng = require('randombytes') @@ -52478,7 +53081,7 @@ var publicEncrypt = require('public-encrypt') } }) -},{"browserify-cipher":71,"browserify-sign":77,"browserify-sign/algos":76,"create-ecdh":381,"create-hash":382,"create-hmac":385,"diffie-hellman":393,"pbkdf2":440,"public-encrypt":443,"randombytes":449}],387:[function(require,module,exports){ +},{"browserify-cipher":72,"browserify-sign":78,"browserify-sign/algos":77,"create-ecdh":382,"create-hash":383,"create-hmac":386,"diffie-hellman":394,"pbkdf2":441,"public-encrypt":444,"randombytes":450}],388:[function(require,module,exports){ 'use strict'; exports.utils = require('./des/utils'); @@ -52487,7 +53090,7 @@ exports.DES = require('./des/des'); exports.CBC = require('./des/cbc'); exports.EDE = require('./des/ede'); -},{"./des/cbc":388,"./des/cipher":389,"./des/des":390,"./des/ede":391,"./des/utils":392}],388:[function(require,module,exports){ +},{"./des/cbc":389,"./des/cipher":390,"./des/des":391,"./des/ede":392,"./des/utils":393}],389:[function(require,module,exports){ 'use strict'; var assert = require('minimalistic-assert'); @@ -52554,7 +53157,7 @@ proto._update = function _update(inp, inOff, out, outOff) { } }; -},{"inherits":428,"minimalistic-assert":435}],389:[function(require,module,exports){ +},{"inherits":429,"minimalistic-assert":436}],390:[function(require,module,exports){ 'use strict'; var assert = require('minimalistic-assert'); @@ -52697,7 +53300,7 @@ Cipher.prototype._finalDecrypt = function _finalDecrypt() { return this._unpad(out); }; -},{"minimalistic-assert":435}],390:[function(require,module,exports){ +},{"minimalistic-assert":436}],391:[function(require,module,exports){ 'use strict'; var assert = require('minimalistic-assert'); @@ -52842,7 +53445,7 @@ DES.prototype._decrypt = function _decrypt(state, lStart, rStart, out, off) { utils.rip(l, r, out, off); }; -},{"../des":387,"inherits":428,"minimalistic-assert":435}],391:[function(require,module,exports){ +},{"../des":388,"inherits":429,"minimalistic-assert":436}],392:[function(require,module,exports){ 'use strict'; var assert = require('minimalistic-assert'); @@ -52899,7 +53502,7 @@ EDE.prototype._update = function _update(inp, inOff, out, outOff) { EDE.prototype._pad = DES.prototype._pad; EDE.prototype._unpad = DES.prototype._unpad; -},{"../des":387,"inherits":428,"minimalistic-assert":435}],392:[function(require,module,exports){ +},{"../des":388,"inherits":429,"minimalistic-assert":436}],393:[function(require,module,exports){ 'use strict'; exports.readUInt32BE = function readUInt32BE(bytes, off) { @@ -53157,7 +53760,7 @@ exports.padSplit = function padSplit(num, size, group) { return out.join(' '); }; -},{}],393:[function(require,module,exports){ +},{}],394:[function(require,module,exports){ (function (Buffer){ var generatePrime = require('./lib/generatePrime') var primes = require('./lib/primes.json') @@ -53203,7 +53806,7 @@ exports.DiffieHellmanGroup = exports.createDiffieHellmanGroup = exports.getDiffi exports.createDiffieHellman = exports.DiffieHellman = createDiffieHellman }).call(this,require("buffer").Buffer) -},{"./lib/dh":394,"./lib/generatePrime":395,"./lib/primes.json":396,"buffer":83}],394:[function(require,module,exports){ +},{"./lib/dh":395,"./lib/generatePrime":396,"./lib/primes.json":397,"buffer":84}],395:[function(require,module,exports){ (function (Buffer){ var BN = require('bn.js'); var MillerRabin = require('miller-rabin'); @@ -53371,7 +53974,7 @@ function formatReturnValue(bn, enc) { } }).call(this,require("buffer").Buffer) -},{"./generatePrime":395,"bn.js":53,"buffer":83,"miller-rabin":434,"randombytes":449}],395:[function(require,module,exports){ +},{"./generatePrime":396,"bn.js":54,"buffer":84,"miller-rabin":435,"randombytes":450}],396:[function(require,module,exports){ var randomBytes = require('randombytes'); module.exports = findPrime; findPrime.simpleSieve = simpleSieve; @@ -53478,7 +54081,7 @@ function findPrime(bits, gen) { } -},{"bn.js":53,"miller-rabin":434,"randombytes":449}],396:[function(require,module,exports){ +},{"bn.js":54,"miller-rabin":435,"randombytes":450}],397:[function(require,module,exports){ module.exports={ "modp1": { "gen": "02", @@ -53513,7 +54116,7 @@ module.exports={ "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff" } } -},{}],397:[function(require,module,exports){ +},{}],398:[function(require,module,exports){ 'use strict'; var elliptic = exports; @@ -53529,7 +54132,7 @@ elliptic.curves = require('./elliptic/curves'); elliptic.ec = require('./elliptic/ec'); elliptic.eddsa = require('./elliptic/eddsa'); -},{"../package.json":413,"./elliptic/curve":400,"./elliptic/curves":403,"./elliptic/ec":404,"./elliptic/eddsa":407,"./elliptic/hmac-drbg":410,"./elliptic/utils":412,"brorand":54}],398:[function(require,module,exports){ +},{"../package.json":414,"./elliptic/curve":401,"./elliptic/curves":404,"./elliptic/ec":405,"./elliptic/eddsa":408,"./elliptic/hmac-drbg":411,"./elliptic/utils":413,"brorand":55}],399:[function(require,module,exports){ 'use strict'; var BN = require('bn.js'); @@ -53882,7 +54485,7 @@ BasePoint.prototype.dblp = function dblp(k) { return r; }; -},{"../../elliptic":397,"bn.js":53}],399:[function(require,module,exports){ +},{"../../elliptic":398,"bn.js":54}],400:[function(require,module,exports){ 'use strict'; var curve = require('../curve'); @@ -54294,7 +54897,7 @@ Point.prototype.eq = function eq(other) { Point.prototype.toP = Point.prototype.normalize; Point.prototype.mixedAdd = Point.prototype.add; -},{"../../elliptic":397,"../curve":400,"bn.js":53,"inherits":428}],400:[function(require,module,exports){ +},{"../../elliptic":398,"../curve":401,"bn.js":54,"inherits":429}],401:[function(require,module,exports){ 'use strict'; var curve = exports; @@ -54304,7 +54907,7 @@ curve.short = require('./short'); curve.mont = require('./mont'); curve.edwards = require('./edwards'); -},{"./base":398,"./edwards":399,"./mont":401,"./short":402}],401:[function(require,module,exports){ +},{"./base":399,"./edwards":400,"./mont":402,"./short":403}],402:[function(require,module,exports){ 'use strict'; var curve = require('../curve'); @@ -54482,7 +55085,7 @@ Point.prototype.getX = function getX() { return this.x.fromRed(); }; -},{"../../elliptic":397,"../curve":400,"bn.js":53,"inherits":428}],402:[function(require,module,exports){ +},{"../../elliptic":398,"../curve":401,"bn.js":54,"inherits":429}],403:[function(require,module,exports){ 'use strict'; var curve = require('../curve'); @@ -55393,7 +55996,7 @@ JPoint.prototype.isInfinity = function isInfinity() { return this.z.cmpn(0) === 0; }; -},{"../../elliptic":397,"../curve":400,"bn.js":53,"inherits":428}],403:[function(require,module,exports){ +},{"../../elliptic":398,"../curve":401,"bn.js":54,"inherits":429}],404:[function(require,module,exports){ 'use strict'; var curves = exports; @@ -55600,7 +56203,7 @@ defineCurve('secp256k1', { ] }); -},{"../elliptic":397,"./precomputed/secp256k1":411,"hash.js":420}],404:[function(require,module,exports){ +},{"../elliptic":398,"./precomputed/secp256k1":412,"hash.js":421}],405:[function(require,module,exports){ 'use strict'; var BN = require('bn.js'); @@ -55824,7 +56427,7 @@ EC.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) { throw new Error('Unable to find valid recovery factor'); }; -},{"../../elliptic":397,"./key":405,"./signature":406,"bn.js":53}],405:[function(require,module,exports){ +},{"../../elliptic":398,"./key":406,"./signature":407,"bn.js":54}],406:[function(require,module,exports){ 'use strict'; var BN = require('bn.js'); @@ -55933,7 +56536,7 @@ KeyPair.prototype.inspect = function inspect() { ' pub: ' + (this.pub && this.pub.inspect()) + ' >'; }; -},{"bn.js":53}],406:[function(require,module,exports){ +},{"bn.js":54}],407:[function(require,module,exports){ 'use strict'; var BN = require('bn.js'); @@ -56070,7 +56673,7 @@ Signature.prototype.toDER = function toDER(enc) { return utils.encode(res, enc); }; -},{"../../elliptic":397,"bn.js":53}],407:[function(require,module,exports){ +},{"../../elliptic":398,"bn.js":54}],408:[function(require,module,exports){ 'use strict'; var hash = require('hash.js'); @@ -56190,7 +56793,7 @@ EDDSA.prototype.isPoint = function isPoint(val) { return val instanceof this.pointClass; }; -},{"../../elliptic":397,"./key":408,"./signature":409,"hash.js":420}],408:[function(require,module,exports){ +},{"../../elliptic":398,"./key":409,"./signature":410,"hash.js":421}],409:[function(require,module,exports){ 'use strict'; var elliptic = require('../../elliptic'); @@ -56288,7 +56891,7 @@ KeyPair.prototype.getPublic = function getPublic(enc) { module.exports = KeyPair; -},{"../../elliptic":397}],409:[function(require,module,exports){ +},{"../../elliptic":398}],410:[function(require,module,exports){ 'use strict'; var BN = require('bn.js'); @@ -56356,7 +56959,7 @@ Signature.prototype.toHex = function toHex() { module.exports = Signature; -},{"../../elliptic":397,"bn.js":53}],410:[function(require,module,exports){ +},{"../../elliptic":398,"bn.js":54}],411:[function(require,module,exports){ 'use strict'; var hash = require('hash.js'); @@ -56472,7 +57075,7 @@ HmacDRBG.prototype.generate = function generate(len, enc, add, addEnc) { return utils.encode(res, enc); }; -},{"../elliptic":397,"hash.js":420}],411:[function(require,module,exports){ +},{"../elliptic":398,"hash.js":421}],412:[function(require,module,exports){ module.exports = { doubles: { step: 4, @@ -57254,7 +57857,7 @@ module.exports = { } }; -},{}],412:[function(require,module,exports){ +},{}],413:[function(require,module,exports){ 'use strict'; var utils = exports; @@ -57428,12 +58031,12 @@ function intFromLE(bytes) { utils.intFromLE = intFromLE; -},{"bn.js":53}],413:[function(require,module,exports){ +},{"bn.js":54}],414:[function(require,module,exports){ module.exports={ "_args": [ [ "elliptic@^6.0.0", - "/Volumes/Macintosh HD/Users/TayTay/Documents/Dropbox/local-dev/etherwallet/node_modules/browserify-sign" + "C:\\Users\\Kosala\\Documents\\GitHub\\etherwallet\\node_modules\\browserify-sign" ] ], "_from": "elliptic@>=6.0.0 <7.0.0", @@ -57469,7 +58072,7 @@ module.exports={ "_shasum": "dce82efbf176eefa7495d4be3e8b9f5b5694b295", "_shrinkwrap": null, "_spec": "elliptic@^6.0.0", - "_where": "/Volumes/Macintosh HD/Users/TayTay/Documents/Dropbox/local-dev/etherwallet/node_modules/browserify-sign", + "_where": "C:\\Users\\Kosala\\Documents\\GitHub\\etherwallet\\node_modules\\browserify-sign", "author": { "email": "fedor@indutny.com", "name": "Fedor Indutny" @@ -57541,7 +58144,7 @@ module.exports={ "version": "6.2.7" } -},{}],414:[function(require,module,exports){ +},{}],415:[function(require,module,exports){ module.exports={ "genesisGasLimit": { "v": 5000, @@ -57774,10 +58377,10 @@ module.exports={ } } -},{}],415:[function(require,module,exports){ +},{}],416:[function(require,module,exports){ module.exports = require('./params.json') -},{"./params.json":414}],416:[function(require,module,exports){ +},{"./params.json":415}],417:[function(require,module,exports){ (function (global,Buffer){ const ethUtil = require('ethereumjs-util') const fees = require('ethereum-common/params') @@ -58037,7 +58640,7 @@ Transaction.prototype.validate = function (stringError) { } }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer) -},{"buffer":83,"ethereum-common/params":415,"ethereumjs-util":417}],417:[function(require,module,exports){ +},{"buffer":84,"ethereum-common/params":416,"ethereumjs-util":418}],418:[function(require,module,exports){ (function (Buffer){ const SHA3 = require('keccakjs') const secp256k1 = require('secp256k1') @@ -58706,7 +59309,7 @@ exports.defineProperties = function (self, fields, data) { } }).call(this,require("buffer").Buffer) -},{"assert":48,"bn.js":53,"buffer":83,"create-hash":382,"keccakjs":432,"rlp":462,"secp256k1":464}],418:[function(require,module,exports){ +},{"assert":48,"bn.js":54,"buffer":84,"create-hash":383,"keccakjs":433,"rlp":462,"secp256k1":464}],419:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -59006,7 +59609,7 @@ function isUndefined(arg) { return arg === void 0; } -},{}],419:[function(require,module,exports){ +},{}],420:[function(require,module,exports){ (function (Buffer){ var md5 = require('create-hash/md5') module.exports = EVP_BytesToKey @@ -59078,7 +59681,7 @@ function EVP_BytesToKey (password, salt, keyLen, ivLen) { } }).call(this,require("buffer").Buffer) -},{"buffer":83,"create-hash/md5":384}],420:[function(require,module,exports){ +},{"buffer":84,"create-hash/md5":385}],421:[function(require,module,exports){ var hash = exports; hash.utils = require('./hash/utils'); @@ -59095,7 +59698,7 @@ hash.sha384 = hash.sha.sha384; hash.sha512 = hash.sha.sha512; hash.ripemd160 = hash.ripemd.ripemd160; -},{"./hash/common":421,"./hash/hmac":422,"./hash/ripemd":423,"./hash/sha":424,"./hash/utils":425}],421:[function(require,module,exports){ +},{"./hash/common":422,"./hash/hmac":423,"./hash/ripemd":424,"./hash/sha":425,"./hash/utils":426}],422:[function(require,module,exports){ var hash = require('../hash'); var utils = hash.utils; var assert = utils.assert; @@ -59188,7 +59791,7 @@ BlockHash.prototype._pad = function pad() { return res; }; -},{"../hash":420}],422:[function(require,module,exports){ +},{"../hash":421}],423:[function(require,module,exports){ var hmac = exports; var hash = require('../hash'); @@ -59238,7 +59841,7 @@ Hmac.prototype.digest = function digest(enc) { return this.outer.digest(enc); }; -},{"../hash":420}],423:[function(require,module,exports){ +},{"../hash":421}],424:[function(require,module,exports){ var hash = require('../hash'); var utils = hash.utils; @@ -59384,7 +59987,7 @@ var sh = [ 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 ]; -},{"../hash":420}],424:[function(require,module,exports){ +},{"../hash":421}],425:[function(require,module,exports){ var hash = require('../hash'); var utils = hash.utils; var assert = utils.assert; @@ -59950,7 +60553,7 @@ function g1_512_lo(xh, xl) { return r; } -},{"../hash":420}],425:[function(require,module,exports){ +},{"../hash":421}],426:[function(require,module,exports){ var utils = exports; var inherits = require('inherits'); @@ -60209,7 +60812,7 @@ function shr64_lo(ah, al, num) { }; exports.shr64_lo = shr64_lo; -},{"inherits":428}],426:[function(require,module,exports){ +},{"inherits":429}],427:[function(require,module,exports){ exports.read = function (buffer, offset, isLE, mLen, nBytes) { var e, m var eLen = nBytes * 8 - mLen - 1 @@ -60295,7 +60898,7 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { buffer[offset + i - d] |= s * 128 } -},{}],427:[function(require,module,exports){ +},{}],428:[function(require,module,exports){ var indexOf = [].indexOf; @@ -60306,7 +60909,7 @@ module.exports = function(arr, obj){ } return -1; }; -},{}],428:[function(require,module,exports){ +},{}],429:[function(require,module,exports){ if (typeof Object.create === 'function') { // implementation from standard node.js 'util' module module.exports = function inherits(ctor, superCtor) { @@ -60331,7 +60934,7 @@ if (typeof Object.create === 'function') { } } -},{}],429:[function(require,module,exports){ +},{}],430:[function(require,module,exports){ /** * Determine if an object is Buffer * @@ -60350,14 +60953,14 @@ module.exports = function (obj) { )) } -},{}],430:[function(require,module,exports){ +},{}],431:[function(require,module,exports){ var toString = {}.toString; module.exports = Array.isArray || function (arr) { return toString.call(arr) == '[object Array]'; }; -},{}],431:[function(require,module,exports){ +},{}],432:[function(require,module,exports){ (function (global){ /* * js-sha3 v0.3.1 @@ -60793,10 +61396,10 @@ module.exports = Array.isArray || function (arr) { }(this)); }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],432:[function(require,module,exports){ +},{}],433:[function(require,module,exports){ module.exports = require('browserify-sha3').SHA3Hash -},{"browserify-sha3":75}],433:[function(require,module,exports){ +},{"browserify-sha3":76}],434:[function(require,module,exports){ (function (global){ /** * marked - a markdown parser @@ -62085,7 +62688,7 @@ if (typeof module !== 'undefined' && typeof exports === 'object') { }()); }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],434:[function(require,module,exports){ +},{}],435:[function(require,module,exports){ var bn = require('bn.js'); var brorand = require('brorand'); @@ -62200,7 +62803,7 @@ MillerRabin.prototype.getDivisor = function getDivisor(n, k) { return false; }; -},{"bn.js":53,"brorand":54}],435:[function(require,module,exports){ +},{"bn.js":54,"brorand":55}],436:[function(require,module,exports){ module.exports = assert; function assert(val, msg) { @@ -62213,7 +62816,7 @@ assert.equal = function assertEqual(l, r, msg) { throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r)); }; -},{}],436:[function(require,module,exports){ +},{}],437:[function(require,module,exports){ module.exports={"2.16.840.1.101.3.4.1.1": "aes-128-ecb", "2.16.840.1.101.3.4.1.2": "aes-128-cbc", "2.16.840.1.101.3.4.1.3": "aes-128-ofb", @@ -62227,7 +62830,7 @@ module.exports={"2.16.840.1.101.3.4.1.1": "aes-128-ecb", "2.16.840.1.101.3.4.1.43": "aes-256-ofb", "2.16.840.1.101.3.4.1.44": "aes-256-cfb" } -},{}],437:[function(require,module,exports){ +},{}],438:[function(require,module,exports){ // from https://github.com/indutny/self-signed/blob/gh-pages/lib/asn1.js // Fedor, you are amazing. @@ -62346,7 +62949,7 @@ exports.signature = asn1.define('signature', function () { ) }) -},{"asn1.js":34}],438:[function(require,module,exports){ +},{"asn1.js":34}],439:[function(require,module,exports){ (function (Buffer){ // adapted from https://github.com/apatil/pemstrip var findProc = /Proc-Type: 4,ENCRYPTED\r?\nDEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)\r?\n\r?\n([0-9A-z\n\r\+\/\=]+)\r?\n/m @@ -62380,7 +62983,7 @@ module.exports = function (okey, password) { } }).call(this,require("buffer").Buffer) -},{"browserify-aes":58,"buffer":83,"evp_bytestokey":419}],439:[function(require,module,exports){ +},{"browserify-aes":59,"buffer":84,"evp_bytestokey":420}],440:[function(require,module,exports){ (function (Buffer){ var asn1 = require('./asn1') var aesid = require('./aesid.json') @@ -62485,7 +63088,7 @@ function decrypt (data, password) { } }).call(this,require("buffer").Buffer) -},{"./aesid.json":436,"./asn1":437,"./fixProc":438,"browserify-aes":58,"buffer":83,"pbkdf2":440}],440:[function(require,module,exports){ +},{"./aesid.json":437,"./asn1":438,"./fixProc":439,"browserify-aes":59,"buffer":84,"pbkdf2":441}],441:[function(require,module,exports){ (function (Buffer){ var createHmac = require('create-hmac') var MAX_ALLOC = Math.pow(2, 30) - 1 // default in iojs @@ -62569,7 +63172,7 @@ function pbkdf2Sync (password, salt, iterations, keylen, digest) { } }).call(this,require("buffer").Buffer) -},{"buffer":83,"create-hmac":385}],441:[function(require,module,exports){ +},{"buffer":84,"create-hmac":386}],442:[function(require,module,exports){ (function (process){ 'use strict'; @@ -62616,7 +63219,7 @@ function nextTick(fn, arg1, arg2, arg3) { } }).call(this,require('_process')) -},{"_process":442}],442:[function(require,module,exports){ +},{"_process":443}],443:[function(require,module,exports){ // shim for using process in browser var process = module.exports = {}; @@ -62712,7 +63315,7 @@ process.chdir = function (dir) { }; process.umask = function() { return 0; }; -},{}],443:[function(require,module,exports){ +},{}],444:[function(require,module,exports){ exports.publicEncrypt = require('./publicEncrypt'); exports.privateDecrypt = require('./privateDecrypt'); @@ -62723,7 +63326,7 @@ exports.privateEncrypt = function privateEncrypt(key, buf) { exports.publicDecrypt = function publicDecrypt(key, buf) { return exports.privateDecrypt(key, buf, true); }; -},{"./privateDecrypt":445,"./publicEncrypt":446}],444:[function(require,module,exports){ +},{"./privateDecrypt":446,"./publicEncrypt":447}],445:[function(require,module,exports){ (function (Buffer){ var createHash = require('create-hash'); module.exports = function (seed, len) { @@ -62742,7 +63345,7 @@ function i2ops(c) { return out; } }).call(this,require("buffer").Buffer) -},{"buffer":83,"create-hash":382}],445:[function(require,module,exports){ +},{"buffer":84,"create-hash":383}],446:[function(require,module,exports){ (function (Buffer){ var parseKeys = require('parse-asn1'); var mgf = require('./mgf'); @@ -62853,7 +63456,7 @@ function compare(a, b){ return dif; } }).call(this,require("buffer").Buffer) -},{"./mgf":444,"./withPublic":447,"./xor":448,"bn.js":53,"browserify-rsa":74,"buffer":83,"create-hash":382,"parse-asn1":439}],446:[function(require,module,exports){ +},{"./mgf":445,"./withPublic":448,"./xor":449,"bn.js":54,"browserify-rsa":75,"buffer":84,"create-hash":383,"parse-asn1":440}],447:[function(require,module,exports){ (function (Buffer){ var parseKeys = require('parse-asn1'); var randomBytes = require('randombytes'); @@ -62927,2506 +63530,1834 @@ function pkcs1(key, msg, reverse){ if (reverse) { ps = new Buffer(k - mLen - 3); ps.fill(0xff); - } else { - ps = nonZero(k - mLen - 3); - } - return new bn(Buffer.concat([new Buffer([0, reverse?1:2]), ps, new Buffer([0]), msg], k)); -} -function nonZero(len, crypto) { - var out = new Buffer(len); - var i = 0; - var cache = randomBytes(len*2); - var cur = 0; - var num; - while (i < len) { - if (cur === cache.length) { - cache = randomBytes(len*2); - cur = 0; - } - num = cache[cur++]; - if (num) { - out[i++] = num; - } - } - return out; -} -}).call(this,require("buffer").Buffer) -},{"./mgf":444,"./withPublic":447,"./xor":448,"bn.js":53,"browserify-rsa":74,"buffer":83,"create-hash":382,"parse-asn1":439,"randombytes":449}],447:[function(require,module,exports){ -(function (Buffer){ -var bn = require('bn.js'); -function withPublic(paddedMsg, key) { - return new Buffer(paddedMsg - .toRed(bn.mont(key.modulus)) - .redPow(new bn(key.publicExponent)) - .fromRed() - .toArray()); -} - -module.exports = withPublic; -}).call(this,require("buffer").Buffer) -},{"bn.js":53,"buffer":83}],448:[function(require,module,exports){ -module.exports = function xor(a, b) { - var len = a.length; - var i = -1; - while (++i < len) { - a[i] ^= b[i]; - } - return a -}; -},{}],449:[function(require,module,exports){ -(function (process,global,Buffer){ -'use strict' - -function oldBrowser () { - throw new Error('secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11') -} - -var crypto = global.crypto || global.msCrypto - -if (crypto && crypto.getRandomValues) { - module.exports = randomBytes -} else { - module.exports = oldBrowser -} - -function randomBytes (size, cb) { - // phantomjs needs to throw - if (size > 65536) throw new Error('requested too many random bytes') - // in case browserify isn't using the Uint8Array version - var rawBytes = new global.Uint8Array(size) - - // This will not work in older browsers. - // See https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues - if (size > 0) { // getRandomValues fails on IE if size == 0 - crypto.getRandomValues(rawBytes) - } - // phantomjs doesn't like a buffer being passed here - var bytes = new Buffer(rawBytes.buffer) - - if (typeof cb === 'function') { - return process.nextTick(function () { - cb(null, bytes) - }) - } - - return bytes -} - -}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer) -},{"_process":442,"buffer":83}],450:[function(require,module,exports){ -module.exports = require("./lib/_stream_duplex.js") - -},{"./lib/_stream_duplex.js":451}],451:[function(require,module,exports){ -// a duplex stream is just a stream that is both readable and writable. -// Since JS doesn't have multiple prototypal inheritance, this class -// prototypally inherits from Readable, and then parasitically from -// Writable. - -'use strict'; - -/**/ - -var objectKeys = Object.keys || function (obj) { - var keys = []; - for (var key in obj) { - keys.push(key); - }return keys; -}; -/**/ - -module.exports = Duplex; - -/**/ -var processNextTick = require('process-nextick-args'); -/**/ - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -var Readable = require('./_stream_readable'); -var Writable = require('./_stream_writable'); - -util.inherits(Duplex, Readable); - -var keys = objectKeys(Writable.prototype); -for (var v = 0; v < keys.length; v++) { - var method = keys[v]; - if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; -} - -function Duplex(options) { - if (!(this instanceof Duplex)) return new Duplex(options); - - Readable.call(this, options); - Writable.call(this, options); - - if (options && options.readable === false) this.readable = false; - - if (options && options.writable === false) this.writable = false; - - this.allowHalfOpen = true; - if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; - - this.once('end', onend); -} - -// the no-half-open enforcer -function onend() { - // if we allow half-open state, or if the writable side ended, - // then we're ok. - if (this.allowHalfOpen || this._writableState.ended) return; - - // no more data can be written. - // But allow more writes to happen in this tick. - processNextTick(onEndNT, this); -} - -function onEndNT(self) { - self.end(); -} - -function forEach(xs, f) { - for (var i = 0, l = xs.length; i < l; i++) { - f(xs[i], i); - } -} -},{"./_stream_readable":453,"./_stream_writable":455,"core-util-is":380,"inherits":428,"process-nextick-args":441}],452:[function(require,module,exports){ -// a passthrough stream. -// basically just the most minimal sort of Transform stream. -// Every written chunk gets output as-is. - -'use strict'; - -module.exports = PassThrough; - -var Transform = require('./_stream_transform'); - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -util.inherits(PassThrough, Transform); - -function PassThrough(options) { - if (!(this instanceof PassThrough)) return new PassThrough(options); - - Transform.call(this, options); -} - -PassThrough.prototype._transform = function (chunk, encoding, cb) { - cb(null, chunk); -}; -},{"./_stream_transform":454,"core-util-is":380,"inherits":428}],453:[function(require,module,exports){ -(function (process){ -'use strict'; - -module.exports = Readable; - -/**/ -var processNextTick = require('process-nextick-args'); -/**/ - -/**/ -var isArray = require('isarray'); -/**/ - -Readable.ReadableState = ReadableState; - -/**/ -var EE = require('events').EventEmitter; - -var EElistenerCount = function (emitter, type) { - return emitter.listeners(type).length; -}; -/**/ - -/**/ -var Stream; -(function () { - try { - Stream = require('st' + 'ream'); - } catch (_) {} finally { - if (!Stream) Stream = require('events').EventEmitter; - } -})(); -/**/ - -var Buffer = require('buffer').Buffer; -/**/ -var bufferShim = require('buffer-shims'); -/**/ - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -/**/ -var debugUtil = require('util'); -var debug = void 0; -if (debugUtil && debugUtil.debuglog) { - debug = debugUtil.debuglog('stream'); -} else { - debug = function () {}; -} -/**/ - -var StringDecoder; - -util.inherits(Readable, Stream); - -var hasPrependListener = typeof EE.prototype.prependListener === 'function'; - -function prependListener(emitter, event, fn) { - if (hasPrependListener) return emitter.prependListener(event, fn); - - // This is a brutally ugly hack to make sure that our error handler - // is attached before any userland ones. NEVER DO THIS. This is here - // only because this code needs to continue to work with older versions - // of Node.js that do not include the prependListener() method. The goal - // is to eventually remove this hack. - if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; -} - -var Duplex; -function ReadableState(options, stream) { - Duplex = Duplex || require('./_stream_duplex'); - - options = options || {}; - - // object stream flag. Used to make read(n) ignore n and to - // make all the buffer merging and length checks go away - this.objectMode = !!options.objectMode; - - if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode; - - // the point at which it stops calling _read() to fill the buffer - // Note: 0 is a valid value, means "don't call _read preemptively ever" - var hwm = options.highWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; - - // cast to ints. - this.highWaterMark = ~ ~this.highWaterMark; - - this.buffer = []; - this.length = 0; - this.pipes = null; - this.pipesCount = 0; - this.flowing = null; - this.ended = false; - this.endEmitted = false; - this.reading = false; - - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; - - // whenever we return null, then we set a flag to say - // that we're awaiting a 'readable' event emission. - this.needReadable = false; - this.emittedReadable = false; - this.readableListening = false; - this.resumeScheduled = false; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // when piping, we only care about 'readable' events that happen - // after read()ing all the bytes and not getting any pushback. - this.ranOut = false; - - // the number of writers that are awaiting a drain event in .pipe()s - this.awaitDrain = 0; - - // if true, a maybeReadMore has been scheduled - this.readingMore = false; - - this.decoder = null; - this.encoding = null; - if (options.encoding) { - if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; - this.decoder = new StringDecoder(options.encoding); - this.encoding = options.encoding; - } -} - -var Duplex; -function Readable(options) { - Duplex = Duplex || require('./_stream_duplex'); - - if (!(this instanceof Readable)) return new Readable(options); - - this._readableState = new ReadableState(options, this); - - // legacy - this.readable = true; - - if (options && typeof options.read === 'function') this._read = options.read; - - Stream.call(this); -} - -// Manually shove something into the read() buffer. -// This returns true if the highWaterMark has not been hit yet, -// similar to how Writable.write() returns true if you should -// write() some more. -Readable.prototype.push = function (chunk, encoding) { - var state = this._readableState; - - if (!state.objectMode && typeof chunk === 'string') { - encoding = encoding || state.defaultEncoding; - if (encoding !== state.encoding) { - chunk = bufferShim.from(chunk, encoding); - encoding = ''; - } - } - - return readableAddChunk(this, state, chunk, encoding, false); -}; - -// Unshift should *always* be something directly out of read() -Readable.prototype.unshift = function (chunk) { - var state = this._readableState; - return readableAddChunk(this, state, chunk, '', true); -}; - -Readable.prototype.isPaused = function () { - return this._readableState.flowing === false; -}; - -function readableAddChunk(stream, state, chunk, encoding, addToFront) { - var er = chunkInvalid(state, chunk); - if (er) { - stream.emit('error', er); - } else if (chunk === null) { - state.reading = false; - onEofChunk(stream, state); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (state.ended && !addToFront) { - var e = new Error('stream.push() after EOF'); - stream.emit('error', e); - } else if (state.endEmitted && addToFront) { - var _e = new Error('stream.unshift() after end event'); - stream.emit('error', _e); - } else { - var skipAdd; - if (state.decoder && !addToFront && !encoding) { - chunk = state.decoder.write(chunk); - skipAdd = !state.objectMode && chunk.length === 0; - } - - if (!addToFront) state.reading = false; - - // Don't add to the buffer if we've decoded to an empty string chunk and - // we're not in object mode - if (!skipAdd) { - // if we want the data now, just emit it. - if (state.flowing && state.length === 0 && !state.sync) { - stream.emit('data', chunk); - stream.read(0); - } else { - // update the buffer info. - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); - - if (state.needReadable) emitReadable(stream); - } - } - - maybeReadMore(stream, state); - } - } else if (!addToFront) { - state.reading = false; - } - - return needMoreData(state); -} - -// if it's past the high water mark, we can push in some more. -// Also, if we have no data yet, we can stand some -// more bytes. This is to work around cases where hwm=0, -// such as the repl. Also, if the push() triggered a -// readable event, and the user called read(largeNumber) such that -// needReadable was set, then we ought to push more, so that another -// 'readable' event will be triggered. -function needMoreData(state) { - return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); -} - -// backwards compatibility. -Readable.prototype.setEncoding = function (enc) { - if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; - this._readableState.decoder = new StringDecoder(enc); - this._readableState.encoding = enc; - return this; -}; - -// Don't raise the hwm > 8MB -var MAX_HWM = 0x800000; -function computeNewHighWaterMark(n) { - if (n >= MAX_HWM) { - n = MAX_HWM; - } else { - // Get the next highest power of 2 - n--; - n |= n >>> 1; - n |= n >>> 2; - n |= n >>> 4; - n |= n >>> 8; - n |= n >>> 16; - n++; + } else { + ps = nonZero(k - mLen - 3); } - return n; + return new bn(Buffer.concat([new Buffer([0, reverse?1:2]), ps, new Buffer([0]), msg], k)); } - -function howMuchToRead(n, state) { - if (state.length === 0 && state.ended) return 0; - - if (state.objectMode) return n === 0 ? 0 : 1; - - if (n === null || isNaN(n)) { - // only flow one buffer at a time - if (state.flowing && state.buffer.length) return state.buffer[0].length;else return state.length; +function nonZero(len, crypto) { + var out = new Buffer(len); + var i = 0; + var cache = randomBytes(len*2); + var cur = 0; + var num; + while (i < len) { + if (cur === cache.length) { + cache = randomBytes(len*2); + cur = 0; + } + num = cache[cur++]; + if (num) { + out[i++] = num; + } } + return out; +} +}).call(this,require("buffer").Buffer) +},{"./mgf":445,"./withPublic":448,"./xor":449,"bn.js":54,"browserify-rsa":75,"buffer":84,"create-hash":383,"parse-asn1":440,"randombytes":450}],448:[function(require,module,exports){ +(function (Buffer){ +var bn = require('bn.js'); +function withPublic(paddedMsg, key) { + return new Buffer(paddedMsg + .toRed(bn.mont(key.modulus)) + .redPow(new bn(key.publicExponent)) + .fromRed() + .toArray()); +} - if (n <= 0) return 0; +module.exports = withPublic; +}).call(this,require("buffer").Buffer) +},{"bn.js":54,"buffer":84}],449:[function(require,module,exports){ +module.exports = function xor(a, b) { + var len = a.length; + var i = -1; + while (++i < len) { + a[i] ^= b[i]; + } + return a +}; +},{}],450:[function(require,module,exports){ +(function (process,global,Buffer){ +'use strict' - // If we're asking for more than the target buffer level, - // then raise the water mark. Bump up to the next highest - // power of 2, to prevent increasing it excessively in tiny - // amounts. - if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); +function oldBrowser () { + throw new Error('secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11') +} - // don't have that much. return null, unless we've ended. - if (n > state.length) { - if (!state.ended) { - state.needReadable = true; - return 0; - } else { - return state.length; - } - } +var crypto = global.crypto || global.msCrypto - return n; +if (crypto && crypto.getRandomValues) { + module.exports = randomBytes +} else { + module.exports = oldBrowser } -// you can override either this method, or the async _read(n) below. -Readable.prototype.read = function (n) { - debug('read', n); - var state = this._readableState; - var nOrig = n; +function randomBytes (size, cb) { + // phantomjs needs to throw + if (size > 65536) throw new Error('requested too many random bytes') + // in case browserify isn't using the Uint8Array version + var rawBytes = new global.Uint8Array(size) - if (typeof n !== 'number' || n > 0) state.emittedReadable = false; + // This will not work in older browsers. + // See https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues + if (size > 0) { // getRandomValues fails on IE if size == 0 + crypto.getRandomValues(rawBytes) + } + // phantomjs doesn't like a buffer being passed here + var bytes = new Buffer(rawBytes.buffer) - // if we're doing read(0) to trigger a readable event, but we - // already have a bunch of data in the buffer, then just trigger - // the 'readable' event and move on. - if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { - debug('read: emitReadable', state.length, state.ended); - if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); - return null; + if (typeof cb === 'function') { + return process.nextTick(function () { + cb(null, bytes) + }) } - n = howMuchToRead(n, state); + return bytes +} - // if we've ended, and we're now clear, then finish it up. - if (n === 0 && state.ended) { - if (state.length === 0) endReadable(this); - return null; - } +}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer) +},{"_process":443,"buffer":84}],451:[function(require,module,exports){ +module.exports = require("./lib/_stream_duplex.js") - // All the actual chunk generation logic needs to be - // *below* the call to _read. The reason is that in certain - // synthetic stream cases, such as passthrough streams, _read - // may be a completely synchronous operation which may change - // the state of the read buffer, providing enough data when - // before there was *not* enough. - // - // So, the steps are: - // 1. Figure out what the state of things will be after we do - // a read from the buffer. - // - // 2. If that resulting state will trigger a _read, then call _read. - // Note that this may be asynchronous, or synchronous. Yes, it is - // deeply ugly to write APIs this way, but that still doesn't mean - // that the Readable class should behave improperly, as streams are - // designed to be sync/async agnostic. - // Take note if the _read call is sync or async (ie, if the read call - // has returned yet), so that we know whether or not it's safe to emit - // 'readable' etc. - // - // 3. Actually pull the requested chunks out of the buffer and return. +},{"./lib/_stream_duplex.js":452}],452:[function(require,module,exports){ +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. - // if we need a readable event, then we need to do some reading. - var doRead = state.needReadable; - debug('need readable', doRead); +'use strict'; - // if we currently have less than the highWaterMark, then also read some - if (state.length === 0 || state.length - n < state.highWaterMark) { - doRead = true; - debug('length less than watermark', doRead); - } +/**/ - // however, if we've ended, then there's no point, and if we're already - // reading, then it's unnecessary. - if (state.ended || state.reading) { - doRead = false; - debug('reading or ended', doRead); - } +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) { + keys.push(key); + }return keys; +}; +/**/ - if (doRead) { - debug('do read'); - state.reading = true; - state.sync = true; - // if the length is currently zero, then we *need* a readable event. - if (state.length === 0) state.needReadable = true; - // call internal read method - this._read(state.highWaterMark); - state.sync = false; - } +module.exports = Duplex; - // If _read pushed data synchronously, then `reading` will be false, - // and we need to re-evaluate how much data we can return to the user. - if (doRead && !state.reading) n = howMuchToRead(nOrig, state); +/**/ +var processNextTick = require('process-nextick-args'); +/**/ - var ret; - if (n > 0) ret = fromList(n, state);else ret = null; +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ - if (ret === null) { - state.needReadable = true; - n = 0; - } +var Readable = require('./_stream_readable'); +var Writable = require('./_stream_writable'); - state.length -= n; +util.inherits(Duplex, Readable); - // If we have nothing in the buffer, then we want to know - // as soon as we *do* get something into the buffer. - if (state.length === 0 && !state.ended) state.needReadable = true; +var keys = objectKeys(Writable.prototype); +for (var v = 0; v < keys.length; v++) { + var method = keys[v]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; +} - // If we tried to read() past the EOF, then emit end on the next tick. - if (nOrig !== n && state.ended && state.length === 0) endReadable(this); +function Duplex(options) { + if (!(this instanceof Duplex)) return new Duplex(options); - if (ret !== null) this.emit('data', ret); + Readable.call(this, options); + Writable.call(this, options); - return ret; -}; + if (options && options.readable === false) this.readable = false; -function chunkInvalid(state, chunk) { - var er = null; - if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - return er; -} + if (options && options.writable === false) this.writable = false; -function onEofChunk(stream, state) { - if (state.ended) return; - if (state.decoder) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; - } - } - state.ended = true; + this.allowHalfOpen = true; + if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; - // emit 'readable' now to make sure it gets picked up. - emitReadable(stream); + this.once('end', onend); } -// Don't emit readable right away in sync mode, because this can trigger -// another read() call => stack overflow. This way, it might trigger -// a nextTick recursion warning, but that's not so bad. -function emitReadable(stream) { - var state = stream._readableState; - state.needReadable = false; - if (!state.emittedReadable) { - debug('emitReadable', state.flowing); - state.emittedReadable = true; - if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream); - } -} +// the no-half-open enforcer +function onend() { + // if we allow half-open state, or if the writable side ended, + // then we're ok. + if (this.allowHalfOpen || this._writableState.ended) return; -function emitReadable_(stream) { - debug('emit readable'); - stream.emit('readable'); - flow(stream); + // no more data can be written. + // But allow more writes to happen in this tick. + processNextTick(onEndNT, this); } -// at this point, the user has presumably seen the 'readable' event, -// and called read() to consume some data. that may have triggered -// in turn another _read(n) call, in which case reading = true if -// it's in progress. -// However, if we're not ended, or reading, and the length < hwm, -// then go ahead and try to read some more preemptively. -function maybeReadMore(stream, state) { - if (!state.readingMore) { - state.readingMore = true; - processNextTick(maybeReadMore_, stream, state); - } +function onEndNT(self) { + self.end(); } -function maybeReadMore_(stream, state) { - var len = state.length; - while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { - debug('maybeReadMore read 0'); - stream.read(0); - if (len === state.length) - // didn't get any data, stop spinning. - break;else len = state.length; +function forEach(xs, f) { + for (var i = 0, l = xs.length; i < l; i++) { + f(xs[i], i); } - state.readingMore = false; } +},{"./_stream_readable":454,"./_stream_writable":456,"core-util-is":381,"inherits":429,"process-nextick-args":442}],453:[function(require,module,exports){ +// a passthrough stream. +// basically just the most minimal sort of Transform stream. +// Every written chunk gets output as-is. -// abstract method. to be overridden in specific implementation classes. -// call cb(er, data) where data is <= n in length. -// for virtual (non-string, non-buffer) streams, "length" is somewhat -// arbitrary, and perhaps not very meaningful. -Readable.prototype._read = function (n) { - this.emit('error', new Error('not implemented')); -}; - -Readable.prototype.pipe = function (dest, pipeOpts) { - var src = this; - var state = this._readableState; +'use strict'; - switch (state.pipesCount) { - case 0: - state.pipes = dest; - break; - case 1: - state.pipes = [state.pipes, dest]; - break; - default: - state.pipes.push(dest); - break; - } - state.pipesCount += 1; - debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); +module.exports = PassThrough; - var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; +var Transform = require('./_stream_transform'); - var endFn = doEnd ? onend : cleanup; - if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn); +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ - dest.on('unpipe', onunpipe); - function onunpipe(readable) { - debug('onunpipe'); - if (readable === src) { - cleanup(); - } - } +util.inherits(PassThrough, Transform); - function onend() { - debug('onend'); - dest.end(); - } +function PassThrough(options) { + if (!(this instanceof PassThrough)) return new PassThrough(options); - // when the dest drains, it reduces the awaitDrain counter - // on the source. This would be more elegant with a .once() - // handler in flow(), but adding and removing repeatedly is - // too slow. - var ondrain = pipeOnDrain(src); - dest.on('drain', ondrain); + Transform.call(this, options); +} - var cleanedUp = false; - function cleanup() { - debug('cleanup'); - // cleanup event handlers once the pipe is broken - dest.removeListener('close', onclose); - dest.removeListener('finish', onfinish); - dest.removeListener('drain', ondrain); - dest.removeListener('error', onerror); - dest.removeListener('unpipe', onunpipe); - src.removeListener('end', onend); - src.removeListener('end', cleanup); - src.removeListener('data', ondata); +PassThrough.prototype._transform = function (chunk, encoding, cb) { + cb(null, chunk); +}; +},{"./_stream_transform":455,"core-util-is":381,"inherits":429}],454:[function(require,module,exports){ +(function (process){ +'use strict'; - cleanedUp = true; +module.exports = Readable; - // if the reader is waiting for a drain event from this - // specific writer, then it would cause it to never start - // flowing again. - // So, if this is awaiting a drain, then we just call it now. - // If we don't know, then assume that we are waiting for one. - if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); - } +/**/ +var processNextTick = require('process-nextick-args'); +/**/ - src.on('data', ondata); - function ondata(chunk) { - debug('ondata'); - var ret = dest.write(chunk); - if (false === ret) { - // If the user unpiped during `dest.write()`, it is possible - // to get stuck in a permanently paused state if that write - // also returned false. - // => Check whether `dest` is still a piping destination. - if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { - debug('false write response, pause', src._readableState.awaitDrain); - src._readableState.awaitDrain++; - } - src.pause(); - } - } +/**/ +var isArray = require('isarray'); +/**/ - // if the dest has an error, then stop piping into it. - // however, don't suppress the throwing behavior for this. - function onerror(er) { - debug('onerror', er); - unpipe(); - dest.removeListener('error', onerror); - if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); - } +Readable.ReadableState = ReadableState; - // Make sure our error handler is attached before userland ones. - prependListener(dest, 'error', onerror); +/**/ +var EE = require('events').EventEmitter; - // Both close and finish should trigger unpipe, but only once. - function onclose() { - dest.removeListener('finish', onfinish); - unpipe(); - } - dest.once('close', onclose); - function onfinish() { - debug('onfinish'); - dest.removeListener('close', onclose); - unpipe(); - } - dest.once('finish', onfinish); +var EElistenerCount = function (emitter, type) { + return emitter.listeners(type).length; +}; +/**/ - function unpipe() { - debug('unpipe'); - src.unpipe(dest); +/**/ +var Stream; +(function () { + try { + Stream = require('st' + 'ream'); + } catch (_) {} finally { + if (!Stream) Stream = require('events').EventEmitter; } +})(); +/**/ - // tell the dest that it's being piped to - dest.emit('pipe', src); - - // start the flow if it hasn't been started already. - if (!state.flowing) { - debug('pipe resume'); - src.resume(); - } +var Buffer = require('buffer').Buffer; +/**/ +var bufferShim = require('buffer-shims'); +/**/ - return dest; -}; +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ -function pipeOnDrain(src) { - return function () { - var state = src._readableState; - debug('pipeOnDrain', state.awaitDrain); - if (state.awaitDrain) state.awaitDrain--; - if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { - state.flowing = true; - flow(src); - } - }; +/**/ +var debugUtil = require('util'); +var debug = void 0; +if (debugUtil && debugUtil.debuglog) { + debug = debugUtil.debuglog('stream'); +} else { + debug = function () {}; } +/**/ -Readable.prototype.unpipe = function (dest) { - var state = this._readableState; - - // if we're not piping anywhere, then do nothing. - if (state.pipesCount === 0) return this; - - // just one destination. most common case. - if (state.pipesCount === 1) { - // passed in one, but it's not the right one. - if (dest && dest !== state.pipes) return this; - - if (!dest) dest = state.pipes; - - // got a match. - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - if (dest) dest.emit('unpipe', this); - return this; - } +var StringDecoder; - // slow case. multiple pipe destinations. +util.inherits(Readable, Stream); - if (!dest) { - // remove all. - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; +var hasPrependListener = typeof EE.prototype.prependListener === 'function'; - for (var _i = 0; _i < len; _i++) { - dests[_i].emit('unpipe', this); - }return this; - } +function prependListener(emitter, event, fn) { + if (hasPrependListener) return emitter.prependListener(event, fn); - // try to find the right one. - var i = indexOf(state.pipes, dest); - if (i === -1) return this; + // This is a brutally ugly hack to make sure that our error handler + // is attached before any userland ones. NEVER DO THIS. This is here + // only because this code needs to continue to work with older versions + // of Node.js that do not include the prependListener() method. The goal + // is to eventually remove this hack. + if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; +} - state.pipes.splice(i, 1); - state.pipesCount -= 1; - if (state.pipesCount === 1) state.pipes = state.pipes[0]; +var Duplex; +function ReadableState(options, stream) { + Duplex = Duplex || require('./_stream_duplex'); - dest.emit('unpipe', this); + options = options || {}; - return this; -}; + // object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away + this.objectMode = !!options.objectMode; -// set up data events if they are asked for -// Ensure readable listeners eventually get something -Readable.prototype.on = function (ev, fn) { - var res = Stream.prototype.on.call(this, ev, fn); + if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode; - // If listening to data, and it has not explicitly been paused, - // then call resume to start the flow of data on the next tick. - if (ev === 'data' && false !== this._readableState.flowing) { - this.resume(); - } + // the point at which it stops calling _read() to fill the buffer + // Note: 0 is a valid value, means "don't call _read preemptively ever" + var hwm = options.highWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; - if (ev === 'readable' && !this._readableState.endEmitted) { - var state = this._readableState; - if (!state.readableListening) { - state.readableListening = true; - state.emittedReadable = false; - state.needReadable = true; - if (!state.reading) { - processNextTick(nReadingNextTick, this); - } else if (state.length) { - emitReadable(this, state); - } - } - } + // cast to ints. + this.highWaterMark = ~ ~this.highWaterMark; - return res; -}; -Readable.prototype.addListener = Readable.prototype.on; + this.buffer = []; + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; + this.ended = false; + this.endEmitted = false; + this.reading = false; -function nReadingNextTick(self) { - debug('readable nexttick read 0'); - self.read(0); -} + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; -// pause() and resume() are remnants of the legacy readable stream API -// If the user uses them, then switch into old mode. -Readable.prototype.resume = function () { - var state = this._readableState; - if (!state.flowing) { - debug('resume'); - state.flowing = true; - resume(this, state); - } - return this; -}; + // whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + this.resumeScheduled = false; -function resume(stream, state) { - if (!state.resumeScheduled) { - state.resumeScheduled = true; - processNextTick(resume_, stream, state); - } -} + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; -function resume_(stream, state) { - if (!state.reading) { - debug('resume read 0'); - stream.read(0); - } + // when piping, we only care about 'readable' events that happen + // after read()ing all the bytes and not getting any pushback. + this.ranOut = false; - state.resumeScheduled = false; - stream.emit('resume'); - flow(stream); - if (state.flowing && !state.reading) stream.read(0); -} + // the number of writers that are awaiting a drain event in .pipe()s + this.awaitDrain = 0; -Readable.prototype.pause = function () { - debug('call pause flowing=%j', this._readableState.flowing); - if (false !== this._readableState.flowing) { - debug('pause'); - this._readableState.flowing = false; - this.emit('pause'); - } - return this; -}; + // if true, a maybeReadMore has been scheduled + this.readingMore = false; -function flow(stream) { - var state = stream._readableState; - debug('flow', state.flowing); - if (state.flowing) { - do { - var chunk = stream.read(); - } while (null !== chunk && state.flowing); + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; } } -// wrap an old-style stream as the async data source. -// This is *not* part of the readable stream interface. -// It is an ugly unfortunate mess of history. -Readable.prototype.wrap = function (stream) { - var state = this._readableState; - var paused = false; - - var self = this; - stream.on('end', function () { - debug('wrapped end'); - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) self.push(chunk); - } +var Duplex; +function Readable(options) { + Duplex = Duplex || require('./_stream_duplex'); - self.push(null); - }); + if (!(this instanceof Readable)) return new Readable(options); - stream.on('data', function (chunk) { - debug('wrapped data'); - if (state.decoder) chunk = state.decoder.write(chunk); + this._readableState = new ReadableState(options, this); - // don't skip over falsy values in objectMode - if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; + // legacy + this.readable = true; - var ret = self.push(chunk); - if (!ret) { - paused = true; - stream.pause(); - } - }); + if (options && typeof options.read === 'function') this._read = options.read; - // proxy all the other methods. - // important when wrapping filters and duplexes. - for (var i in stream) { - if (this[i] === undefined && typeof stream[i] === 'function') { - this[i] = function (method) { - return function () { - return stream[method].apply(stream, arguments); - }; - }(i); - } - } + Stream.call(this); +} - // proxy certain important events. - var events = ['error', 'close', 'destroy', 'pause', 'resume']; - forEach(events, function (ev) { - stream.on(ev, self.emit.bind(self, ev)); - }); +// Manually shove something into the read() buffer. +// This returns true if the highWaterMark has not been hit yet, +// similar to how Writable.write() returns true if you should +// write() some more. +Readable.prototype.push = function (chunk, encoding) { + var state = this._readableState; - // when we try to consume some more bytes, simply unpause the - // underlying stream. - self._read = function (n) { - debug('wrapped _read', n); - if (paused) { - paused = false; - stream.resume(); + if (!state.objectMode && typeof chunk === 'string') { + encoding = encoding || state.defaultEncoding; + if (encoding !== state.encoding) { + chunk = bufferShim.from(chunk, encoding); + encoding = ''; } - }; + } - return self; + return readableAddChunk(this, state, chunk, encoding, false); }; -// exposed for testing purposes only. -Readable._fromList = fromList; - -// Pluck off n bytes from an array of buffers. -// Length is the combined lengths of all the buffers in the list. -function fromList(n, state) { - var list = state.buffer; - var length = state.length; - var stringMode = !!state.decoder; - var objectMode = !!state.objectMode; - var ret; +// Unshift should *always* be something directly out of read() +Readable.prototype.unshift = function (chunk) { + var state = this._readableState; + return readableAddChunk(this, state, chunk, '', true); +}; - // nothing in the list, definitely empty. - if (list.length === 0) return null; +Readable.prototype.isPaused = function () { + return this._readableState.flowing === false; +}; - if (length === 0) ret = null;else if (objectMode) ret = list.shift();else if (!n || n >= length) { - // read it all, truncate the array. - if (stringMode) ret = list.join('');else if (list.length === 1) ret = list[0];else ret = Buffer.concat(list, length); - list.length = 0; - } else { - // read just some of it. - if (n < list[0].length) { - // just take a part of the first list item. - // slice is the same for buffers and strings. - var buf = list[0]; - ret = buf.slice(0, n); - list[0] = buf.slice(n); - } else if (n === list[0].length) { - // first list is a perfect match - ret = list.shift(); +function readableAddChunk(stream, state, chunk, encoding, addToFront) { + var er = chunkInvalid(state, chunk); + if (er) { + stream.emit('error', er); + } else if (chunk === null) { + state.reading = false; + onEofChunk(stream, state); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (state.ended && !addToFront) { + var e = new Error('stream.push() after EOF'); + stream.emit('error', e); + } else if (state.endEmitted && addToFront) { + var _e = new Error('stream.unshift() after end event'); + stream.emit('error', _e); } else { - // complex case. - // we have enough to cover it, but it spans past the first buffer. - if (stringMode) ret = '';else ret = bufferShim.allocUnsafe(n); - - var c = 0; - for (var i = 0, l = list.length; i < l && c < n; i++) { - var _buf = list[0]; - var cpy = Math.min(n - c, _buf.length); + var skipAdd; + if (state.decoder && !addToFront && !encoding) { + chunk = state.decoder.write(chunk); + skipAdd = !state.objectMode && chunk.length === 0; + } - if (stringMode) ret += _buf.slice(0, cpy);else _buf.copy(ret, c, 0, cpy); + if (!addToFront) state.reading = false; - if (cpy < _buf.length) list[0] = _buf.slice(cpy);else list.shift(); + // Don't add to the buffer if we've decoded to an empty string chunk and + // we're not in object mode + if (!skipAdd) { + // if we want the data now, just emit it. + if (state.flowing && state.length === 0 && !state.sync) { + stream.emit('data', chunk); + stream.read(0); + } else { + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); - c += cpy; + if (state.needReadable) emitReadable(stream); + } } + + maybeReadMore(stream, state); } + } else if (!addToFront) { + state.reading = false; } - return ret; -} - -function endReadable(stream) { - var state = stream._readableState; - - // If we get here before consuming all the bytes, then that is a - // bug in node. Should never happen. - if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); - - if (!state.endEmitted) { - state.ended = true; - processNextTick(endReadableNT, state, stream); - } + return needMoreData(state); } -function endReadableNT(state, stream) { - // Check that we didn't get one last unshift. - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit('end'); - } +// if it's past the high water mark, we can push in some more. +// Also, if we have no data yet, we can stand some +// more bytes. This is to work around cases where hwm=0, +// such as the repl. Also, if the push() triggered a +// readable event, and the user called read(largeNumber) such that +// needReadable was set, then we ought to push more, so that another +// 'readable' event will be triggered. +function needMoreData(state) { + return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); } -function forEach(xs, f) { - for (var i = 0, l = xs.length; i < l; i++) { - f(xs[i], i); - } -} +// backwards compatibility. +Readable.prototype.setEncoding = function (enc) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this._readableState.decoder = new StringDecoder(enc); + this._readableState.encoding = enc; + return this; +}; -function indexOf(xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) return i; +// Don't raise the hwm > 8MB +var MAX_HWM = 0x800000; +function computeNewHighWaterMark(n) { + if (n >= MAX_HWM) { + n = MAX_HWM; + } else { + // Get the next highest power of 2 + n--; + n |= n >>> 1; + n |= n >>> 2; + n |= n >>> 4; + n |= n >>> 8; + n |= n >>> 16; + n++; } - return -1; + return n; } -}).call(this,require('_process')) -},{"./_stream_duplex":451,"_process":442,"buffer":83,"buffer-shims":81,"core-util-is":380,"events":418,"inherits":428,"isarray":430,"process-nextick-args":441,"string_decoder/":478,"util":55}],454:[function(require,module,exports){ -// a transform stream is a readable/writable stream where you do -// something with the data. Sometimes it's called a "filter", -// but that's not a great name for it, since that implies a thing where -// some bits pass through, and others are simply ignored. (That would -// be a valid example of a transform, of course.) -// -// While the output is causally related to the input, it's not a -// necessarily symmetric or synchronous transformation. For example, -// a zlib stream might take multiple plain-text writes(), and then -// emit a single compressed chunk some time in the future. -// -// Here's how this works: -// -// The Transform stream has all the aspects of the readable and writable -// stream classes. When you write(chunk), that calls _write(chunk,cb) -// internally, and returns false if there's a lot of pending writes -// buffered up. When you call read(), that calls _read(n) until -// there's enough pending readable data buffered up. -// -// In a transform stream, the written data is placed in a buffer. When -// _read(n) is called, it transforms the queued up data, calling the -// buffered _write cb's as it consumes chunks. If consuming a single -// written chunk would result in multiple output chunks, then the first -// outputted bit calls the readcb, and subsequent chunks just go into -// the read buffer, and will cause it to emit 'readable' if necessary. -// -// This way, back-pressure is actually determined by the reading side, -// since _read has to be called to start processing a new chunk. However, -// a pathological inflate type of transform can cause excessive buffering -// here. For example, imagine a stream where every byte of input is -// interpreted as an integer from 0-255, and then results in that many -// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in -// 1kb of data being output. In this case, you could write a very small -// amount of input, and end up with a very large amount of output. In -// such a pathological inflating mechanism, there'd be no way to tell -// the system to stop doing the transform. A single 4MB write could -// cause the system to run out of memory. -// -// However, even in such a pathological case, only a single written chunk -// would be consumed, and then the rest would wait (un-transformed) until -// the results of the previous transformed chunk were consumed. -'use strict'; +function howMuchToRead(n, state) { + if (state.length === 0 && state.ended) return 0; -module.exports = Transform; + if (state.objectMode) return n === 0 ? 0 : 1; -var Duplex = require('./_stream_duplex'); + if (n === null || isNaN(n)) { + // only flow one buffer at a time + if (state.flowing && state.buffer.length) return state.buffer[0].length;else return state.length; + } -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ + if (n <= 0) return 0; -util.inherits(Transform, Duplex); + // If we're asking for more than the target buffer level, + // then raise the water mark. Bump up to the next highest + // power of 2, to prevent increasing it excessively in tiny + // amounts. + if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); -function TransformState(stream) { - this.afterTransform = function (er, data) { - return afterTransform(stream, er, data); - }; + // don't have that much. return null, unless we've ended. + if (n > state.length) { + if (!state.ended) { + state.needReadable = true; + return 0; + } else { + return state.length; + } + } - this.needTransform = false; - this.transforming = false; - this.writecb = null; - this.writechunk = null; - this.writeencoding = null; + return n; } -function afterTransform(stream, er, data) { - var ts = stream._transformState; - ts.transforming = false; - - var cb = ts.writecb; - - if (!cb) return stream.emit('error', new Error('no writecb in Transform class')); - - ts.writechunk = null; - ts.writecb = null; - - if (data !== null && data !== undefined) stream.push(data); +// you can override either this method, or the async _read(n) below. +Readable.prototype.read = function (n) { + debug('read', n); + var state = this._readableState; + var nOrig = n; - cb(er); + if (typeof n !== 'number' || n > 0) state.emittedReadable = false; - var rs = stream._readableState; - rs.reading = false; - if (rs.needReadable || rs.length < rs.highWaterMark) { - stream._read(rs.highWaterMark); + // if we're doing read(0) to trigger a readable event, but we + // already have a bunch of data in the buffer, then just trigger + // the 'readable' event and move on. + if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { + debug('read: emitReadable', state.length, state.ended); + if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); + return null; } -} - -function Transform(options) { - if (!(this instanceof Transform)) return new Transform(options); - - Duplex.call(this, options); - this._transformState = new TransformState(this); + n = howMuchToRead(n, state); - // when the writable side finishes, then flush out anything remaining. - var stream = this; + // if we've ended, and we're now clear, then finish it up. + if (n === 0 && state.ended) { + if (state.length === 0) endReadable(this); + return null; + } - // start out asking for a readable event once data is transformed. - this._readableState.needReadable = true; + // All the actual chunk generation logic needs to be + // *below* the call to _read. The reason is that in certain + // synthetic stream cases, such as passthrough streams, _read + // may be a completely synchronous operation which may change + // the state of the read buffer, providing enough data when + // before there was *not* enough. + // + // So, the steps are: + // 1. Figure out what the state of things will be after we do + // a read from the buffer. + // + // 2. If that resulting state will trigger a _read, then call _read. + // Note that this may be asynchronous, or synchronous. Yes, it is + // deeply ugly to write APIs this way, but that still doesn't mean + // that the Readable class should behave improperly, as streams are + // designed to be sync/async agnostic. + // Take note if the _read call is sync or async (ie, if the read call + // has returned yet), so that we know whether or not it's safe to emit + // 'readable' etc. + // + // 3. Actually pull the requested chunks out of the buffer and return. - // we have implemented the _read method, and done the other things - // that Readable wants before the first _read call, so unset the - // sync guard flag. - this._readableState.sync = false; + // if we need a readable event, then we need to do some reading. + var doRead = state.needReadable; + debug('need readable', doRead); - if (options) { - if (typeof options.transform === 'function') this._transform = options.transform; + // if we currently have less than the highWaterMark, then also read some + if (state.length === 0 || state.length - n < state.highWaterMark) { + doRead = true; + debug('length less than watermark', doRead); + } - if (typeof options.flush === 'function') this._flush = options.flush; + // however, if we've ended, then there's no point, and if we're already + // reading, then it's unnecessary. + if (state.ended || state.reading) { + doRead = false; + debug('reading or ended', doRead); } - this.once('prefinish', function () { - if (typeof this._flush === 'function') this._flush(function (er) { - done(stream, er); - });else done(stream); - }); -} + if (doRead) { + debug('do read'); + state.reading = true; + state.sync = true; + // if the length is currently zero, then we *need* a readable event. + if (state.length === 0) state.needReadable = true; + // call internal read method + this._read(state.highWaterMark); + state.sync = false; + } -Transform.prototype.push = function (chunk, encoding) { - this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk, encoding); -}; + // If _read pushed data synchronously, then `reading` will be false, + // and we need to re-evaluate how much data we can return to the user. + if (doRead && !state.reading) n = howMuchToRead(nOrig, state); -// This is the part where you do stuff! -// override this function in implementation classes. -// 'chunk' is an input chunk. -// -// Call `push(newChunk)` to pass along transformed output -// to the readable side. You may call 'push' zero or more times. -// -// Call `cb(err)` when you are done with this chunk. If you pass -// an error, then that'll put the hurt on the whole operation. If you -// never call cb(), then you'll never get another chunk. -Transform.prototype._transform = function (chunk, encoding, cb) { - throw new Error('Not implemented'); -}; + var ret; + if (n > 0) ret = fromList(n, state);else ret = null; -Transform.prototype._write = function (chunk, encoding, cb) { - var ts = this._transformState; - ts.writecb = cb; - ts.writechunk = chunk; - ts.writeencoding = encoding; - if (!ts.transforming) { - var rs = this._readableState; - if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); + if (ret === null) { + state.needReadable = true; + n = 0; } -}; - -// Doesn't matter what the args are here. -// _transform does all the work. -// That we got here means that the readable side wants more data. -Transform.prototype._read = function (n) { - var ts = this._transformState; - if (ts.writechunk !== null && ts.writecb && !ts.transforming) { - ts.transforming = true; - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); - } else { - // mark that we need a transform, so that any data that comes in - // will get processed, now that we've asked for it. - ts.needTransform = true; - } -}; + state.length -= n; -function done(stream, er) { - if (er) return stream.emit('error', er); + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (state.length === 0 && !state.ended) state.needReadable = true; - // if there's nothing in the write buffer, then that means - // that nothing more will ever be provided - var ws = stream._writableState; - var ts = stream._transformState; + // If we tried to read() past the EOF, then emit end on the next tick. + if (nOrig !== n && state.ended && state.length === 0) endReadable(this); - if (ws.length) throw new Error('Calling transform done when ws.length != 0'); + if (ret !== null) this.emit('data', ret); - if (ts.transforming) throw new Error('Calling transform done when still transforming'); + return ret; +}; - return stream.push(null); +function chunkInvalid(state, chunk) { + var er = null; + if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + return er; } -},{"./_stream_duplex":451,"core-util-is":380,"inherits":428}],455:[function(require,module,exports){ -(function (process){ -// A bit simpler than readable streams. -// Implement an async ._write(chunk, encoding, cb), and it'll handle all -// the drain event emission and buffering. -'use strict'; +function onEofChunk(stream, state) { + if (state.ended) return; + if (state.decoder) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) { + state.buffer.push(chunk); + state.length += state.objectMode ? 1 : chunk.length; + } + } + state.ended = true; -module.exports = Writable; + // emit 'readable' now to make sure it gets picked up. + emitReadable(stream); +} -/**/ -var processNextTick = require('process-nextick-args'); -/**/ +// Don't emit readable right away in sync mode, because this can trigger +// another read() call => stack overflow. This way, it might trigger +// a nextTick recursion warning, but that's not so bad. +function emitReadable(stream) { + var state = stream._readableState; + state.needReadable = false; + if (!state.emittedReadable) { + debug('emitReadable', state.flowing); + state.emittedReadable = true; + if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream); + } +} -/**/ -var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick; -/**/ +function emitReadable_(stream) { + debug('emit readable'); + stream.emit('readable'); + flow(stream); +} -Writable.WritableState = WritableState; +// at this point, the user has presumably seen the 'readable' event, +// and called read() to consume some data. that may have triggered +// in turn another _read(n) call, in which case reading = true if +// it's in progress. +// However, if we're not ended, or reading, and the length < hwm, +// then go ahead and try to read some more preemptively. +function maybeReadMore(stream, state) { + if (!state.readingMore) { + state.readingMore = true; + processNextTick(maybeReadMore_, stream, state); + } +} -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ +function maybeReadMore_(stream, state) { + var len = state.length; + while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { + debug('maybeReadMore read 0'); + stream.read(0); + if (len === state.length) + // didn't get any data, stop spinning. + break;else len = state.length; + } + state.readingMore = false; +} -/**/ -var internalUtil = { - deprecate: require('util-deprecate') +// abstract method. to be overridden in specific implementation classes. +// call cb(er, data) where data is <= n in length. +// for virtual (non-string, non-buffer) streams, "length" is somewhat +// arbitrary, and perhaps not very meaningful. +Readable.prototype._read = function (n) { + this.emit('error', new Error('not implemented')); }; -/**/ - -/**/ -var Stream; -(function () { - try { - Stream = require('st' + 'ream'); - } catch (_) {} finally { - if (!Stream) Stream = require('events').EventEmitter; - } -})(); -/**/ -var Buffer = require('buffer').Buffer; -/**/ -var bufferShim = require('buffer-shims'); -/**/ +Readable.prototype.pipe = function (dest, pipeOpts) { + var src = this; + var state = this._readableState; -util.inherits(Writable, Stream); + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + case 1: + state.pipes = [state.pipes, dest]; + break; + default: + state.pipes.push(dest); + break; + } + state.pipesCount += 1; + debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); -function nop() {} + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; -function WriteReq(chunk, encoding, cb) { - this.chunk = chunk; - this.encoding = encoding; - this.callback = cb; - this.next = null; -} + var endFn = doEnd ? onend : cleanup; + if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn); -var Duplex; -function WritableState(options, stream) { - Duplex = Duplex || require('./_stream_duplex'); + dest.on('unpipe', onunpipe); + function onunpipe(readable) { + debug('onunpipe'); + if (readable === src) { + cleanup(); + } + } - options = options || {}; + function onend() { + debug('onend'); + dest.end(); + } - // object stream flag to indicate whether or not this stream - // contains buffers or objects. - this.objectMode = !!options.objectMode; + // when the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. + var ondrain = pipeOnDrain(src); + dest.on('drain', ondrain); - if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode; + var cleanedUp = false; + function cleanup() { + debug('cleanup'); + // cleanup event handlers once the pipe is broken + dest.removeListener('close', onclose); + dest.removeListener('finish', onfinish); + dest.removeListener('drain', ondrain); + dest.removeListener('error', onerror); + dest.removeListener('unpipe', onunpipe); + src.removeListener('end', onend); + src.removeListener('end', cleanup); + src.removeListener('data', ondata); - // the point at which write() starts returning false - // Note: 0 is a valid value, means that we always return false if - // the entire buffer is not flushed immediately on write() - var hwm = options.highWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; + cleanedUp = true; - // cast to ints. - this.highWaterMark = ~ ~this.highWaterMark; + // if the reader is waiting for a drain event from this + // specific writer, then it would cause it to never start + // flowing again. + // So, if this is awaiting a drain, then we just call it now. + // If we don't know, then assume that we are waiting for one. + if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); + } - this.needDrain = false; - // at the start of calling end() - this.ending = false; - // when end() has been called, and returned - this.ended = false; - // when 'finish' is emitted - this.finished = false; + src.on('data', ondata); + function ondata(chunk) { + debug('ondata'); + var ret = dest.write(chunk); + if (false === ret) { + // If the user unpiped during `dest.write()`, it is possible + // to get stuck in a permanently paused state if that write + // also returned false. + // => Check whether `dest` is still a piping destination. + if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { + debug('false write response, pause', src._readableState.awaitDrain); + src._readableState.awaitDrain++; + } + src.pause(); + } + } - // should we decode strings into buffers before passing to _write? - // this is here so that some node-core streams can optimize string - // handling at a lower level. - var noDecode = options.decodeStrings === false; - this.decodeStrings = !noDecode; + // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. + function onerror(er) { + debug('onerror', er); + unpipe(); + dest.removeListener('error', onerror); + if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); + } - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; + // Make sure our error handler is attached before userland ones. + prependListener(dest, 'error', onerror); - // not an actual buffer we keep track of, but a measurement - // of how much we're waiting to get pushed to some underlying - // socket or file. - this.length = 0; + // Both close and finish should trigger unpipe, but only once. + function onclose() { + dest.removeListener('finish', onfinish); + unpipe(); + } + dest.once('close', onclose); + function onfinish() { + debug('onfinish'); + dest.removeListener('close', onclose); + unpipe(); + } + dest.once('finish', onfinish); - // a flag to see when we're in the middle of a write. - this.writing = false; + function unpipe() { + debug('unpipe'); + src.unpipe(dest); + } - // when true all writes will be buffered until .uncork() call - this.corked = 0; + // tell the dest that it's being piped to + dest.emit('pipe', src); - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; + // start the flow if it hasn't been started already. + if (!state.flowing) { + debug('pipe resume'); + src.resume(); + } - // a flag to know if we're processing previously buffered items, which - // may call the _write() callback in the same tick, so that we don't - // end up in an overlapped onwrite situation. - this.bufferProcessing = false; + return dest; +}; - // the callback that's passed to _write(chunk,cb) - this.onwrite = function (er) { - onwrite(stream, er); +function pipeOnDrain(src) { + return function () { + var state = src._readableState; + debug('pipeOnDrain', state.awaitDrain); + if (state.awaitDrain) state.awaitDrain--; + if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { + state.flowing = true; + flow(src); + } }; +} - // the callback that the user supplies to write(chunk,encoding,cb) - this.writecb = null; - - // the amount that is being written when _write is called. - this.writelen = 0; +Readable.prototype.unpipe = function (dest) { + var state = this._readableState; - this.bufferedRequest = null; - this.lastBufferedRequest = null; + // if we're not piping anywhere, then do nothing. + if (state.pipesCount === 0) return this; - // number of pending user-supplied write callbacks - // this must be 0 before 'finish' can be emitted - this.pendingcb = 0; + // just one destination. most common case. + if (state.pipesCount === 1) { + // passed in one, but it's not the right one. + if (dest && dest !== state.pipes) return this; - // emit prefinish if the only thing we're waiting for is _write cbs - // This is relevant for synchronous Transform streams - this.prefinished = false; + if (!dest) dest = state.pipes; - // True if the error was already emitted and should not be thrown again - this.errorEmitted = false; + // got a match. + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) dest.emit('unpipe', this); + return this; + } - // count buffered requests - this.bufferedRequestCount = 0; + // slow case. multiple pipe destinations. - // allocate the first CorkedRequest, there is always - // one allocated and free to use, and we maintain at most two - this.corkedRequestsFree = new CorkedRequest(this); -} + if (!dest) { + // remove all. + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; -WritableState.prototype.getBuffer = function writableStateGetBuffer() { - var current = this.bufferedRequest; - var out = []; - while (current) { - out.push(current); - current = current.next; + for (var _i = 0; _i < len; _i++) { + dests[_i].emit('unpipe', this); + }return this; } - return out; -}; - -(function () { - try { - Object.defineProperty(WritableState.prototype, 'buffer', { - get: internalUtil.deprecate(function () { - return this.getBuffer(); - }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.') - }); - } catch (_) {} -})(); -var Duplex; -function Writable(options) { - Duplex = Duplex || require('./_stream_duplex'); + // try to find the right one. + var i = indexOf(state.pipes, dest); + if (i === -1) return this; - // Writable ctor is applied to Duplexes, though they're not - // instanceof Writable, they're instanceof Readable. - if (!(this instanceof Writable) && !(this instanceof Duplex)) return new Writable(options); + state.pipes.splice(i, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) state.pipes = state.pipes[0]; - this._writableState = new WritableState(options, this); + dest.emit('unpipe', this); - // legacy. - this.writable = true; + return this; +}; - if (options) { - if (typeof options.write === 'function') this._write = options.write; +// set up data events if they are asked for +// Ensure readable listeners eventually get something +Readable.prototype.on = function (ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); - if (typeof options.writev === 'function') this._writev = options.writev; + // If listening to data, and it has not explicitly been paused, + // then call resume to start the flow of data on the next tick. + if (ev === 'data' && false !== this._readableState.flowing) { + this.resume(); } - Stream.call(this); -} + if (ev === 'readable' && !this._readableState.endEmitted) { + var state = this._readableState; + if (!state.readableListening) { + state.readableListening = true; + state.emittedReadable = false; + state.needReadable = true; + if (!state.reading) { + processNextTick(nReadingNextTick, this); + } else if (state.length) { + emitReadable(this, state); + } + } + } -// Otherwise people can pipe Writable streams, which is just wrong. -Writable.prototype.pipe = function () { - this.emit('error', new Error('Cannot pipe, not readable')); + return res; }; +Readable.prototype.addListener = Readable.prototype.on; -function writeAfterEnd(stream, cb) { - var er = new Error('write after end'); - // TODO: defer error events consistently everywhere, not just the cb - stream.emit('error', er); - processNextTick(cb, er); -} - -// If we get something that is not a buffer, string, null, or undefined, -// and we're not in objectMode, then that's an error. -// Otherwise stream chunks are all considered to be of length=1, and the -// watermarks determine how many objects to keep in the buffer, rather than -// how many bytes or characters. -function validChunk(stream, state, chunk, cb) { - var valid = true; - var er = false; - // Always throw error if a null is written - // if we are not in object mode then throw - // if it is not a buffer, string, or undefined. - if (chunk === null) { - er = new TypeError('May not write null values to stream'); - } else if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); +function nReadingNextTick(self) { + debug('readable nexttick read 0'); + self.read(0); +} + +// pause() and resume() are remnants of the legacy readable stream API +// If the user uses them, then switch into old mode. +Readable.prototype.resume = function () { + var state = this._readableState; + if (!state.flowing) { + debug('resume'); + state.flowing = true; + resume(this, state); } - if (er) { - stream.emit('error', er); - processNextTick(cb, er); - valid = false; + return this; +}; + +function resume(stream, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + processNextTick(resume_, stream, state); } - return valid; } -Writable.prototype.write = function (chunk, encoding, cb) { - var state = this._writableState; - var ret = false; - - if (typeof encoding === 'function') { - cb = encoding; - encoding = null; +function resume_(stream, state) { + if (!state.reading) { + debug('resume read 0'); + stream.read(0); } - if (Buffer.isBuffer(chunk)) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; + state.resumeScheduled = false; + stream.emit('resume'); + flow(stream); + if (state.flowing && !state.reading) stream.read(0); +} - if (typeof cb !== 'function') cb = nop; +Readable.prototype.pause = function () { + debug('call pause flowing=%j', this._readableState.flowing); + if (false !== this._readableState.flowing) { + debug('pause'); + this._readableState.flowing = false; + this.emit('pause'); + } + return this; +}; - if (state.ended) writeAfterEnd(this, cb);else if (validChunk(this, state, chunk, cb)) { - state.pendingcb++; - ret = writeOrBuffer(this, state, chunk, encoding, cb); +function flow(stream) { + var state = stream._readableState; + debug('flow', state.flowing); + if (state.flowing) { + do { + var chunk = stream.read(); + } while (null !== chunk && state.flowing); } +} - return ret; -}; +// wrap an old-style stream as the async data source. +// This is *not* part of the readable stream interface. +// It is an ugly unfortunate mess of history. +Readable.prototype.wrap = function (stream) { + var state = this._readableState; + var paused = false; -Writable.prototype.cork = function () { - var state = this._writableState; + var self = this; + stream.on('end', function () { + debug('wrapped end'); + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) self.push(chunk); + } - state.corked++; -}; + self.push(null); + }); -Writable.prototype.uncork = function () { - var state = this._writableState; + stream.on('data', function (chunk) { + debug('wrapped data'); + if (state.decoder) chunk = state.decoder.write(chunk); - if (state.corked) { - state.corked--; + // don't skip over falsy values in objectMode + if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; - if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); + var ret = self.push(chunk); + if (!ret) { + paused = true; + stream.pause(); + } + }); + + // proxy all the other methods. + // important when wrapping filters and duplexes. + for (var i in stream) { + if (this[i] === undefined && typeof stream[i] === 'function') { + this[i] = function (method) { + return function () { + return stream[method].apply(stream, arguments); + }; + }(i); + } } -}; -Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { - // node::ParseEncoding() requires lower case. - if (typeof encoding === 'string') encoding = encoding.toLowerCase(); - if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); - this._writableState.defaultEncoding = encoding; - return this; -}; + // proxy certain important events. + var events = ['error', 'close', 'destroy', 'pause', 'resume']; + forEach(events, function (ev) { + stream.on(ev, self.emit.bind(self, ev)); + }); -function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { - chunk = bufferShim.from(chunk, encoding); - } - return chunk; -} + // when we try to consume some more bytes, simply unpause the + // underlying stream. + self._read = function (n) { + debug('wrapped _read', n); + if (paused) { + paused = false; + stream.resume(); + } + }; -// if we're already writing something, then just put this -// in the queue, and wait our turn. Otherwise, call _write -// If we return false, then we need a drain event, so set that flag. -function writeOrBuffer(stream, state, chunk, encoding, cb) { - chunk = decodeChunk(state, chunk, encoding); + return self; +}; - if (Buffer.isBuffer(chunk)) encoding = 'buffer'; - var len = state.objectMode ? 1 : chunk.length; +// exposed for testing purposes only. +Readable._fromList = fromList; - state.length += len; +// Pluck off n bytes from an array of buffers. +// Length is the combined lengths of all the buffers in the list. +function fromList(n, state) { + var list = state.buffer; + var length = state.length; + var stringMode = !!state.decoder; + var objectMode = !!state.objectMode; + var ret; - var ret = state.length < state.highWaterMark; - // we must ensure that previous needDrain will not be reset to false. - if (!ret) state.needDrain = true; + // nothing in the list, definitely empty. + if (list.length === 0) return null; - if (state.writing || state.corked) { - var last = state.lastBufferedRequest; - state.lastBufferedRequest = new WriteReq(chunk, encoding, cb); - if (last) { - last.next = state.lastBufferedRequest; + if (length === 0) ret = null;else if (objectMode) ret = list.shift();else if (!n || n >= length) { + // read it all, truncate the array. + if (stringMode) ret = list.join('');else if (list.length === 1) ret = list[0];else ret = Buffer.concat(list, length); + list.length = 0; + } else { + // read just some of it. + if (n < list[0].length) { + // just take a part of the first list item. + // slice is the same for buffers and strings. + var buf = list[0]; + ret = buf.slice(0, n); + list[0] = buf.slice(n); + } else if (n === list[0].length) { + // first list is a perfect match + ret = list.shift(); } else { - state.bufferedRequest = state.lastBufferedRequest; + // complex case. + // we have enough to cover it, but it spans past the first buffer. + if (stringMode) ret = '';else ret = bufferShim.allocUnsafe(n); + + var c = 0; + for (var i = 0, l = list.length; i < l && c < n; i++) { + var _buf = list[0]; + var cpy = Math.min(n - c, _buf.length); + + if (stringMode) ret += _buf.slice(0, cpy);else _buf.copy(ret, c, 0, cpy); + + if (cpy < _buf.length) list[0] = _buf.slice(cpy);else list.shift(); + + c += cpy; + } } - state.bufferedRequestCount += 1; - } else { - doWrite(stream, state, false, len, chunk, encoding, cb); } return ret; } -function doWrite(stream, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); - state.sync = false; +function endReadable(stream) { + var state = stream._readableState; + + // If we get here before consuming all the bytes, then that is a + // bug in node. Should never happen. + if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); + + if (!state.endEmitted) { + state.ended = true; + processNextTick(endReadableNT, state, stream); + } } -function onwriteError(stream, state, sync, er, cb) { - --state.pendingcb; - if (sync) processNextTick(cb, er);else cb(er); +function endReadableNT(state, stream) { + // Check that we didn't get one last unshift. + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); + } +} - stream._writableState.errorEmitted = true; - stream.emit('error', er); +function forEach(xs, f) { + for (var i = 0, l = xs.length; i < l; i++) { + f(xs[i], i); + } } -function onwriteStateUpdate(state) { - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; +function indexOf(xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; } +}).call(this,require('_process')) +},{"./_stream_duplex":452,"_process":443,"buffer":84,"buffer-shims":82,"core-util-is":381,"events":419,"inherits":429,"isarray":431,"process-nextick-args":442,"string_decoder/":478,"util":56}],455:[function(require,module,exports){ +// a transform stream is a readable/writable stream where you do +// something with the data. Sometimes it's called a "filter", +// but that's not a great name for it, since that implies a thing where +// some bits pass through, and others are simply ignored. (That would +// be a valid example of a transform, of course.) +// +// While the output is causally related to the input, it's not a +// necessarily symmetric or synchronous transformation. For example, +// a zlib stream might take multiple plain-text writes(), and then +// emit a single compressed chunk some time in the future. +// +// Here's how this works: +// +// The Transform stream has all the aspects of the readable and writable +// stream classes. When you write(chunk), that calls _write(chunk,cb) +// internally, and returns false if there's a lot of pending writes +// buffered up. When you call read(), that calls _read(n) until +// there's enough pending readable data buffered up. +// +// In a transform stream, the written data is placed in a buffer. When +// _read(n) is called, it transforms the queued up data, calling the +// buffered _write cb's as it consumes chunks. If consuming a single +// written chunk would result in multiple output chunks, then the first +// outputted bit calls the readcb, and subsequent chunks just go into +// the read buffer, and will cause it to emit 'readable' if necessary. +// +// This way, back-pressure is actually determined by the reading side, +// since _read has to be called to start processing a new chunk. However, +// a pathological inflate type of transform can cause excessive buffering +// here. For example, imagine a stream where every byte of input is +// interpreted as an integer from 0-255, and then results in that many +// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in +// 1kb of data being output. In this case, you could write a very small +// amount of input, and end up with a very large amount of output. In +// such a pathological inflating mechanism, there'd be no way to tell +// the system to stop doing the transform. A single 4MB write could +// cause the system to run out of memory. +// +// However, even in such a pathological case, only a single written chunk +// would be consumed, and then the rest would wait (un-transformed) until +// the results of the previous transformed chunk were consumed. -function onwrite(stream, er) { - var state = stream._writableState; - var sync = state.sync; - var cb = state.writecb; +'use strict'; - onwriteStateUpdate(state); +module.exports = Transform; - if (er) onwriteError(stream, state, sync, er, cb);else { - // Check if we're actually ready to finish, but don't emit yet - var finished = needFinish(state); +var Duplex = require('./_stream_duplex'); - if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { - clearBuffer(stream, state); - } +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ - if (sync) { - /**/ - asyncWrite(afterWrite, stream, state, finished, cb); - /**/ - } else { - afterWrite(stream, state, finished, cb); - } - } -} +util.inherits(Transform, Duplex); -function afterWrite(stream, state, finished, cb) { - if (!finished) onwriteDrain(stream, state); - state.pendingcb--; - cb(); - finishMaybe(stream, state); -} +function TransformState(stream) { + this.afterTransform = function (er, data) { + return afterTransform(stream, er, data); + }; -// Must force callback to be called on nextTick, so that we don't -// emit 'drain' before the write() consumer gets the 'false' return -// value, and has a chance to attach a 'drain' listener. -function onwriteDrain(stream, state) { - if (state.length === 0 && state.needDrain) { - state.needDrain = false; - stream.emit('drain'); - } + this.needTransform = false; + this.transforming = false; + this.writecb = null; + this.writechunk = null; + this.writeencoding = null; } -// if there's something in the buffer waiting, then process it -function clearBuffer(stream, state) { - state.bufferProcessing = true; - var entry = state.bufferedRequest; +function afterTransform(stream, er, data) { + var ts = stream._transformState; + ts.transforming = false; - if (stream._writev && entry && entry.next) { - // Fast case, write everything using _writev() - var l = state.bufferedRequestCount; - var buffer = new Array(l); - var holder = state.corkedRequestsFree; - holder.entry = entry; + var cb = ts.writecb; - var count = 0; - while (entry) { - buffer[count] = entry; - entry = entry.next; - count += 1; - } + if (!cb) return stream.emit('error', new Error('no writecb in Transform class')); - doWrite(stream, state, true, state.length, buffer, '', holder.finish); + ts.writechunk = null; + ts.writecb = null; - // doWrite is almost always async, defer these to save a bit of time - // as the hot path ends with doWrite - state.pendingcb++; - state.lastBufferedRequest = null; - if (holder.next) { - state.corkedRequestsFree = holder.next; - holder.next = null; - } else { - state.corkedRequestsFree = new CorkedRequest(state); - } - } else { - // Slow case, write chunks one-by-one - while (entry) { - var chunk = entry.chunk; - var encoding = entry.encoding; - var cb = entry.callback; - var len = state.objectMode ? 1 : chunk.length; + if (data !== null && data !== undefined) stream.push(data); - doWrite(stream, state, false, len, chunk, encoding, cb); - entry = entry.next; - // if we didn't call the onwrite immediately, then - // it means that we need to wait until it does. - // also, that means that the chunk and cb are currently - // being processed, so move the buffer counter past them. - if (state.writing) { - break; - } - } + cb(er); - if (entry === null) state.lastBufferedRequest = null; + var rs = stream._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + stream._read(rs.highWaterMark); } - - state.bufferedRequestCount = 0; - state.bufferedRequest = entry; - state.bufferProcessing = false; } -Writable.prototype._write = function (chunk, encoding, cb) { - cb(new Error('not implemented')); -}; +function Transform(options) { + if (!(this instanceof Transform)) return new Transform(options); -Writable.prototype._writev = null; + Duplex.call(this, options); -Writable.prototype.end = function (chunk, encoding, cb) { - var state = this._writableState; + this._transformState = new TransformState(this); - if (typeof chunk === 'function') { - cb = chunk; - chunk = null; - encoding = null; - } else if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } + // when the writable side finishes, then flush out anything remaining. + var stream = this; - if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); + // start out asking for a readable event once data is transformed. + this._readableState.needReadable = true; - // .end() fully uncorks - if (state.corked) { - state.corked = 1; - this.uncork(); + // we have implemented the _read method, and done the other things + // that Readable wants before the first _read call, so unset the + // sync guard flag. + this._readableState.sync = false; + + if (options) { + if (typeof options.transform === 'function') this._transform = options.transform; + + if (typeof options.flush === 'function') this._flush = options.flush; } - // ignore unnecessary end() calls. - if (!state.ending && !state.finished) endWritable(this, state, cb); + this.once('prefinish', function () { + if (typeof this._flush === 'function') this._flush(function (er) { + done(stream, er); + });else done(stream); + }); +} + +Transform.prototype.push = function (chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); }; -function needFinish(state) { - return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; -} +// This is the part where you do stuff! +// override this function in implementation classes. +// 'chunk' is an input chunk. +// +// Call `push(newChunk)` to pass along transformed output +// to the readable side. You may call 'push' zero or more times. +// +// Call `cb(err)` when you are done with this chunk. If you pass +// an error, then that'll put the hurt on the whole operation. If you +// never call cb(), then you'll never get another chunk. +Transform.prototype._transform = function (chunk, encoding, cb) { + throw new Error('Not implemented'); +}; -function prefinish(stream, state) { - if (!state.prefinished) { - state.prefinished = true; - stream.emit('prefinish'); +Transform.prototype._write = function (chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); } -} +}; -function finishMaybe(stream, state) { - var need = needFinish(state); - if (need) { - if (state.pendingcb === 0) { - prefinish(stream, state); - state.finished = true; - stream.emit('finish'); - } else { - prefinish(stream, state); - } - } - return need; -} +// Doesn't matter what the args are here. +// _transform does all the work. +// That we got here means that the readable side wants more data. +Transform.prototype._read = function (n) { + var ts = this._transformState; -function endWritable(stream, state, cb) { - state.ending = true; - finishMaybe(stream, state); - if (cb) { - if (state.finished) processNextTick(cb);else stream.once('finish', cb); + if (ts.writechunk !== null && ts.writecb && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + // mark that we need a transform, so that any data that comes in + // will get processed, now that we've asked for it. + ts.needTransform = true; } - state.ended = true; - stream.writable = false; -} +}; -// It seems a linked list but it is not -// there will be only 2 of these for each stream -function CorkedRequest(state) { - var _this = this; +function done(stream, er) { + if (er) return stream.emit('error', er); - this.next = null; - this.entry = null; + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided + var ws = stream._writableState; + var ts = stream._transformState; - this.finish = function (err) { - var entry = _this.entry; - _this.entry = null; - while (entry) { - var cb = entry.callback; - state.pendingcb--; - cb(err); - entry = entry.next; - } - if (state.corkedRequestsFree) { - state.corkedRequestsFree.next = _this; - } else { - state.corkedRequestsFree = _this; - } - }; -} -}).call(this,require('_process')) -},{"./_stream_duplex":451,"_process":442,"buffer":83,"buffer-shims":81,"core-util-is":380,"events":418,"inherits":428,"process-nextick-args":441,"util-deprecate":479}],456:[function(require,module,exports){ -module.exports = require("./lib/_stream_passthrough.js") + if (ws.length) throw new Error('Calling transform done when ws.length != 0'); -},{"./lib/_stream_passthrough.js":452}],457:[function(require,module,exports){ -(function (process){ -var Stream = (function (){ - try { - return require('st' + 'ream'); // hack to fix a circular dependency issue when used with browserify - } catch(_){} -}()); -exports = module.exports = require('./lib/_stream_readable.js'); -exports.Stream = Stream || exports; -exports.Readable = exports; -exports.Writable = require('./lib/_stream_writable.js'); -exports.Duplex = require('./lib/_stream_duplex.js'); -exports.Transform = require('./lib/_stream_transform.js'); -exports.PassThrough = require('./lib/_stream_passthrough.js'); + if (ts.transforming) throw new Error('Calling transform done when still transforming'); -if (!process.browser && process.env.READABLE_STREAM === 'disable' && Stream) { - module.exports = Stream; + return stream.push(null); } +},{"./_stream_duplex":452,"core-util-is":381,"inherits":429}],456:[function(require,module,exports){ +(function (process){ +// A bit simpler than readable streams. +// Implement an async ._write(chunk, encoding, cb), and it'll handle all +// the drain event emission and buffering. -}).call(this,require('_process')) -},{"./lib/_stream_duplex.js":451,"./lib/_stream_passthrough.js":452,"./lib/_stream_readable.js":453,"./lib/_stream_transform.js":454,"./lib/_stream_writable.js":455,"_process":442}],458:[function(require,module,exports){ -module.exports = require("./lib/_stream_transform.js") - -},{"./lib/_stream_transform.js":454}],459:[function(require,module,exports){ -module.exports = require("./lib/_stream_writable.js") - -},{"./lib/_stream_writable.js":455}],460:[function(require,module,exports){ -(function (process,global){ -/** - * Copyright (c) 2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * https://raw.github.com/facebook/regenerator/master/LICENSE file. An - * additional grant of patent rights can be found in the PATENTS file in - * the same directory. - */ - -!(function(global) { - "use strict"; +'use strict'; - var hasOwn = Object.prototype.hasOwnProperty; - var undefined; // More compressible than void 0. - var $Symbol = typeof Symbol === "function" ? Symbol : {}; - var iteratorSymbol = $Symbol.iterator || "@@iterator"; - var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; +module.exports = Writable; - var inModule = typeof module === "object"; - var runtime = global.regeneratorRuntime; - if (runtime) { - if (inModule) { - // If regeneratorRuntime is defined globally and we're in a module, - // make the exports object identical to regeneratorRuntime. - module.exports = runtime; - } - // Don't bother evaluating the rest of this file if the runtime was - // already defined globally. - return; - } +/**/ +var processNextTick = require('process-nextick-args'); +/**/ - // Define the runtime globally (as expected by generated code) as either - // module.exports (if we're in a module) or a new, empty object. - runtime = global.regeneratorRuntime = inModule ? module.exports : {}; +/**/ +var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick; +/**/ - function wrap(innerFn, outerFn, self, tryLocsList) { - // If outerFn provided, then outerFn.prototype instanceof Generator. - var generator = Object.create((outerFn || Generator).prototype); - var context = new Context(tryLocsList || []); +Writable.WritableState = WritableState; - // The ._invoke method unifies the implementations of the .next, - // .throw, and .return methods. - generator._invoke = makeInvokeMethod(innerFn, self, context); +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ - return generator; - } - runtime.wrap = wrap; +/**/ +var internalUtil = { + deprecate: require('util-deprecate') +}; +/**/ - // Try/catch helper to minimize deoptimizations. Returns a completion - // record like context.tryEntries[i].completion. This interface could - // have been (and was previously) designed to take a closure to be - // invoked without arguments, but in all the cases we care about we - // already have an existing method we want to call, so there's no need - // to create a new function object. We can even get away with assuming - // the method takes exactly one argument, since that happens to be true - // in every case, so we don't have to touch the arguments object. The - // only additional allocation required is the completion record, which - // has a stable shape and so hopefully should be cheap to allocate. - function tryCatch(fn, obj, arg) { - try { - return { type: "normal", arg: fn.call(obj, arg) }; - } catch (err) { - return { type: "throw", arg: err }; - } +/**/ +var Stream; +(function () { + try { + Stream = require('st' + 'ream'); + } catch (_) {} finally { + if (!Stream) Stream = require('events').EventEmitter; } +})(); +/**/ - var GenStateSuspendedStart = "suspendedStart"; - var GenStateSuspendedYield = "suspendedYield"; - var GenStateExecuting = "executing"; - var GenStateCompleted = "completed"; +var Buffer = require('buffer').Buffer; +/**/ +var bufferShim = require('buffer-shims'); +/**/ - // Returning this object from the innerFn has the same effect as - // breaking out of the dispatch switch statement. - var ContinueSentinel = {}; +util.inherits(Writable, Stream); - // Dummy constructor functions that we use as the .constructor and - // .constructor.prototype properties for functions that return Generator - // objects. For full spec compliance, you may wish to configure your - // minifier not to mangle the names of these two functions. - function Generator() {} - function GeneratorFunction() {} - function GeneratorFunctionPrototype() {} +function nop() {} - var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype; - GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; - GeneratorFunctionPrototype.constructor = GeneratorFunction; - GeneratorFunctionPrototype[toStringTagSymbol] = GeneratorFunction.displayName = "GeneratorFunction"; +function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; + this.next = null; +} - // Helper for defining the .next, .throw, and .return methods of the - // Iterator interface in terms of a single ._invoke method. - function defineIteratorMethods(prototype) { - ["next", "throw", "return"].forEach(function(method) { - prototype[method] = function(arg) { - return this._invoke(method, arg); - }; - }); - } +var Duplex; +function WritableState(options, stream) { + Duplex = Duplex || require('./_stream_duplex'); - runtime.isGeneratorFunction = function(genFun) { - var ctor = typeof genFun === "function" && genFun.constructor; - return ctor - ? ctor === GeneratorFunction || - // For the native GeneratorFunction constructor, the best we can - // do is to check its .name property. - (ctor.displayName || ctor.name) === "GeneratorFunction" - : false; - }; + options = options || {}; - runtime.mark = function(genFun) { - if (Object.setPrototypeOf) { - Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); - } else { - genFun.__proto__ = GeneratorFunctionPrototype; - if (!(toStringTagSymbol in genFun)) { - genFun[toStringTagSymbol] = "GeneratorFunction"; - } - } - genFun.prototype = Object.create(Gp); - return genFun; - }; + // object stream flag to indicate whether or not this stream + // contains buffers or objects. + this.objectMode = !!options.objectMode; - // Within the body of any async function, `await x` is transformed to - // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test - // `value instanceof AwaitArgument` to determine if the yielded value is - // meant to be awaited. Some may consider the name of this method too - // cutesy, but they are curmudgeons. - runtime.awrap = function(arg) { - return new AwaitArgument(arg); - }; + if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode; - function AwaitArgument(arg) { - this.arg = arg; - } + // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() + var hwm = options.highWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; - function AsyncIterator(generator) { - function invoke(method, arg, resolve, reject) { - var record = tryCatch(generator[method], generator, arg); - if (record.type === "throw") { - reject(record.arg); - } else { - var result = record.arg; - var value = result.value; - if (value instanceof AwaitArgument) { - return Promise.resolve(value.arg).then(function(value) { - invoke("next", value, resolve, reject); - }, function(err) { - invoke("throw", err, resolve, reject); - }); - } + // cast to ints. + this.highWaterMark = ~ ~this.highWaterMark; - return Promise.resolve(value).then(function(unwrapped) { - // When a yielded Promise is resolved, its final value becomes - // the .value of the Promise<{value,done}> result for the - // current iteration. If the Promise is rejected, however, the - // result for this iteration will be rejected with the same - // reason. Note that rejections of yielded Promises are not - // thrown back into the generator function, as is the case - // when an awaited Promise is rejected. This difference in - // behavior between yield and await is important, because it - // allows the consumer to decide what to do with the yielded - // rejection (swallow it and continue, manually .throw it back - // into the generator, abandon iteration, whatever). With - // await, by contrast, there is no opportunity to examine the - // rejection reason outside the generator function, so the - // only option is to throw it from the await expression, and - // let the generator function handle the exception. - result.value = unwrapped; - resolve(result); - }, reject); - } - } + this.needDrain = false; + // at the start of calling end() + this.ending = false; + // when end() has been called, and returned + this.ended = false; + // when 'finish' is emitted + this.finished = false; - if (typeof process === "object" && process.domain) { - invoke = process.domain.bind(invoke); - } + // should we decode strings into buffers before passing to _write? + // this is here so that some node-core streams can optimize string + // handling at a lower level. + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; - var previousPromise; + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; - function enqueue(method, arg) { - function callInvokeWithMethodAndArg() { - return new Promise(function(resolve, reject) { - invoke(method, arg, resolve, reject); - }); - } + // not an actual buffer we keep track of, but a measurement + // of how much we're waiting to get pushed to some underlying + // socket or file. + this.length = 0; - return previousPromise = - // If enqueue has been called before, then we want to wait until - // all previous Promises have been resolved before calling invoke, - // so that results are always delivered in the correct order. If - // enqueue has not been called before, then it is important to - // call invoke immediately, without waiting on a callback to fire, - // so that the async generator function has the opportunity to do - // any necessary setup in a predictable way. This predictability - // is why the Promise constructor synchronously invokes its - // executor callback, and why async functions synchronously - // execute code before the first await. Since we implement simple - // async functions in terms of async generators, it is especially - // important to get this right, even though it requires care. - previousPromise ? previousPromise.then( - callInvokeWithMethodAndArg, - // Avoid propagating failures to Promises returned by later - // invocations of the iterator. - callInvokeWithMethodAndArg - ) : callInvokeWithMethodAndArg(); - } + // a flag to see when we're in the middle of a write. + this.writing = false; - // Define the unified helper method that is used to implement .next, - // .throw, and .return (see defineIteratorMethods). - this._invoke = enqueue; - } + // when true all writes will be buffered until .uncork() call + this.corked = 0; - defineIteratorMethods(AsyncIterator.prototype); + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; - // Note that simple async functions are implemented on top of - // AsyncIterator objects; they just return a Promise for the value of - // the final result produced by the iterator. - runtime.async = function(innerFn, outerFn, self, tryLocsList) { - var iter = new AsyncIterator( - wrap(innerFn, outerFn, self, tryLocsList) - ); + // a flag to know if we're processing previously buffered items, which + // may call the _write() callback in the same tick, so that we don't + // end up in an overlapped onwrite situation. + this.bufferProcessing = false; - return runtime.isGeneratorFunction(outerFn) - ? iter // If outerFn is a generator, return the full iterator. - : iter.next().then(function(result) { - return result.done ? result.value : iter.next(); - }); + // the callback that's passed to _write(chunk,cb) + this.onwrite = function (er) { + onwrite(stream, er); }; - function makeInvokeMethod(innerFn, self, context) { - var state = GenStateSuspendedStart; - - return function invoke(method, arg) { - if (state === GenStateExecuting) { - throw new Error("Generator is already running"); - } - - if (state === GenStateCompleted) { - if (method === "throw") { - throw arg; - } + // the callback that the user supplies to write(chunk,encoding,cb) + this.writecb = null; - // Be forgiving, per 25.3.3.3.3 of the spec: - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume - return doneResult(); - } + // the amount that is being written when _write is called. + this.writelen = 0; - while (true) { - var delegate = context.delegate; - if (delegate) { - if (method === "return" || - (method === "throw" && delegate.iterator[method] === undefined)) { - // A return or throw (when the delegate iterator has no throw - // method) always terminates the yield* loop. - context.delegate = null; + this.bufferedRequest = null; + this.lastBufferedRequest = null; - // If the delegate iterator has a return method, give it a - // chance to clean up. - var returnMethod = delegate.iterator["return"]; - if (returnMethod) { - var record = tryCatch(returnMethod, delegate.iterator, arg); - if (record.type === "throw") { - // If the return method threw an exception, let that - // exception prevail over the original return or throw. - method = "throw"; - arg = record.arg; - continue; - } - } + // number of pending user-supplied write callbacks + // this must be 0 before 'finish' can be emitted + this.pendingcb = 0; - if (method === "return") { - // Continue with the outer return, now that the delegate - // iterator has been terminated. - continue; - } - } + // emit prefinish if the only thing we're waiting for is _write cbs + // This is relevant for synchronous Transform streams + this.prefinished = false; - var record = tryCatch( - delegate.iterator[method], - delegate.iterator, - arg - ); + // True if the error was already emitted and should not be thrown again + this.errorEmitted = false; - if (record.type === "throw") { - context.delegate = null; + // count buffered requests + this.bufferedRequestCount = 0; - // Like returning generator.throw(uncaught), but without the - // overhead of an extra function call. - method = "throw"; - arg = record.arg; - continue; - } + // allocate the first CorkedRequest, there is always + // one allocated and free to use, and we maintain at most two + this.corkedRequestsFree = new CorkedRequest(this); +} - // Delegate generator ran and handled its own exceptions so - // regardless of what the method was, we continue as if it is - // "next" with an undefined arg. - method = "next"; - arg = undefined; +WritableState.prototype.getBuffer = function writableStateGetBuffer() { + var current = this.bufferedRequest; + var out = []; + while (current) { + out.push(current); + current = current.next; + } + return out; +}; - var info = record.arg; - if (info.done) { - context[delegate.resultName] = info.value; - context.next = delegate.nextLoc; - } else { - state = GenStateSuspendedYield; - return info; - } +(function () { + try { + Object.defineProperty(WritableState.prototype, 'buffer', { + get: internalUtil.deprecate(function () { + return this.getBuffer(); + }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.') + }); + } catch (_) {} +})(); - context.delegate = null; - } +var Duplex; +function Writable(options) { + Duplex = Duplex || require('./_stream_duplex'); - if (method === "next") { - // Setting context._sent for legacy support of Babel's - // function.sent implementation. - context.sent = context._sent = arg; + // Writable ctor is applied to Duplexes, though they're not + // instanceof Writable, they're instanceof Readable. + if (!(this instanceof Writable) && !(this instanceof Duplex)) return new Writable(options); - } else if (method === "throw") { - if (state === GenStateSuspendedStart) { - state = GenStateCompleted; - throw arg; - } + this._writableState = new WritableState(options, this); - if (context.dispatchException(arg)) { - // If the dispatched exception was caught by a catch block, - // then let that catch block handle the exception normally. - method = "next"; - arg = undefined; - } + // legacy. + this.writable = true; - } else if (method === "return") { - context.abrupt("return", arg); - } + if (options) { + if (typeof options.write === 'function') this._write = options.write; - state = GenStateExecuting; + if (typeof options.writev === 'function') this._writev = options.writev; + } - var record = tryCatch(innerFn, self, context); - if (record.type === "normal") { - // If an exception is thrown from innerFn, we leave state === - // GenStateExecuting and loop back for another invocation. - state = context.done - ? GenStateCompleted - : GenStateSuspendedYield; + Stream.call(this); +} - var info = { - value: record.arg, - done: context.done - }; +// Otherwise people can pipe Writable streams, which is just wrong. +Writable.prototype.pipe = function () { + this.emit('error', new Error('Cannot pipe, not readable')); +}; - if (record.arg === ContinueSentinel) { - if (context.delegate && method === "next") { - // Deliberately forget the last sent value so that we don't - // accidentally pass it on to the delegate. - arg = undefined; - } - } else { - return info; - } +function writeAfterEnd(stream, cb) { + var er = new Error('write after end'); + // TODO: defer error events consistently everywhere, not just the cb + stream.emit('error', er); + processNextTick(cb, er); +} - } else if (record.type === "throw") { - state = GenStateCompleted; - // Dispatch the exception by looping back around to the - // context.dispatchException(arg) call above. - method = "throw"; - arg = record.arg; - } - } - }; +// If we get something that is not a buffer, string, null, or undefined, +// and we're not in objectMode, then that's an error. +// Otherwise stream chunks are all considered to be of length=1, and the +// watermarks determine how many objects to keep in the buffer, rather than +// how many bytes or characters. +function validChunk(stream, state, chunk, cb) { + var valid = true; + var er = false; + // Always throw error if a null is written + // if we are not in object mode then throw + // if it is not a buffer, string, or undefined. + if (chunk === null) { + er = new TypeError('May not write null values to stream'); + } else if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + if (er) { + stream.emit('error', er); + processNextTick(cb, er); + valid = false; + } + return valid; +} + +Writable.prototype.write = function (chunk, encoding, cb) { + var state = this._writableState; + var ret = false; + + if (typeof encoding === 'function') { + cb = encoding; + encoding = null; } - // Define Generator.prototype.{next,throw,return} in terms of the - // unified ._invoke helper method. - defineIteratorMethods(Gp); + if (Buffer.isBuffer(chunk)) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; - Gp[iteratorSymbol] = function() { - return this; - }; + if (typeof cb !== 'function') cb = nop; - Gp[toStringTagSymbol] = "Generator"; + if (state.ended) writeAfterEnd(this, cb);else if (validChunk(this, state, chunk, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, chunk, encoding, cb); + } - Gp.toString = function() { - return "[object Generator]"; - }; + return ret; +}; - function pushTryEntry(locs) { - var entry = { tryLoc: locs[0] }; +Writable.prototype.cork = function () { + var state = this._writableState; - if (1 in locs) { - entry.catchLoc = locs[1]; - } + state.corked++; +}; - if (2 in locs) { - entry.finallyLoc = locs[2]; - entry.afterLoc = locs[3]; - } +Writable.prototype.uncork = function () { + var state = this._writableState; - this.tryEntries.push(entry); - } + if (state.corked) { + state.corked--; - function resetTryEntry(entry) { - var record = entry.completion || {}; - record.type = "normal"; - delete record.arg; - entry.completion = record; + if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); } +}; - function Context(tryLocsList) { - // The root entry object (effectively a try statement without a catch - // or a finally block) gives us a place to store values thrown from - // locations where there is no enclosing try statement. - this.tryEntries = [{ tryLoc: "root" }]; - tryLocsList.forEach(pushTryEntry, this); - this.reset(true); +Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + // node::ParseEncoding() requires lower case. + if (typeof encoding === 'string') encoding = encoding.toLowerCase(); + if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); + this._writableState.defaultEncoding = encoding; + return this; +}; + +function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { + chunk = bufferShim.from(chunk, encoding); } + return chunk; +} - runtime.keys = function(object) { - var keys = []; - for (var key in object) { - keys.push(key); - } - keys.reverse(); +// if we're already writing something, then just put this +// in the queue, and wait our turn. Otherwise, call _write +// If we return false, then we need a drain event, so set that flag. +function writeOrBuffer(stream, state, chunk, encoding, cb) { + chunk = decodeChunk(state, chunk, encoding); - // Rather than returning an object with a next method, we keep - // things simple and return the next function itself. - return function next() { - while (keys.length) { - var key = keys.pop(); - if (key in object) { - next.value = key; - next.done = false; - return next; - } - } + if (Buffer.isBuffer(chunk)) encoding = 'buffer'; + var len = state.objectMode ? 1 : chunk.length; - // To avoid creating an additional object, we just hang the .value - // and .done properties off the next function object itself. This - // also ensures that the minifier will not anonymize the function. - next.done = true; - return next; - }; - }; + state.length += len; - function values(iterable) { - if (iterable) { - var iteratorMethod = iterable[iteratorSymbol]; - if (iteratorMethod) { - return iteratorMethod.call(iterable); - } + var ret = state.length < state.highWaterMark; + // we must ensure that previous needDrain will not be reset to false. + if (!ret) state.needDrain = true; - if (typeof iterable.next === "function") { - return iterable; - } + if (state.writing || state.corked) { + var last = state.lastBufferedRequest; + state.lastBufferedRequest = new WriteReq(chunk, encoding, cb); + if (last) { + last.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; + } + state.bufferedRequestCount += 1; + } else { + doWrite(stream, state, false, len, chunk, encoding, cb); + } - if (!isNaN(iterable.length)) { - var i = -1, next = function next() { - while (++i < iterable.length) { - if (hasOwn.call(iterable, i)) { - next.value = iterable[i]; - next.done = false; - return next; - } - } + return ret; +} - next.value = undefined; - next.done = true; +function doWrite(stream, state, writev, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); + state.sync = false; +} - return next; - }; +function onwriteError(stream, state, sync, er, cb) { + --state.pendingcb; + if (sync) processNextTick(cb, er);else cb(er); - return next.next = next; - } - } + stream._writableState.errorEmitted = true; + stream.emit('error', er); +} - // Return an iterator with no values. - return { next: doneResult }; - } - runtime.values = values; +function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; +} - function doneResult() { - return { value: undefined, done: true }; - } +function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; - Context.prototype = { - constructor: Context, + onwriteStateUpdate(state); - reset: function(skipTempReset) { - this.prev = 0; - this.next = 0; - // Resetting context._sent for legacy support of Babel's - // function.sent implementation. - this.sent = this._sent = undefined; - this.done = false; - this.delegate = null; + if (er) onwriteError(stream, state, sync, er, cb);else { + // Check if we're actually ready to finish, but don't emit yet + var finished = needFinish(state); - this.tryEntries.forEach(resetTryEntry); + if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { + clearBuffer(stream, state); + } - if (!skipTempReset) { - for (var name in this) { - // Not sure about the optimal order of these conditions: - if (name.charAt(0) === "t" && - hasOwn.call(this, name) && - !isNaN(+name.slice(1))) { - this[name] = undefined; - } - } + if (sync) { + /**/ + asyncWrite(afterWrite, stream, state, finished, cb); + /**/ + } else { + afterWrite(stream, state, finished, cb); } - }, + } +} - stop: function() { - this.done = true; +function afterWrite(stream, state, finished, cb) { + if (!finished) onwriteDrain(stream, state); + state.pendingcb--; + cb(); + finishMaybe(stream, state); +} - var rootEntry = this.tryEntries[0]; - var rootRecord = rootEntry.completion; - if (rootRecord.type === "throw") { - throw rootRecord.arg; - } +// Must force callback to be called on nextTick, so that we don't +// emit 'drain' before the write() consumer gets the 'false' return +// value, and has a chance to attach a 'drain' listener. +function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit('drain'); + } +} - return this.rval; - }, +// if there's something in the buffer waiting, then process it +function clearBuffer(stream, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; - dispatchException: function(exception) { - if (this.done) { - throw exception; - } + if (stream._writev && entry && entry.next) { + // Fast case, write everything using _writev() + var l = state.bufferedRequestCount; + var buffer = new Array(l); + var holder = state.corkedRequestsFree; + holder.entry = entry; - var context = this; - function handle(loc, caught) { - record.type = "throw"; - record.arg = exception; - context.next = loc; - return !!caught; - } + var count = 0; + while (entry) { + buffer[count] = entry; + entry = entry.next; + count += 1; + } - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - var record = entry.completion; + doWrite(stream, state, true, state.length, buffer, '', holder.finish); - if (entry.tryLoc === "root") { - // Exception thrown outside of any try block that could handle - // it, so set the completion value of the entire function to - // throw the exception. - return handle("end"); - } + // doWrite is almost always async, defer these to save a bit of time + // as the hot path ends with doWrite + state.pendingcb++; + state.lastBufferedRequest = null; + if (holder.next) { + state.corkedRequestsFree = holder.next; + holder.next = null; + } else { + state.corkedRequestsFree = new CorkedRequest(state); + } + } else { + // Slow case, write chunks one-by-one + while (entry) { + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; - if (entry.tryLoc <= this.prev) { - var hasCatch = hasOwn.call(entry, "catchLoc"); - var hasFinally = hasOwn.call(entry, "finallyLoc"); + doWrite(stream, state, false, len, chunk, encoding, cb); + entry = entry.next; + // if we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + if (state.writing) { + break; + } + } - if (hasCatch && hasFinally) { - if (this.prev < entry.catchLoc) { - return handle(entry.catchLoc, true); - } else if (this.prev < entry.finallyLoc) { - return handle(entry.finallyLoc); - } + if (entry === null) state.lastBufferedRequest = null; + } - } else if (hasCatch) { - if (this.prev < entry.catchLoc) { - return handle(entry.catchLoc, true); - } + state.bufferedRequestCount = 0; + state.bufferedRequest = entry; + state.bufferProcessing = false; +} - } else if (hasFinally) { - if (this.prev < entry.finallyLoc) { - return handle(entry.finallyLoc); - } +Writable.prototype._write = function (chunk, encoding, cb) { + cb(new Error('not implemented')); +}; - } else { - throw new Error("try statement without catch or finally"); - } - } - } - }, +Writable.prototype._writev = null; - abrupt: function(type, arg) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.tryLoc <= this.prev && - hasOwn.call(entry, "finallyLoc") && - this.prev < entry.finallyLoc) { - var finallyEntry = entry; - break; - } - } +Writable.prototype.end = function (chunk, encoding, cb) { + var state = this._writableState; - if (finallyEntry && - (type === "break" || - type === "continue") && - finallyEntry.tryLoc <= arg && - arg <= finallyEntry.finallyLoc) { - // Ignore the finally entry if control is not jumping to a - // location outside the try/catch block. - finallyEntry = null; - } + if (typeof chunk === 'function') { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } - var record = finallyEntry ? finallyEntry.completion : {}; - record.type = type; - record.arg = arg; + if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); - if (finallyEntry) { - this.next = finallyEntry.finallyLoc; - } else { - this.complete(record); - } + // .end() fully uncorks + if (state.corked) { + state.corked = 1; + this.uncork(); + } - return ContinueSentinel; - }, + // ignore unnecessary end() calls. + if (!state.ending && !state.finished) endWritable(this, state, cb); +}; - complete: function(record, afterLoc) { - if (record.type === "throw") { - throw record.arg; - } +function needFinish(state) { + return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; +} - if (record.type === "break" || - record.type === "continue") { - this.next = record.arg; - } else if (record.type === "return") { - this.rval = record.arg; - this.next = "end"; - } else if (record.type === "normal" && afterLoc) { - this.next = afterLoc; - } - }, +function prefinish(stream, state) { + if (!state.prefinished) { + state.prefinished = true; + stream.emit('prefinish'); + } +} - finish: function(finallyLoc) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.finallyLoc === finallyLoc) { - this.complete(entry.completion, entry.afterLoc); - resetTryEntry(entry); - return ContinueSentinel; - } - } - }, +function finishMaybe(stream, state) { + var need = needFinish(state); + if (need) { + if (state.pendingcb === 0) { + prefinish(stream, state); + state.finished = true; + stream.emit('finish'); + } else { + prefinish(stream, state); + } + } + return need; +} - "catch": function(tryLoc) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.tryLoc === tryLoc) { - var record = entry.completion; - if (record.type === "throw") { - var thrown = record.arg; - resetTryEntry(entry); - } - return thrown; - } - } +function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); + if (cb) { + if (state.finished) processNextTick(cb);else stream.once('finish', cb); + } + state.ended = true; + stream.writable = false; +} - // The context.catch method must only be called with a location - // argument that corresponds to a known catch block. - throw new Error("illegal catch attempt"); - }, +// It seems a linked list but it is not +// there will be only 2 of these for each stream +function CorkedRequest(state) { + var _this = this; - delegateYield: function(iterable, resultName, nextLoc) { - this.delegate = { - iterator: values(iterable), - resultName: resultName, - nextLoc: nextLoc - }; + this.next = null; + this.entry = null; - return ContinueSentinel; + this.finish = function (err) { + var entry = _this.entry; + _this.entry = null; + while (entry) { + var cb = entry.callback; + state.pendingcb--; + cb(err); + entry = entry.next; + } + if (state.corkedRequestsFree) { + state.corkedRequestsFree.next = _this; + } else { + state.corkedRequestsFree = _this; } }; -})( - // Among the various tricks for obtaining a reference to the global - // object, this seems to be the most reliable technique that does not - // use indirect eval (which violates Content Security Policy). - typeof global === "object" ? global : - typeof window === "object" ? window : - typeof self === "object" ? self : this -); +} +}).call(this,require('_process')) +},{"./_stream_duplex":452,"_process":443,"buffer":84,"buffer-shims":82,"core-util-is":381,"events":419,"inherits":429,"process-nextick-args":442,"util-deprecate":479}],457:[function(require,module,exports){ +module.exports = require("./lib/_stream_passthrough.js") -}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"_process":442}],461:[function(require,module,exports){ +},{"./lib/_stream_passthrough.js":453}],458:[function(require,module,exports){ +(function (process){ +var Stream = (function (){ + try { + return require('st' + 'ream'); // hack to fix a circular dependency issue when used with browserify + } catch(_){} +}()); +exports = module.exports = require('./lib/_stream_readable.js'); +exports.Stream = Stream || exports; +exports.Readable = exports; +exports.Writable = require('./lib/_stream_writable.js'); +exports.Duplex = require('./lib/_stream_duplex.js'); +exports.Transform = require('./lib/_stream_transform.js'); +exports.PassThrough = require('./lib/_stream_passthrough.js'); + +if (!process.browser && process.env.READABLE_STREAM === 'disable' && Stream) { + module.exports = Stream; +} + +}).call(this,require('_process')) +},{"./lib/_stream_duplex.js":452,"./lib/_stream_passthrough.js":453,"./lib/_stream_readable.js":454,"./lib/_stream_transform.js":455,"./lib/_stream_writable.js":456,"_process":443}],459:[function(require,module,exports){ +module.exports = require("./lib/_stream_transform.js") + +},{"./lib/_stream_transform.js":455}],460:[function(require,module,exports){ +module.exports = require("./lib/_stream_writable.js") + +},{"./lib/_stream_writable.js":456}],461:[function(require,module,exports){ (function (Buffer){ /* CryptoJS v3.1.2 @@ -65640,7 +65571,7 @@ function ripemd160 (message) { module.exports = ripemd160 }).call(this,require("buffer").Buffer) -},{"buffer":83}],462:[function(require,module,exports){ +},{"buffer":84}],462:[function(require,module,exports){ (function (Buffer){ const assert = require('assert') /** @@ -65873,7 +65804,7 @@ function toBuffer (v) { } }).call(this,require("buffer").Buffer) -},{"assert":48,"buffer":83}],463:[function(require,module,exports){ +},{"assert":48,"buffer":84}],463:[function(require,module,exports){ (function (Buffer){ var pbkdf2Sync = require('pbkdf2').pbkdf2Sync @@ -66056,7 +65987,7 @@ function arraycopy (src, srcPos, dest, destPos, length) { module.exports = scrypt }).call(this,require("buffer").Buffer) -},{"buffer":83,"pbkdf2":440}],464:[function(require,module,exports){ +},{"buffer":84,"pbkdf2":441}],464:[function(require,module,exports){ 'use strict' module.exports = require('./lib')(require('./lib/elliptic')) @@ -66108,7 +66039,7 @@ exports.isNumberInInterval = function (number, x, y, message) { } }).call(this,{"isBuffer":require("../../is-buffer/index.js")}) -},{"../../is-buffer/index.js":429}],466:[function(require,module,exports){ +},{"../../is-buffer/index.js":430}],466:[function(require,module,exports){ (function (Buffer){ 'use strict' var createHash = require('create-hash') @@ -66359,7 +66290,7 @@ exports.ecdhUnsafe = function (publicKey, privateKey, compressed) { } }).call(this,require("buffer").Buffer) -},{"../messages.json":468,"bn.js":53,"buffer":83,"create-hash":382,"elliptic":397}],467:[function(require,module,exports){ +},{"../messages.json":468,"bn.js":54,"buffer":84,"create-hash":383,"elliptic":398}],467:[function(require,module,exports){ (function (Buffer){ 'use strict' var bip66 = require('bip66') @@ -66679,7 +66610,7 @@ module.exports = function (secp256k1) { } }).call(this,require("buffer").Buffer) -},{"./assert":465,"./messages.json":468,"bip66":52,"buffer":83}],468:[function(require,module,exports){ +},{"./assert":465,"./messages.json":468,"bip66":53,"buffer":84}],468:[function(require,module,exports){ module.exports={ "COMPRESSED_TYPE_INVALID": "compressed should be a boolean", "EC_PRIVATE_KEY_TYPE_INVALID": "private key should be a Buffer", @@ -66790,7 +66721,7 @@ Hash.prototype._update = function () { module.exports = Hash }).call(this,require("buffer").Buffer) -},{"buffer":83}],470:[function(require,module,exports){ +},{"buffer":84}],470:[function(require,module,exports){ var exports = module.exports = function SHA (algorithm) { algorithm = algorithm.toLowerCase() @@ -66904,7 +66835,7 @@ Sha.prototype._hash = function () { module.exports = Sha }).call(this,require("buffer").Buffer) -},{"./hash":469,"buffer":83,"inherits":428}],472:[function(require,module,exports){ +},{"./hash":469,"buffer":84,"inherits":429}],472:[function(require,module,exports){ (function (Buffer){ /* * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined @@ -67006,7 +66937,7 @@ Sha1.prototype._hash = function () { module.exports = Sha1 }).call(this,require("buffer").Buffer) -},{"./hash":469,"buffer":83,"inherits":428}],473:[function(require,module,exports){ +},{"./hash":469,"buffer":84,"inherits":429}],473:[function(require,module,exports){ (function (Buffer){ /** * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined @@ -67062,7 +66993,7 @@ Sha224.prototype._hash = function () { module.exports = Sha224 }).call(this,require("buffer").Buffer) -},{"./hash":469,"./sha256":474,"buffer":83,"inherits":428}],474:[function(require,module,exports){ +},{"./hash":469,"./sha256":474,"buffer":84,"inherits":429}],474:[function(require,module,exports){ (function (Buffer){ /** * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined @@ -67200,7 +67131,7 @@ Sha256.prototype._hash = function () { module.exports = Sha256 }).call(this,require("buffer").Buffer) -},{"./hash":469,"buffer":83,"inherits":428}],475:[function(require,module,exports){ +},{"./hash":469,"buffer":84,"inherits":429}],475:[function(require,module,exports){ (function (Buffer){ var inherits = require('inherits') var SHA512 = require('./sha512') @@ -67260,7 +67191,7 @@ Sha384.prototype._hash = function () { module.exports = Sha384 }).call(this,require("buffer").Buffer) -},{"./hash":469,"./sha512":476,"buffer":83,"inherits":428}],476:[function(require,module,exports){ +},{"./hash":469,"./sha512":476,"buffer":84,"inherits":429}],476:[function(require,module,exports){ (function (Buffer){ var inherits = require('inherits') var Hash = require('./hash') @@ -67523,7 +67454,7 @@ Sha512.prototype._hash = function () { module.exports = Sha512 }).call(this,require("buffer").Buffer) -},{"./hash":469,"buffer":83,"inherits":428}],477:[function(require,module,exports){ +},{"./hash":469,"buffer":84,"inherits":429}],477:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -67652,7 +67583,7 @@ Stream.prototype.pipe = function(dest, options) { return dest; }; -},{"events":418,"inherits":428,"readable-stream/duplex.js":450,"readable-stream/passthrough.js":456,"readable-stream/readable.js":457,"readable-stream/transform.js":458,"readable-stream/writable.js":459}],478:[function(require,module,exports){ +},{"events":419,"inherits":429,"readable-stream/duplex.js":451,"readable-stream/passthrough.js":457,"readable-stream/readable.js":458,"readable-stream/transform.js":459,"readable-stream/writable.js":460}],478:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -67875,7 +67806,7 @@ function base64DetectIncompleteChar(buffer) { this.charLength = this.charReceived ? 3 : 0; } -},{"buffer":83}],479:[function(require,module,exports){ +},{"buffer":84}],479:[function(require,module,exports){ (function (global){ /** @@ -68543,7 +68474,7 @@ function hasOwnProperty(obj, prop) { } }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./support/isBuffer":480,"_process":442,"inherits":428}],482:[function(require,module,exports){ +},{"./support/isBuffer":480,"_process":443,"inherits":429}],482:[function(require,module,exports){ (function (global){ var rng; @@ -68903,4 +68834,4 @@ exports.createContext = Script.createContext = function (context) { return copy; }; -},{"indexof":427}]},{},[27]); +},{"indexof":428}]},{},[27]); diff --git a/chrome-extension/js/etherwallet-master.js b/chrome-extension/js/etherwallet-master.js index 2a3341a1f5..6272e000ba 100644 --- a/chrome-extension/js/etherwallet-master.js +++ b/chrome-extension/js/etherwallet-master.js @@ -1,2532 +1,2474 @@ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o0) - ajaxReq.queuePost(); - }); -} -ajaxReq.post = function(data, callback) { - this.pendingPosts.push({ - data: data, - callback: callback - }); - if(this.pendingPosts.length==1) - this.queuePost(); -} -ajaxReq.getETHvalue = function(callback) { - var prefix = "eth"; - this.http.get(this.COINMARKETCAPAPI + prefix).then(function(data) { - data = data['data']['price']; - var priceObj = { - usd: data['usd'].toFixed(6), - eur: data['eur'].toFixed(6), - btc: data['btc'].toFixed(6) - }; - callback(priceObj); - }); -} -ajaxReq.getDAOProposals = function(callback) { - this.http.get(this.DAOPROPOSALSURL).then(function(data) { - callback(data.data); - }); -} +'use strict'; +var http; +var ajaxReq = function() {} +ajaxReq.http = null; +ajaxReq.postSerializer = null; +ajaxReq.SERVERURL = "https://rpc.myetherwallet.com/api.php"; +ajaxReq.DAOPROPOSALSURL = "https://rpc.myetherwallet.com/TheDAO/getDAOProposals.php"; +ajaxReq.COINMARKETCAPAPI = "https://coinmarketcap-nexuist.rhcloud.com/api/"; +ajaxReq.pendingPosts = []; +ajaxReq.config = { + headers: { + 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' + } +}; +ajaxReq.getBalance = function(addr, callback) { + this.post({ + balance: addr + }, callback); +} +ajaxReq.getTransactionData = function(addr, callback) { + this.post({ + txdata: addr + }, callback); +} +ajaxReq.sendRawTx = function(rawTx, callback) { + this.post({ + rawtx: rawTx + }, callback); +} +ajaxReq.getEstimatedGas = function(txobj, callback) { + this.post({ + estimatedGas: txobj + }, callback); +} +ajaxReq.getEthCall = function(txobj, callback) { + this.post({ + ethCall: txobj + }, callback); +} +ajaxReq.queuePost = function() { + var data = this.pendingPosts[0].data; + var callback = this.pendingPosts[0].callback; + this.http.post(this.SERVERURL, this.postSerializer(data), this.config).then(function(data) { + callback(data.data); + ajaxReq.pendingPosts.splice(0, 1); + if(ajaxReq.pendingPosts.length>0) + ajaxReq.queuePost(); + }); +} +ajaxReq.post = function(data, callback) { + this.pendingPosts.push({ + data: data, + callback: callback + }); + if(this.pendingPosts.length==1) + this.queuePost(); +} +ajaxReq.getETHvalue = function(callback) { + var prefix = "eth"; + this.http.get(this.COINMARKETCAPAPI + prefix).then(function(data) { + data = data['data']['price']; + var priceObj = { + usd: data['usd'].toFixed(6), + eur: data['eur'].toFixed(6), + btc: data['btc'].toFixed(6) + }; + callback(priceObj); + }); +} +ajaxReq.getDAOProposals = function(callback) { + this.http.get(this.DAOPROPOSALSURL).then(function(data) { + callback(data.data); + }); +} module.exports = ajaxReq; },{}],2:[function(require,module,exports){ -'use strict'; -var addWalletCtrl = function($scope, $sce) { - $scope.showBtnGen = $scope.showBtnUnlock = $scope.showBtnAdd = $scope.showBtnAddWallet = $scope.showAddWallet = $scope.requireFPass = $scope.requirePPass = $scope.showPassTxt = false; - $scope.nickNames = []; - $scope.filePassword = $scope.fileContent = ""; - $scope.wallet = null; - $scope.addAccount = { - address: "", - nickName: "", - encStr: "", - password: "" - }; - $scope.onPrivKeyChange = function() { - $scope.addWalletStats = ""; - $scope.requirePPass = $scope.manualprivkey.length == 128 || $scope.manualprivkey.length == 132; - $scope.showBtnUnlock = $scope.manualprivkey.length == 64; - }; - $scope.onPrivKeyPassChange = function() { - $scope.showBtnUnlock = $scope.privPassword.length > 6; - }; - $scope.showContent = function($fileContent) { - $scope.fileStatus = $sce.trustAsHtml(globalFuncs.getSuccessText("File Selected: " + document.getElementById('fselector').files[0].name)); - try { - $scope.requireFPass = Wallet.walletRequirePass($fileContent); - $scope.showBtnUnlock = !$scope.requireFPass; - $scope.fileContent = $fileContent; - } catch (e) { - $scope.fileStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - }; - $scope.openFileDialog = function($fileContent) { - $scope.addWalletStats = ""; - document.getElementById('fselector').click(); - }; - $scope.onFilePassChange = function() { - $scope.showBtnUnlock = $scope.filePassword.length > 6; - }; - $scope.decryptWallet = function() { - $scope.wallet = null; - $scope.addWalletStats = ""; - try { - if ($scope.walletType == "pasteprivkey" && $scope.requirePPass) { - $scope.wallet = Wallet.fromMyEtherWalletKey($scope.manualprivkey, $scope.privPassword); - $scope.addAccount.password = $scope.privPassword; - } else if ($scope.walletType == "pasteprivkey" && !$scope.requirePPass) { - $scope.wallet = new Wallet($scope.manualprivkey); - $scope.addAccount.password = ''; - } else if ($scope.walletType == "fileupload") { - $scope.wallet = Wallet.getWalletFromPrivKeyFile($scope.fileContent, $scope.filePassword); - $scope.addAccount.password = $scope.filePassword; - } - $scope.addAccount.address = $scope.wallet.getAddressString(); - } catch (e) { - $scope.addWalletStats = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[6] + e)); - } - if ($scope.wallet != null) { - $scope.addWalletStats = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[1])); - $scope.showAddWallet = true; - $scope.showPassTxt = $scope.addAccount.password == ''; - $scope.setBalance(); - } - }; - $scope.setNickNames = function() { - cxFuncs.getAllNickNames(function(nicks) { - $scope.nickNames = nicks; - }); - }; - $scope.setNickNames(); - $scope.newWalletChange = function(varStatus, shwbtn) { - if ($scope.addAccount.nickName != "" && $scope.nickNames.indexOf($scope.addAccount.nickName) == -1 && $scope.addAccount.password.length > 8) $scope[shwbtn] = true; - else $scope[shwbtn] = false; - if ($scope.nickNames.indexOf($scope.addAccount.nickName) !== -1) $scope[varStatus] = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[13])); - else $scope[varStatus] = ""; - } - $scope.watchOnlyChange = function() { - if ($scope.addAccount.address != "" && $scope.addAccount.nickName != "" && $scope.nickNames.indexOf($scope.addAccount.nickName) == -1 && ethFuncs.validateEtherAddress($scope.addAccount.address)) $scope.showBtnAdd = true; - else $scope.showBtnAdd = false; - if ($scope.addAccount.address != "" && !ethFuncs.validateEtherAddress($scope.addAccount.address)) $scope.watchOnlyStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[5])); - else if ($scope.nickNames.indexOf($scope.addAccount.nickName) !== -1) $scope.watchOnlyStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[13])); - else $scope.watchOnlyStatus = ""; - } - $scope.addWatchOnly = function() { - if ($scope.nickNames.indexOf($scope.addAccount.nickName) !== -1) { - $scope.addWalletStats = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[13])); - return; - } - cxFuncs.addWatchOnlyAddress($scope.addAccount.address, $scope.addAccount.nickName, function() { - if (chrome.runtime.lastError) { - $scope.addWalletStats = $sce.trustAsHtml(globalFuncs.getDangerText(chrome.runtime.lastError.message)); - } else { - $scope.addWalletStats = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[3] + $scope.addAccount.address)); - $scope.setNickNames(); - } - $scope.$apply(); - }); - } - $scope.isStrongPass = function(pass) { - return globalFuncs.isStrongPass(pass); - } - $scope.$watch('walletType', function() { - $scope.showBtnGen = $scope.showBtnUnlock = $scope.showBtnAdd = $scope.showAddWallet = false; - $scope.addNewNick = $scope.addNewPass = ""; - $scope.addWalletStats = ""; - }); - $scope.addWalletToStorage = function(status) { - if ($scope.nickNames.indexOf($scope.addAccount.nickName) !== -1) { - $scope[status] = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[13])); - return; - } else if($scope.nickNames.indexOf(ethUtil.toChecksumAddress($scope.addAccount.address)) !== -1){ - $scope[status] = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[16])); - return; - } - cxFuncs.addWalletToStorage($scope.addAccount.address, $scope.addAccount.encStr, $scope.addAccount.nickName, function() { - if (chrome.runtime.lastError) { - $scope[status] = $sce.trustAsHtml(globalFuncs.getDangerText(chrome.runtime.lastError.message)); - } else { - $scope[status] = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[3] + $scope.addAccount.address)); - $scope.setNickNames(); - } - $scope.$apply(); - }); - } - $scope.importWalletToStorage = function() { - var wStr = $scope.wallet.toV3($scope.addAccount.password, { - kdf: globalFuncs.kdf, - n: globalFuncs.scrypt.n - }); - $scope.addAccount.encStr = JSON.stringify(wStr); - $scope.addWalletToStorage('addStatus'); - } - $scope.generateWallet = function() { - var wallet = Wallet.generate(false); - var wStr = wallet.toV3($scope.addAccount.password, { - kdf: globalFuncs.kdf, - n: globalFuncs.scrypt.n - }); - $scope.addAccount.encStr = JSON.stringify(wStr); - $scope.addAccount.address = wallet.getAddressString(); - $scope.addWalletToStorage('addWalletStats'); - } - $scope.setBalance = function() { - ajaxReq.getBalance($scope.wallet.getAddressString(), function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.etherBalance = etherUnits.toEther(data.data.balance, 'wei'); - ajaxReq.getETHvalue(function(data) { - $scope.usdBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.usd); - $scope.eurBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.eur); - $scope.btcBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.btc); - }); - } - }); - } -}; -module.exports = addWalletCtrl; +'use strict'; +var addWalletCtrl = function($scope, $sce) { + $scope.showBtnGen = $scope.showBtnUnlock = $scope.showBtnAdd = $scope.showBtnAddWallet = $scope.showAddWallet = $scope.requireFPass = $scope.requirePPass = $scope.showPassTxt = false; + $scope.nickNames = []; + $scope.filePassword = $scope.fileContent = ""; + $scope.wallet = null; + $scope.addAccount = { + address: "", + nickName: "", + encStr: "", + password: "" + }; + $scope.onPrivKeyChange = function() { + $scope.addWalletStats = ""; + $scope.requirePPass = $scope.manualprivkey.length == 128 || $scope.manualprivkey.length == 132; + $scope.showBtnUnlock = $scope.manualprivkey.length == 64; + }; + $scope.onPrivKeyPassChange = function() { + $scope.showBtnUnlock = $scope.privPassword.length > 6; + }; + $scope.showContent = function($fileContent) { + $scope.fileStatus = $sce.trustAsHtml(globalFuncs.getSuccessText("File Selected: " + document.getElementById('fselector').files[0].name)); + try { + $scope.requireFPass = Wallet.walletRequirePass($fileContent); + $scope.showBtnUnlock = !$scope.requireFPass; + $scope.fileContent = $fileContent; + } catch (e) { + $scope.fileStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + }; + $scope.openFileDialog = function($fileContent) { + $scope.addWalletStats = ""; + document.getElementById('fselector').click(); + }; + $scope.onFilePassChange = function() { + $scope.showBtnUnlock = $scope.filePassword.length > 6; + }; + $scope.decryptWallet = function() { + $scope.wallet = null; + $scope.addWalletStats = ""; + try { + if ($scope.walletType == "pasteprivkey" && $scope.requirePPass) { + $scope.wallet = Wallet.fromMyEtherWalletKey($scope.manualprivkey, $scope.privPassword); + $scope.addAccount.password = $scope.privPassword; + } else if ($scope.walletType == "pasteprivkey" && !$scope.requirePPass) { + $scope.wallet = new Wallet($scope.manualprivkey); + $scope.addAccount.password = ''; + } else if ($scope.walletType == "fileupload") { + $scope.wallet = Wallet.getWalletFromPrivKeyFile($scope.fileContent, $scope.filePassword); + $scope.addAccount.password = $scope.filePassword; + } + $scope.addAccount.address = $scope.wallet.getAddressString(); + } catch (e) { + $scope.addWalletStats = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[6] + e)); + } + if ($scope.wallet != null) { + $scope.addWalletStats = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[1])); + $scope.showAddWallet = true; + $scope.showPassTxt = $scope.addAccount.password == ''; + $scope.setBalance(); + } + }; + $scope.setNickNames = function() { + cxFuncs.getAllNickNames(function(nicks) { + $scope.nickNames = nicks; + }); + }; + $scope.setNickNames(); + $scope.newWalletChange = function(varStatus, shwbtn) { + if ($scope.addAccount.nickName != "" && $scope.nickNames.indexOf($scope.addAccount.nickName) == -1 && $scope.addAccount.password.length > 8) $scope[shwbtn] = true; + else $scope[shwbtn] = false; + if ($scope.nickNames.indexOf($scope.addAccount.nickName) !== -1) $scope[varStatus] = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[13])); + else $scope[varStatus] = ""; + } + $scope.watchOnlyChange = function() { + if ($scope.addAccount.address != "" && $scope.addAccount.nickName != "" && $scope.nickNames.indexOf($scope.addAccount.nickName) == -1 && ethFuncs.validateEtherAddress($scope.addAccount.address)) $scope.showBtnAdd = true; + else $scope.showBtnAdd = false; + if ($scope.addAccount.address != "" && !ethFuncs.validateEtherAddress($scope.addAccount.address)) $scope.watchOnlyStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[5])); + else if ($scope.nickNames.indexOf($scope.addAccount.nickName) !== -1) $scope.watchOnlyStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[13])); + else $scope.watchOnlyStatus = ""; + } + $scope.addWatchOnly = function() { + if ($scope.nickNames.indexOf($scope.addAccount.nickName) !== -1) { + $scope.addWalletStats = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[13])); + return; + } + cxFuncs.addWatchOnlyAddress($scope.addAccount.address, $scope.addAccount.nickName, function() { + if (chrome.runtime.lastError) { + $scope.addWalletStats = $sce.trustAsHtml(globalFuncs.getDangerText(chrome.runtime.lastError.message)); + } else { + $scope.addWalletStats = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[3] + $scope.addAccount.address)); + $scope.setNickNames(); + } + $scope.$apply(); + }); + } + $scope.isStrongPass = function(pass) { + return globalFuncs.isStrongPass(pass); + } + $scope.$watch('walletType', function() { + $scope.showBtnGen = $scope.showBtnUnlock = $scope.showBtnAdd = $scope.showAddWallet = false; + $scope.addNewNick = $scope.addNewPass = ""; + $scope.addWalletStats = ""; + }); + $scope.addWalletToStorage = function(status) { + if ($scope.nickNames.indexOf($scope.addAccount.nickName) !== -1) { + $scope[status] = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[13])); + return; + } else if($scope.nickNames.indexOf(ethUtil.toChecksumAddress($scope.addAccount.address)) !== -1){ + $scope[status] = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[16])); + return; + } + cxFuncs.addWalletToStorage($scope.addAccount.address, $scope.addAccount.encStr, $scope.addAccount.nickName, function() { + if (chrome.runtime.lastError) { + $scope[status] = $sce.trustAsHtml(globalFuncs.getDangerText(chrome.runtime.lastError.message)); + } else { + $scope[status] = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[3] + $scope.addAccount.address)); + $scope.setNickNames(); + } + $scope.$apply(); + }); + } + $scope.importWalletToStorage = function() { + var wStr = $scope.wallet.toV3($scope.addAccount.password, { + kdf: globalFuncs.kdf, + n: globalFuncs.scrypt.n + }); + $scope.addAccount.encStr = JSON.stringify(wStr); + $scope.addWalletToStorage('addStatus'); + } + $scope.generateWallet = function() { + var wallet = Wallet.generate(false); + var wStr = wallet.toV3($scope.addAccount.password, { + kdf: globalFuncs.kdf, + n: globalFuncs.scrypt.n + }); + $scope.addAccount.encStr = JSON.stringify(wStr); + $scope.addAccount.address = wallet.getAddressString(); + $scope.addWalletToStorage('addWalletStats'); + } + $scope.setBalance = function() { + ajaxReq.getBalance($scope.wallet.getAddressString(), function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.etherBalance = etherUnits.toEther(data.data.balance, 'wei'); + ajaxReq.getETHvalue(function(data) { + $scope.usdBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.usd); + $scope.eurBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.eur); + $scope.btcBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.btc); + }); + } + }); + } +}; +module.exports = addWalletCtrl; },{}],3:[function(require,module,exports){ -'use strict'; -var cxDecryptWalletCtrl = function($scope, $sce, walletService) { - $scope.allWallets = []; - $scope.selectedWallet = $scope.password = ""; - $scope.setAllWallets = function() { - cxFuncs.getWalletsArr(function(wlts) { - $scope.allWallets = wlts; - $scope.updateBalance(); - $scope.$apply(); - }); - }; - $scope.updateBalance = function() { - for (var i = 0; i < $scope.allWallets.length; i++) { - $scope.setBalance($scope.allWallets[i].addr,i); - } - }; - $scope.setBalance = function(address,id) { - ajaxReq.getBalance(address, function(data) { - if (data.error) { - $scope.allWallets[id].balance = data.msg; - } else { - $scope.allWallets[id].balance = etherUnits.toEther(data.data.balance, 'wei'); - } - }); - }; - $scope.setAllWallets(); - $scope.getPrivFromAdd = function(){ - if ($scope.selectedWallet=="") throw globalFuncs.errorMsgs[5]; - for (var i = 0; i < $scope.allWallets.length; i++) { - if( $scope.allWallets[i].addr==$scope.selectedWallet) - return $scope.allWallets[i].priv; - } - throw globalFuncs.errorMsgs[14]; - } - $scope.decryptWallet = function() { - $scope.wallet=null; - $scope.decryptStatus=""; - try { - var priv = $scope.getPrivFromAdd(); - if (priv.length==132) - $scope.wallet = Wallet.fromMyEtherWalletKey(priv, $scope.password); - else - $scope.wallet = Wallet.getWalletFromPrivKeyFile(priv, $scope.password); - walletService.password = $scope.password; - walletService.wallet = $scope.wallet; - } catch (e) { - $scope.decryptStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[6] + ":" + e)); - } - if($scope.wallet!=null) $scope.decryptStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[1])); - }; -}; +'use strict'; +var cxDecryptWalletCtrl = function($scope, $sce, walletService) { + $scope.allWallets = []; + $scope.selectedWallet = $scope.password = ""; + $scope.setAllWallets = function() { + cxFuncs.getWalletsArr(function(wlts) { + $scope.allWallets = wlts; + $scope.updateBalance(); + $scope.$apply(); + }); + }; + $scope.updateBalance = function() { + for (var i = 0; i < $scope.allWallets.length; i++) { + $scope.setBalance($scope.allWallets[i].addr,i); + } + }; + $scope.setBalance = function(address,id) { + ajaxReq.getBalance(address, function(data) { + if (data.error) { + $scope.allWallets[id].balance = data.msg; + } else { + $scope.allWallets[id].balance = etherUnits.toEther(data.data.balance, 'wei'); + } + }); + }; + $scope.setAllWallets(); + $scope.getPrivFromAdd = function(){ + if ($scope.selectedWallet=="") throw globalFuncs.errorMsgs[5]; + for (var i = 0; i < $scope.allWallets.length; i++) { + if( $scope.allWallets[i].addr==$scope.selectedWallet) + return $scope.allWallets[i].priv; + } + throw globalFuncs.errorMsgs[14]; + } + $scope.decryptWallet = function() { + $scope.wallet=null; + $scope.decryptStatus=""; + try { + var priv = $scope.getPrivFromAdd(); + if (priv.length==132) + $scope.wallet = Wallet.fromMyEtherWalletKey(priv, $scope.password); + else + $scope.wallet = Wallet.getWalletFromPrivKeyFile(priv, $scope.password); + walletService.password = $scope.password; + walletService.wallet = $scope.wallet; + } catch (e) { + $scope.decryptStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[6] + ":" + e)); + } + if($scope.wallet!=null) $scope.decryptStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[1])); + }; +}; module.exports = cxDecryptWalletCtrl; },{}],4:[function(require,module,exports){ -'use strict'; -var mainPopCtrl = function($scope, $sce) { - $scope.allWallets = []; - $scope.allWatchOnly = []; - $scope.setAllWallets = function() { - cxFuncs.getWalletsArr(function(wlts) { - $scope.allWallets = wlts; - $scope.updateBalance('allWallets'); - }); - cxFuncs.getWatchOnlyArr(function(wlts) { - $scope.allWatchOnly = wlts; - $scope.updateBalance('allWatchOnly'); - $scope.$apply(); - }); - }; - $scope.updateBalance = function(varWal) { - for (var i = 0; i < $scope[varWal].length; i++) { - $scope.setBalance($scope[varWal][i].addr, i, varWal); - } - }; - $scope.setBalance = function(address, id, varWal) { - ajaxReq.getBalance(address, function(data) { - if (data.error) { - $scope[varWal][id].balance = data.msg; - } else { - $scope[varWal][id].balance = etherUnits.toEther(data.data.balance, 'wei'); - $scope[varWal][id].balanceR = new BigNumber($scope[varWal][id].balance).toPrecision(5); - } - }); - }; - $scope.setAllWallets(); -}; -module.exports = mainPopCtrl; +'use strict'; +var mainPopCtrl = function($scope, $sce) { + $scope.allWallets = []; + $scope.allWatchOnly = []; + $scope.setAllWallets = function() { + cxFuncs.getWalletsArr(function(wlts) { + $scope.allWallets = wlts; + $scope.updateBalance('allWallets'); + }); + cxFuncs.getWatchOnlyArr(function(wlts) { + $scope.allWatchOnly = wlts; + $scope.updateBalance('allWatchOnly'); + $scope.$apply(); + }); + }; + $scope.updateBalance = function(varWal) { + for (var i = 0; i < $scope[varWal].length; i++) { + $scope.setBalance($scope[varWal][i].addr, i, varWal); + } + }; + $scope.setBalance = function(address, id, varWal) { + ajaxReq.getBalance(address, function(data) { + if (data.error) { + $scope[varWal][id].balance = data.msg; + } else { + $scope[varWal][id].balance = etherUnits.toEther(data.data.balance, 'wei'); + $scope[varWal][id].balanceR = new BigNumber($scope[varWal][id].balance).toPrecision(5); + } + }); + }; + $scope.setAllWallets(); +}; +module.exports = mainPopCtrl; },{}],5:[function(require,module,exports){ -'use strict'; -var myWalletsCtrl = function($scope, $sce) { - $scope.editModal = new Modal(document.getElementById('editWallet')); - $scope.viewModal = new Modal(document.getElementById('viewWalletDetails')); - $scope.removeModal = new Modal(document.getElementById('removeWallet')); - $scope.allWallets = []; - $scope.allWatchOnly = []; - $scope.nickNames = []; - $scope.fiatVal = { - usd: 0, - eur: 0, - btc: 0 - }; - $scope.viewWallet = {}; - $scope.setNickNames = function() { - cxFuncs.getAllNickNames(function(nicks) { - $scope.nickNames = nicks; - }); - }; - $scope.setAllWallets = function() { - cxFuncs.getWalletsArr(function(wlts) { - $scope.allWallets = wlts; - $scope.updateBalance('allWallets'); - }); - cxFuncs.getWatchOnlyArr(function(wlts) { - $scope.allWatchOnly = wlts; - $scope.updateBalance('allWatchOnly'); - $scope.$apply(); - }); - }; - $scope.updateBalance = function(varWal) { - for (var i = 0; i < $scope[varWal].length; i++) { - $scope.setBalance($scope[varWal][i].addr, i, varWal); - } - }; - $scope.setBalance = function(address, id, varWal) { - ajaxReq.getBalance(address, function(data) { - if (data.error) { - $scope[varWal][id].balance = data.msg; - } else { - $scope[varWal][id].balance = etherUnits.toEther(data.data.balance, 'wei'); - $scope[varWal][id].balanceR = new BigNumber($scope[varWal][id].balance).toPrecision(5); - $scope[varWal][id].usd = etherUnits.toFiat($scope[varWal][id].balance, 'ether', $scope.fiatVal.usd); - $scope[varWal][id].eur = etherUnits.toFiat($scope[varWal][id].balance, 'ether', $scope.fiatVal.eur); - $scope[varWal][id].btc = etherUnits.toFiat($scope[varWal][id].balance, 'ether', $scope.fiatVal.btc); - } - }); - }; - $scope.setViewWalletObj = function(val, type) { - var vtype = 'allWallets'; - if (type == 'watchOnly') vtype = 'allWatchOnly' - $scope.viewWallet = { - nick: $scope[vtype][val].nick, - addr: $scope[vtype][val].addr, - id: val, - type: type - } - } - $scope.editMWallet = function(val, type) { - $scope.setViewWalletObj(val, type); - $scope.editModal.open(); - } - $scope.editSave = function() { - if ($scope.nickNames.indexOf($scope.viewWallet.nick) !== -1) { - $scope.editStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[13])); - return; - } else { - cxFuncs.editNickName($scope.viewWallet.addr, $scope.viewWallet.nick, function() { - if (chrome.runtime.lastError) $scope.editStatus = $sce.trustAsHtml(globalFuncs.getDangerText(chrome.runtime.lastError.message)); - else { - $scope.setAllWallets(); - $scope.setNickNames(); - $scope.editModal.close(); - } - }); - } - } - $scope.viewMWallet = function(val, type) { - $scope.setViewWalletObj(val, type); - $scope.viewModal.open(); - } - $scope.decryptWallet = function() { - $scope.wallet = null; - $scope.viewStatus = ""; - try { - var priv = $scope.allWallets[$scope.viewWallet.id].priv; - if (priv.length==132) - $scope.wallet = Wallet.fromMyEtherWalletKey(priv, $scope.password); - else - $scope.wallet = Wallet.getWalletFromPrivKeyFile(priv, $scope.password); - $scope.viewModal.close(); - $scope.setWalletInfo(); - $scope.password = ""; - } catch (e) { - $scope.viewStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[6] + ":" + e)); - } - }; - $scope.printQRCode = function() { - globalFuncs.printPaperWallets(JSON.stringify([{ - address: $scope.wallet.getAddressString(), - private: $scope.wallet.getPrivateKeyString() - }])); - } - $scope.resetWallet = function() { - $scope.wallet = null; - $scope.blob = $scope.blobEnc = $scope.password = ""; - } - $scope.setWalletInfo = function() { - $scope.blob = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toJSON()); - if ($scope.password != '') { - $scope.blobEnc = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toV3($scope.password, { - kdf: globalFuncs.kdf, - n: globalFuncs.scrypt.n - })); - $scope.encFileName = $scope.wallet.getV3Filename(); - } - ajaxReq.getBalance($scope.wallet.getAddressString(), function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.etherBalance = etherUnits.toEther(data.data.balance, 'wei'); - ajaxReq.getETHvalue(function(data) { - $scope.usdBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.usd); - $scope.eurBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.eur); - $scope.btcBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.btc); - }); - } - }); - } - $scope.deleteWalletMsg = function(val, type) { - $scope.setViewWalletObj(val, type); - $scope.removeModal.open(); - } - $scope.deleteWallet = function() { - cxFuncs.deleteAccount($scope.viewWallet.addr, function() { - $scope.setAllWallets(); - $scope.setNickNames(); - $scope.removeModal.close(); - }); - } - ajaxReq.getETHvalue(function(data) { - $scope.fiatVal.usd = data.usd; - $scope.fiatVal.eur = data.eur; - $scope.fiatVal.btc = data.btc; - $scope.setAllWallets(); - }); - $scope.setNickNames(); -}; +'use strict'; +var myWalletsCtrl = function($scope, $sce) { + $scope.editModal = new Modal(document.getElementById('editWallet')); + $scope.viewModal = new Modal(document.getElementById('viewWalletDetails')); + $scope.removeModal = new Modal(document.getElementById('removeWallet')); + $scope.allWallets = []; + $scope.allWatchOnly = []; + $scope.nickNames = []; + $scope.fiatVal = { + usd: 0, + eur: 0, + btc: 0 + }; + $scope.viewWallet = {}; + $scope.setNickNames = function() { + cxFuncs.getAllNickNames(function(nicks) { + $scope.nickNames = nicks; + }); + }; + $scope.setAllWallets = function() { + cxFuncs.getWalletsArr(function(wlts) { + $scope.allWallets = wlts; + $scope.updateBalance('allWallets'); + }); + cxFuncs.getWatchOnlyArr(function(wlts) { + $scope.allWatchOnly = wlts; + $scope.updateBalance('allWatchOnly'); + $scope.$apply(); + }); + }; + $scope.updateBalance = function(varWal) { + for (var i = 0; i < $scope[varWal].length; i++) { + $scope.setBalance($scope[varWal][i].addr, i, varWal); + } + }; + $scope.setBalance = function(address, id, varWal) { + ajaxReq.getBalance(address, function(data) { + if (data.error) { + $scope[varWal][id].balance = data.msg; + } else { + $scope[varWal][id].balance = etherUnits.toEther(data.data.balance, 'wei'); + $scope[varWal][id].balanceR = new BigNumber($scope[varWal][id].balance).toPrecision(5); + $scope[varWal][id].usd = etherUnits.toFiat($scope[varWal][id].balance, 'ether', $scope.fiatVal.usd); + $scope[varWal][id].eur = etherUnits.toFiat($scope[varWal][id].balance, 'ether', $scope.fiatVal.eur); + $scope[varWal][id].btc = etherUnits.toFiat($scope[varWal][id].balance, 'ether', $scope.fiatVal.btc); + } + }); + }; + $scope.setViewWalletObj = function(val, type) { + var vtype = 'allWallets'; + if (type == 'watchOnly') vtype = 'allWatchOnly' + $scope.viewWallet = { + nick: $scope[vtype][val].nick, + addr: $scope[vtype][val].addr, + id: val, + type: type + } + } + $scope.editMWallet = function(val, type) { + $scope.setViewWalletObj(val, type); + $scope.editModal.open(); + } + $scope.editSave = function() { + if ($scope.nickNames.indexOf($scope.viewWallet.nick) !== -1) { + $scope.editStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[13])); + return; + } else { + cxFuncs.editNickName($scope.viewWallet.addr, $scope.viewWallet.nick, function() { + if (chrome.runtime.lastError) $scope.editStatus = $sce.trustAsHtml(globalFuncs.getDangerText(chrome.runtime.lastError.message)); + else { + $scope.setAllWallets(); + $scope.setNickNames(); + $scope.editModal.close(); + } + }); + } + } + $scope.viewMWallet = function(val, type) { + $scope.setViewWalletObj(val, type); + $scope.viewModal.open(); + } + $scope.decryptWallet = function() { + $scope.wallet = null; + $scope.viewStatus = ""; + try { + var priv = $scope.allWallets[$scope.viewWallet.id].priv; + if (priv.length==132) + $scope.wallet = Wallet.fromMyEtherWalletKey(priv, $scope.password); + else + $scope.wallet = Wallet.getWalletFromPrivKeyFile(priv, $scope.password); + $scope.viewModal.close(); + $scope.setWalletInfo(); + $scope.password = ""; + } catch (e) { + $scope.viewStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[6] + ":" + e)); + } + }; + $scope.printQRCode = function() { + globalFuncs.printPaperWallets(JSON.stringify([{ + address: $scope.wallet.getAddressString(), + private: $scope.wallet.getPrivateKeyString() + }])); + } + $scope.resetWallet = function() { + $scope.wallet = null; + $scope.blob = $scope.blobEnc = $scope.password = ""; + } + $scope.setWalletInfo = function() { + $scope.blob = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toJSON()); + if ($scope.password != '') { + $scope.blobEnc = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toV3($scope.password, { + kdf: globalFuncs.kdf, + n: globalFuncs.scrypt.n + })); + $scope.encFileName = $scope.wallet.getV3Filename(); + } + ajaxReq.getBalance($scope.wallet.getAddressString(), function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.etherBalance = etherUnits.toEther(data.data.balance, 'wei'); + ajaxReq.getETHvalue(function(data) { + $scope.usdBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.usd); + $scope.eurBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.eur); + $scope.btcBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.btc); + }); + } + }); + } + $scope.deleteWalletMsg = function(val, type) { + $scope.setViewWalletObj(val, type); + $scope.removeModal.open(); + } + $scope.deleteWallet = function() { + cxFuncs.deleteAccount($scope.viewWallet.addr, function() { + $scope.setAllWallets(); + $scope.setNickNames(); + $scope.removeModal.close(); + }); + } + ajaxReq.getETHvalue(function(data) { + $scope.fiatVal.usd = data.usd; + $scope.fiatVal.eur = data.eur; + $scope.fiatVal.btc = data.btc; + $scope.setAllWallets(); + }); + $scope.setNickNames(); +}; module.exports = myWalletsCtrl; },{}],6:[function(require,module,exports){ -'use strict'; -var quickSendCtrl = function($scope, $sce) { - $scope.allWallets = []; - $scope.selectedWallet = ""; - $scope.showConfirm = false; - $scope.tx = { - gasLimit: globalFuncs.defaultTxGasLimit, - data: "", - to: "", - unit: "ether", - value: "", - nonce: null, - gasPrice: null, - donate: false - } - $scope.setAllWallets = function() { - cxFuncs.getWalletsArr(function(wlts) { - $scope.allWallets = wlts; - $scope.updateBalance('allWallets'); - }); - }; - $scope.updateBalance = function(varWal) { - for (var i = 0; i < $scope[varWal].length; i++) { - $scope.setBalance($scope[varWal][i].addr, i, varWal); - } - }; - $scope.setBalance = function(address, id, varWal) { - ajaxReq.getBalance(address, function(data) { - if (data.error) { - $scope[varWal][id].balance = data.msg; - } else { - $scope[varWal][id].balance = etherUnits.toEther(data.data.balance, 'wei'); - $scope[varWal][id].balanceR = new BigNumber($scope[varWal][id].balance).toPrecision(5); - } - }); - }; - $scope.validateAddress = function() { - if (ethFuncs.validateEtherAddress($scope.tx.to)) { - $scope.validateAddressStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[0])); - } else { - $scope.validateAddressStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[5])); - } - } - $scope.transferAllBalance = function() { - $scope.wallet = {}; - $scope.wallet.getAddressString = function() { - return $scope.allWallets[$scope.selectedWallet].addr; - } - uiFuncs.transferAllBalance($scope, $sce); - } - $scope.prepTX = function() { - try { - if (!ethFuncs.validateEtherAddress($scope.tx.to)) throw globalFuncs.errorMsgs[5]; - else if (!globalFuncs.isNumeric($scope.tx.value) || parseFloat($scope.tx.value) < 0) throw globalFuncs.errorMsgs[7]; - $scope.showConfirm = true; - } catch (e) { - $scope.prepTXStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - } - $scope.unlockAndSend = function() { - try { - $scope.decryptWallet(); - $scope.autoSend = true; - uiFuncs.generateTx($scope, $sce); - $scope.validateTxStatus = ""; - } catch (e) { - $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - } - $scope.decryptWallet = function() { - $scope.wallet = null; - $scope.validateTxStatus = ""; - $scope.wallet = Wallet.getWalletFromPrivKeyFile($scope.allWallets[$scope.selectedWallet].priv, $scope.password); - }; - $scope.setAllWallets(); -}; +'use strict'; +var quickSendCtrl = function($scope, $sce) { + $scope.allWallets = []; + $scope.selectedWallet = ""; + $scope.showConfirm = false; + $scope.tx = { + gasLimit: globalFuncs.defaultTxGasLimit, + data: "", + to: "", + unit: "ether", + value: "", + nonce: null, + gasPrice: null, + donate: false + } + $scope.setAllWallets = function() { + cxFuncs.getWalletsArr(function(wlts) { + $scope.allWallets = wlts; + $scope.updateBalance('allWallets'); + }); + }; + $scope.updateBalance = function(varWal) { + for (var i = 0; i < $scope[varWal].length; i++) { + $scope.setBalance($scope[varWal][i].addr, i, varWal); + } + }; + $scope.setBalance = function(address, id, varWal) { + ajaxReq.getBalance(address, function(data) { + if (data.error) { + $scope[varWal][id].balance = data.msg; + } else { + $scope[varWal][id].balance = etherUnits.toEther(data.data.balance, 'wei'); + $scope[varWal][id].balanceR = new BigNumber($scope[varWal][id].balance).toPrecision(5); + } + }); + }; + $scope.validateAddress = function() { + if (ethFuncs.validateEtherAddress($scope.tx.to)) { + $scope.validateAddressStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[0])); + } else { + $scope.validateAddressStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[5])); + } + } + $scope.transferAllBalance = function() { + $scope.wallet = {}; + $scope.wallet.getAddressString = function() { + return $scope.allWallets[$scope.selectedWallet].addr; + } + uiFuncs.transferAllBalance($scope, $sce); + } + $scope.prepTX = function() { + try { + if (!ethFuncs.validateEtherAddress($scope.tx.to)) throw globalFuncs.errorMsgs[5]; + else if (!globalFuncs.isNumeric($scope.tx.value) || parseFloat($scope.tx.value) < 0) throw globalFuncs.errorMsgs[7]; + $scope.showConfirm = true; + } catch (e) { + $scope.prepTXStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + } + $scope.unlockAndSend = function() { + try { + $scope.decryptWallet(); + $scope.autoSend = true; + uiFuncs.generateTx($scope, $sce); + $scope.validateTxStatus = ""; + } catch (e) { + $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + } + $scope.decryptWallet = function() { + $scope.wallet = null; + $scope.validateTxStatus = ""; + $scope.wallet = Wallet.getWalletFromPrivKeyFile($scope.allWallets[$scope.selectedWallet].priv, $scope.password); + }; + $scope.setAllWallets(); +}; module.exports = quickSendCtrl; },{}],7:[function(require,module,exports){ -'use strict'; -var bulkGenCtrl = function($scope) { - $scope.showWallets = false; - $scope.genWallets = function(){ - if($scope.amount==''||$scope.amount != parseInt($scope.amount, 10)) alert(globalFuncs.errorMsgs[0]); - else { - $scope.wallets = []; - var csv = ''; var txt = ''; - $scope.jsonWallets = []; - for(var i=0;i<$scope.amount;i++){ - var tWallet = Wallet.generate(false); - csv += tWallet.getChecksumAddressString() + ',' + tWallet.getPrivateKeyString() + '\n'; - txt += tWallet.getChecksumAddressString() + '\t' + tWallet.getPrivateKeyString() + '\n'; - $scope.jsonWallets.push({ - address: tWallet.getChecksumAddressString(), - private: tWallet.getPrivateKeyString() - }); - $scope.wallets.push(tWallet); - } - $scope.showWallets = true; - $scope.bJSON = globalFuncs.getBlob("text/json;charset=UTF-8",JSON.stringify($scope.jsonWallets)); - $scope.bTXT = globalFuncs.getBlob("text/plain;charset=UTF-8",txt); - $scope.bCSV = globalFuncs.getBlob("text/csv;charset=UTF-8",csv); - } - } - $scope.printQRCode = function() { - globalFuncs.printPaperWallets(JSON.stringify($scope.jsonWallets)); - } -}; +'use strict'; +var bulkGenCtrl = function($scope) { + $scope.showWallets = false; + $scope.genWallets = function(){ + if($scope.amount==''||$scope.amount != parseInt($scope.amount, 10)) alert(globalFuncs.errorMsgs[0]); + else { + $scope.wallets = []; + var csv = ''; var txt = ''; + $scope.jsonWallets = []; + for(var i=0;i<$scope.amount;i++){ + var tWallet = Wallet.generate(false); + csv += tWallet.getChecksumAddressString() + ',' + tWallet.getPrivateKeyString() + '\n'; + txt += tWallet.getChecksumAddressString() + '\t' + tWallet.getPrivateKeyString() + '\n'; + $scope.jsonWallets.push({ + address: tWallet.getChecksumAddressString(), + private: tWallet.getPrivateKeyString() + }); + $scope.wallets.push(tWallet); + } + $scope.showWallets = true; + $scope.bJSON = globalFuncs.getBlob("text/json;charset=UTF-8",JSON.stringify($scope.jsonWallets)); + $scope.bTXT = globalFuncs.getBlob("text/plain;charset=UTF-8",txt); + $scope.bCSV = globalFuncs.getBlob("text/csv;charset=UTF-8",csv); + } + } + $scope.printQRCode = function() { + globalFuncs.printPaperWallets(JSON.stringify($scope.jsonWallets)); + } +}; module.exports = bulkGenCtrl; },{}],8:[function(require,module,exports){ -'use strict'; -var decryptWalletCtrl = function($scope, $sce, walletService) { - $scope.walletType = ""; - $scope.requireFPass = $scope.requirePPass = $scope.showFDecrypt = $scope.showPDecrypt = false; - $scope.filePassword = ""; - $scope.fileContent = ""; - $scope.showContent = function($fileContent) { - $scope.fileStatus = $sce.trustAsHtml(globalFuncs.getSuccessText("File Selected: " + document.getElementById('fselector').files[0].name)); - try { - $scope.requireFPass = Wallet.walletRequirePass($fileContent); - $scope.showFDecrypt = !$scope.requireFPass; - $scope.fileContent = $fileContent; - } catch (e) { - $scope.fileStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - }; - $scope.openFileDialog = function($fileContent) { - document.getElementById('fselector').click(); - }; - $scope.onFilePassChange = function() { - $scope.showFDecrypt = $scope.filePassword.length > 3; - }; - $scope.onPrivKeyChange = function() { - $scope.requirePPass = $scope.manualprivkey.length == 128 || $scope.manualprivkey.length == 132; - $scope.showPDecrypt = $scope.manualprivkey.length == 64; - }; - $scope.onPrivKeyPassChange = function() { - $scope.showPDecrypt = $scope.privPassword.length > 6; - }; - $scope.decryptWallet = function() { - $scope.wallet=null; - $scope.decryptStatus=""; - try { - if ($scope.showPDecrypt && $scope.requirePPass) { - $scope.wallet = Wallet.fromMyEtherWalletKey($scope.manualprivkey, $scope.privPassword); - walletService.password = $scope.privPassword; - } else if ($scope.showPDecrypt && !$scope.requirePPass) { - $scope.wallet = new Wallet($scope.manualprivkey); - walletService.password = ''; - } else if ($scope.showFDecrypt) { - $scope.wallet = Wallet.getWalletFromPrivKeyFile($scope.fileContent, $scope.filePassword); - walletService.password = $scope.filePassword; - } - walletService.wallet = $scope.wallet; - } catch (e) { - $scope.decryptStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[6]+e)); - } - if($scope.wallet!=null) $scope.decryptStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[1])); - }; -}; +'use strict'; +var decryptWalletCtrl = function($scope, $sce, walletService) { + $scope.walletType = ""; + $scope.requireFPass = $scope.requirePPass = $scope.showFDecrypt = $scope.showPDecrypt = false; + $scope.filePassword = ""; + $scope.fileContent = ""; + $scope.showContent = function($fileContent) { + $scope.fileStatus = $sce.trustAsHtml(globalFuncs.getSuccessText("File Selected: " + document.getElementById('fselector').files[0].name)); + try { + $scope.requireFPass = Wallet.walletRequirePass($fileContent); + $scope.showFDecrypt = !$scope.requireFPass; + $scope.fileContent = $fileContent; + } catch (e) { + $scope.fileStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + }; + $scope.openFileDialog = function($fileContent) { + document.getElementById('fselector').click(); + }; + $scope.onFilePassChange = function() { + $scope.showFDecrypt = $scope.filePassword.length > 3; + }; + $scope.onPrivKeyChange = function() { + $scope.requirePPass = $scope.manualprivkey.length == 128 || $scope.manualprivkey.length == 132; + $scope.showPDecrypt = $scope.manualprivkey.length == 64; + }; + $scope.onPrivKeyPassChange = function() { + $scope.showPDecrypt = $scope.privPassword.length > 6; + }; + $scope.decryptWallet = function() { + $scope.wallet=null; + $scope.decryptStatus=""; + try { + if ($scope.showPDecrypt && $scope.requirePPass) { + $scope.wallet = Wallet.fromMyEtherWalletKey($scope.manualprivkey, $scope.privPassword); + walletService.password = $scope.privPassword; + } else if ($scope.showPDecrypt && !$scope.requirePPass) { + $scope.wallet = new Wallet($scope.manualprivkey); + walletService.password = ''; + } else if ($scope.showFDecrypt) { + $scope.wallet = Wallet.getWalletFromPrivKeyFile($scope.fileContent, $scope.filePassword); + walletService.password = $scope.filePassword; + } + walletService.wallet = $scope.wallet; + } catch (e) { + $scope.decryptStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[6]+e)); + } + if($scope.wallet!=null) $scope.decryptStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[1])); + }; +}; module.exports = decryptWalletCtrl; },{}],9:[function(require,module,exports){ -'use strict'; -var digixCtrl = function($scope, $sce, walletService) { - new Modal(document.getElementById('sendTransaction')); - walletService.wallet = null; - walletService.password = ''; - $scope.showSend = true; - $scope.showRaw = false; - $scope.digixContract = "0xf0160428a8552ac9bb7e050d90eeade4ddd52843"; - $scope.tokenContract = "0xe0b7927c4af23765cb51314a0e0521a9645f0e2a"; - $scope.badgeContract = "0x54bda709fed875224eae569bb6817d96ef7ed9ad"; - $scope.digixUserInfo = "0x1959a002"; - $scope.digixClaim = "0x4e71d92d"; - $scope.digixTransfer = "0xa9059cbb"; - $scope.balanceOf = "0x70a08231"; - $scope.tx = { - gasLimit: globalFuncs.digixClaimTxGasLimit, - data: $scope.digixClaim, - to: $scope.digixContract, - unit: "ether", - value: 0, - nonce: null, - gasPrice: null, - donate: false - } - $scope.tokenTx = { - to: '', - value: 0, - unit: "dgd" - } - $scope.$watch(function() { - if (walletService.wallet == null) return null; - return walletService.wallet.getAddressString(); - }, function() { - if (walletService.wallet == null) return; - $scope.wallet = walletService.wallet; - $scope.setBalance(); - }); - $scope.validateAddress = function(address, status) { - if (ethFuncs.validateEtherAddress(address)) { - $scope[status] = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[0])); - } else { - $scope[status] = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[5])); - } - } - $scope.setBalance = function() { - var tUserInfo = { - to: $scope.digixContract, - data: $scope.digixUserInfo - }; - ajaxReq.getBalance($scope.wallet.getAddressString(), function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.etherBalance = etherUnits.toEther(data.data.balance, 'wei'); - ajaxReq.getETHvalue(function(data) { - $scope.usdBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.usd); - $scope.eurBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.eur); - $scope.btcBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.btc); - }); - } - }); - var userInfo = ethFuncs.getDataObj($scope.digixContract, $scope.digixUserInfo, [ethFuncs.getNakedAddress($scope.wallet.getAddressString())]); - ajaxReq.getEthCall(userInfo, function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - var digixObj = $scope.processDigixInfo(data.data); - $scope.centsTotal = digixObj.centstotal; - $scope.weiTotal = digixObj.weitotal; - $scope.shareTotal = digixObj.share; - $scope.badgesTotal = digixObj.badges; - $scope.claimedTotal = digixObj.claimed.toString(); - } - }); - var tokenBalance = ethFuncs.getDataObj($scope.tokenContract, $scope.balanceOf, [ethFuncs.getNakedAddress($scope.wallet.getAddressString())]); - ajaxReq.getEthCall(tokenBalance, function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.tokenBalance = new BigNumber(data.data).div(1000000000).toString(); - } - }); - var badgeBalance = ethFuncs.getDataObj($scope.badgeContract, $scope.balanceOf, [ethFuncs.getNakedAddress($scope.wallet.getAddressString())]); - ajaxReq.getEthCall(badgeBalance, function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.badgeBalance = new BigNumber(data.data).toString(); - } - }); - } - $scope.processDigixInfo = function(data) { - data = data.replace('0x', ''); - var values = data.match(/.{1,64}/g); - var digixObj = { - centstotal: new BigNumber('0x' + values[0]).div(100).toString(), - weitotal: new BigNumber('0x' + values[1]).div(etherUnits.getValueOfUnit('ether')).toString(), - share: new BigNumber('0x' + values[2]).div(etherUnits.getValueOfUnit('gwei')).toString(), - badges: new BigNumber('0x' + values[3]).toString(), - claimed: new BigNumber('0x' + values[4]).toString() == '1' - }; - return digixObj; - } - $scope.$watch('tx', function() { - $scope.showRaw = false; - $scope.sendTxStatus = ""; - }, true); - $scope.$watch('showSend', function() { - $scope.showRaw = false; - $scope.sendTxStatus = ""; - if (!$scope.showSend) { - $scope.tx.data = $scope.digixClaim; - $scope.tx.to = $scope.digixContract; - $scope.tx.gasLimit = globalFuncs.digixClaimTxGasLimit; - } - }); - $scope.generateTokenTx = function() { - try { - if (!ethFuncs.validateEtherAddress($scope.tokenTx.to)) throw globalFuncs.errorMsgs[5]; - else if (!globalFuncs.isNumeric($scope.tokenTx.value) || parseFloat($scope.tokenTx.value) < 0) throw globalFuncs.errorMsgs[7]; - else if ($scope.tokenTx.unit == "dgd" && new BigNumber($scope.tokenTx.value).greaterThan(new BigNumber($scope.tokenBalance))) throw globalFuncs.errorMsgs[7]; - else if ($scope.tokenTx.unit == "dgdb" && new BigNumber($scope.tokenTx.value).greaterThan(new BigNumber($scope.badgeBalance))) throw globalFuncs.errorMsgs[7]; - var value = 0; - if ($scope.tokenTx.unit == "dgd") { - value = new BigNumber($scope.tokenTx.value).times(etherUnits.getValueOfUnit('gwei')).toString(16); - $scope.tx.to = $scope.tokenContract; - } else { - value = new BigNumber($scope.tokenTx.value).toString(16); - $scope.tx.to = $scope.badgeContract; - } - value = ethFuncs.padLeft(value, 64); - var toAdd = ethFuncs.padLeft(ethFuncs.getNakedAddress($scope.tokenTx.to), 64); - $scope.tx.data = $scope.digixTransfer + toAdd + value; - $scope.tx.value = 0; - $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText('')); - $scope.generateTx(); - } catch (e) { - $scope.showRaw = false; - $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - } - $scope.generateTx = function(){ - uiFuncs.generateTx($scope,$sce); - } - $scope.sendTx = function() { - uiFuncs.sendTx($scope,$sce); - } -}; -module.exports = digixCtrl; +'use strict'; +var digixCtrl = function($scope, $sce, walletService) { + new Modal(document.getElementById('sendTransaction')); + walletService.wallet = null; + walletService.password = ''; + $scope.showSend = true; + $scope.showRaw = false; + $scope.digixContract = "0xf0160428a8552ac9bb7e050d90eeade4ddd52843"; + $scope.tokenContract = "0xe0b7927c4af23765cb51314a0e0521a9645f0e2a"; + $scope.badgeContract = "0x54bda709fed875224eae569bb6817d96ef7ed9ad"; + $scope.digixUserInfo = "0x1959a002"; + $scope.digixClaim = "0x4e71d92d"; + $scope.digixTransfer = "0xa9059cbb"; + $scope.balanceOf = "0x70a08231"; + $scope.tx = { + gasLimit: globalFuncs.digixClaimTxGasLimit, + data: $scope.digixClaim, + to: $scope.digixContract, + unit: "ether", + value: 0, + nonce: null, + gasPrice: null, + donate: false + } + $scope.tokenTx = { + to: '', + value: 0, + unit: "dgd" + } + $scope.$watch(function() { + if (walletService.wallet == null) return null; + return walletService.wallet.getAddressString(); + }, function() { + if (walletService.wallet == null) return; + $scope.wallet = walletService.wallet; + $scope.setBalance(); + }); + $scope.validateAddress = function(address, status) { + if (ethFuncs.validateEtherAddress(address)) { + $scope[status] = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[0])); + } else { + $scope[status] = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[5])); + } + } + $scope.setBalance = function() { + var tUserInfo = { + to: $scope.digixContract, + data: $scope.digixUserInfo + }; + ajaxReq.getBalance($scope.wallet.getAddressString(), function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.etherBalance = etherUnits.toEther(data.data.balance, 'wei'); + ajaxReq.getETHvalue(function(data) { + $scope.usdBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.usd); + $scope.eurBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.eur); + $scope.btcBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.btc); + }); + } + }); + var userInfo = ethFuncs.getDataObj($scope.digixContract, $scope.digixUserInfo, [ethFuncs.getNakedAddress($scope.wallet.getAddressString())]); + ajaxReq.getEthCall(userInfo, function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + var digixObj = $scope.processDigixInfo(data.data); + $scope.centsTotal = digixObj.centstotal; + $scope.weiTotal = digixObj.weitotal; + $scope.shareTotal = digixObj.share; + $scope.badgesTotal = digixObj.badges; + $scope.claimedTotal = digixObj.claimed.toString(); + } + }); + var tokenBalance = ethFuncs.getDataObj($scope.tokenContract, $scope.balanceOf, [ethFuncs.getNakedAddress($scope.wallet.getAddressString())]); + ajaxReq.getEthCall(tokenBalance, function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.tokenBalance = new BigNumber(data.data).div(1000000000).toString(); + } + }); + var badgeBalance = ethFuncs.getDataObj($scope.badgeContract, $scope.balanceOf, [ethFuncs.getNakedAddress($scope.wallet.getAddressString())]); + ajaxReq.getEthCall(badgeBalance, function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.badgeBalance = new BigNumber(data.data).toString(); + } + }); + } + $scope.processDigixInfo = function(data) { + data = data.replace('0x', ''); + var values = data.match(/.{1,64}/g); + var digixObj = { + centstotal: new BigNumber('0x' + values[0]).div(100).toString(), + weitotal: new BigNumber('0x' + values[1]).div(etherUnits.getValueOfUnit('ether')).toString(), + share: new BigNumber('0x' + values[2]).div(etherUnits.getValueOfUnit('gwei')).toString(), + badges: new BigNumber('0x' + values[3]).toString(), + claimed: new BigNumber('0x' + values[4]).toString() == '1' + }; + return digixObj; + } + $scope.$watch('tx', function() { + $scope.showRaw = false; + $scope.sendTxStatus = ""; + }, true); + $scope.$watch('showSend', function() { + $scope.showRaw = false; + $scope.sendTxStatus = ""; + if (!$scope.showSend) { + $scope.tx.data = $scope.digixClaim; + $scope.tx.to = $scope.digixContract; + $scope.tx.gasLimit = globalFuncs.digixClaimTxGasLimit; + } + }); + $scope.generateTokenTx = function() { + try { + if (!ethFuncs.validateEtherAddress($scope.tokenTx.to)) throw globalFuncs.errorMsgs[5]; + else if (!globalFuncs.isNumeric($scope.tokenTx.value) || parseFloat($scope.tokenTx.value) < 0) throw globalFuncs.errorMsgs[7]; + else if ($scope.tokenTx.unit == "dgd" && new BigNumber($scope.tokenTx.value).greaterThan(new BigNumber($scope.tokenBalance))) throw globalFuncs.errorMsgs[7]; + else if ($scope.tokenTx.unit == "dgdb" && new BigNumber($scope.tokenTx.value).greaterThan(new BigNumber($scope.badgeBalance))) throw globalFuncs.errorMsgs[7]; + var value = 0; + if ($scope.tokenTx.unit == "dgd") { + value = new BigNumber($scope.tokenTx.value).times(etherUnits.getValueOfUnit('gwei')).toString(16); + $scope.tx.to = $scope.tokenContract; + } else { + value = new BigNumber($scope.tokenTx.value).toString(16); + $scope.tx.to = $scope.badgeContract; + } + value = ethFuncs.padLeft(value, 64); + var toAdd = ethFuncs.padLeft(ethFuncs.getNakedAddress($scope.tokenTx.to), 64); + $scope.tx.data = $scope.digixTransfer + toAdd + value; + $scope.tx.value = 0; + $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText('')); + $scope.generateTx(); + } catch (e) { + $scope.showRaw = false; + $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + } + $scope.generateTx = function(){ + uiFuncs.generateTx($scope,$sce); + } + $scope.sendTx = function() { + uiFuncs.sendTx($scope,$sce); + } +}; +module.exports = digixCtrl; },{}],10:[function(require,module,exports){ (function (Buffer){ -'use strict'; -var sendOfflineTxCtrl = function($scope, $sce, walletService) { - walletService.wallet = null; - walletService.password = ''; - $scope.showAdvance = false; - $scope.showRaw = false; - $scope.showWalletInfo = false; - $scope.gasPriceDec = 0; - $scope.nonceDec = 0; - $scope.tx = { - gasLimit: globalFuncs.defaultTxGasLimit, - from: "", - data: "", - to: "", - unit: "ether", - value: '', - nonce: null, - gasPrice: null, - donate: false - } - $scope.$watch(function() { - if (walletService.wallet == null) return null; - return walletService.wallet.getAddressString(); - }, function() { - if (walletService.wallet == null) return; - $scope.wallet = walletService.wallet; - }); - $scope.getWalletInfo = function() { - if (ethFuncs.validateEtherAddress($scope.tx.from)) { - ajaxReq.getTransactionData($scope.tx.from, function(data) { - if (data.error) throw data.msg; - data = data.data; - $scope.gasPriceDec = ethFuncs.hexToDecimal(ethFuncs.sanitizeHex(ethFuncs.addTinyMoreToGas(data.gasprice))); - $scope.nonceDec = ethFuncs.hexToDecimal(data.nonce); - $scope.showWalletInfo = true; - }); - } - } - $scope.$watch('tx', function() { - $scope.showRaw = false; - $scope.sendTxStatus = ""; - }, true); - $scope.validateAddress = function(address, status) { - if (ethFuncs.validateEtherAddress(address)) { - $scope[status] = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[0])); - } else { - $scope[status] = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[5])); - } - } - $scope.generateTx = function() { - try { - if (!ethFuncs.validateEtherAddress($scope.tx.to)) throw globalFuncs.errorMsgs[5]; - else if (!globalFuncs.isNumeric($scope.tx.value) || parseFloat($scope.tx.value) < 0) throw globalFuncs.errorMsgs[7]; - else if (!globalFuncs.isNumeric($scope.gasPriceDec) || parseFloat($scope.gasPriceDec) <= 0) throw globalFuncs.errorMsgs[10]; - else if (!globalFuncs.isNumeric($scope.nonceDec) || parseFloat($scope.nonceDec) < 0) throw globalFuncs.errorMsgs[11]; - else if (!globalFuncs.isNumeric($scope.tx.gasLimit) || parseFloat($scope.tx.gasLimit) <= 0) throw globalFuncs.errorMsgs[8]; - else if (!ethFuncs.validateHexString($scope.tx.data)) throw globalFuncs.errorMsgs[9]; - var rawTx = { - nonce: ethFuncs.sanitizeHex(ethFuncs.decimalToHex($scope.nonceDec)), - gasPrice: ethFuncs.sanitizeHex(ethFuncs.decimalToHex($scope.gasPriceDec)), - gasLimit: ethFuncs.sanitizeHex(ethFuncs.decimalToHex($scope.tx.gasLimit)), - to: ethFuncs.sanitizeHex($scope.tx.to), - value: ethFuncs.sanitizeHex(ethFuncs.decimalToHex(etherUnits.toWei($scope.tx.value, $scope.tx.unit))), - data: ethFuncs.sanitizeHex($scope.tx.data) - } - var eTx = new ethUtil.Tx(rawTx); - eTx.sign(new Buffer($scope.wallet.getPrivateKeyString(), 'hex')); - $scope.rawTx = JSON.stringify(rawTx); - $scope.signedTx = '0x' + eTx.serialize().toString('hex'); - $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText('')); - } catch (e) { - $scope.showRaw = false; - $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - } - $scope.confirmSendTx = function(){ - try { - if($scope.signedTx=="" || !ethFuncs.validateHexString($scope.signedTx)) throw globalFuncs.errorMsgs[12]; - var eTx = new ethUtil.Tx($scope.signedTx); - $scope.tx.to = '0x'+eTx.to.toString('hex'); - $scope.tx.value = etherUnits.toEther('0x'+eTx.value.toString('hex'),'wei'); - $scope.tx.unit = 'ether'; - new Modal(document.getElementById('sendTransactionOffline')).open(); - } catch (e){ - $scope.offlineTxPublishStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - } - $scope.sendTx = function() { - new Modal(document.getElementById('sendTransactionOffline')).close(); - ajaxReq.sendRawTx($scope.signedTx, function(data) { - if (data.error) { - $scope.offlineTxPublishStatus = $sce.trustAsHtml(globalFuncs.getDangerText(data.msg)); - } else { - $scope.offlineTxPublishStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[2] + " " + data.data)); - } - }); - } -}; +'use strict'; +var sendOfflineTxCtrl = function($scope, $sce, walletService) { + walletService.wallet = null; + walletService.password = ''; + $scope.showAdvance = false; + $scope.showRaw = false; + $scope.showWalletInfo = false; + $scope.gasPriceDec = 0; + $scope.nonceDec = 0; + $scope.tx = { + gasLimit: globalFuncs.defaultTxGasLimit, + from: "", + data: "", + to: "", + unit: "ether", + value: '', + nonce: null, + gasPrice: null, + donate: false + } + $scope.$watch(function() { + if (walletService.wallet == null) return null; + return walletService.wallet.getAddressString(); + }, function() { + if (walletService.wallet == null) return; + $scope.wallet = walletService.wallet; + }); + $scope.getWalletInfo = function() { + if (ethFuncs.validateEtherAddress($scope.tx.from)) { + ajaxReq.getTransactionData($scope.tx.from, function(data) { + if (data.error) throw data.msg; + data = data.data; + $scope.gasPriceDec = ethFuncs.hexToDecimal(ethFuncs.sanitizeHex(ethFuncs.addTinyMoreToGas(data.gasprice))); + $scope.nonceDec = ethFuncs.hexToDecimal(data.nonce); + $scope.showWalletInfo = true; + }); + } + } + $scope.$watch('tx', function() { + $scope.showRaw = false; + $scope.sendTxStatus = ""; + }, true); + $scope.validateAddress = function(address, status) { + if (ethFuncs.validateEtherAddress(address)) { + $scope[status] = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[0])); + } else { + $scope[status] = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[5])); + } + } + $scope.generateTx = function() { + try { + if (!ethFuncs.validateEtherAddress($scope.tx.to)) throw globalFuncs.errorMsgs[5]; + else if (!globalFuncs.isNumeric($scope.tx.value) || parseFloat($scope.tx.value) < 0) throw globalFuncs.errorMsgs[7]; + else if (!globalFuncs.isNumeric($scope.gasPriceDec) || parseFloat($scope.gasPriceDec) <= 0) throw globalFuncs.errorMsgs[10]; + else if (!globalFuncs.isNumeric($scope.nonceDec) || parseFloat($scope.nonceDec) < 0) throw globalFuncs.errorMsgs[11]; + else if (!globalFuncs.isNumeric($scope.tx.gasLimit) || parseFloat($scope.tx.gasLimit) <= 0) throw globalFuncs.errorMsgs[8]; + else if (!ethFuncs.validateHexString($scope.tx.data)) throw globalFuncs.errorMsgs[9]; + var rawTx = { + nonce: ethFuncs.sanitizeHex(ethFuncs.decimalToHex($scope.nonceDec)), + gasPrice: ethFuncs.sanitizeHex(ethFuncs.decimalToHex($scope.gasPriceDec)), + gasLimit: ethFuncs.sanitizeHex(ethFuncs.decimalToHex($scope.tx.gasLimit)), + to: ethFuncs.sanitizeHex($scope.tx.to), + value: ethFuncs.sanitizeHex(ethFuncs.decimalToHex(etherUnits.toWei($scope.tx.value, $scope.tx.unit))), + data: ethFuncs.sanitizeHex($scope.tx.data) + } + var eTx = new ethUtil.Tx(rawTx); + eTx.sign(new Buffer($scope.wallet.getPrivateKeyString(), 'hex')); + $scope.rawTx = JSON.stringify(rawTx); + $scope.signedTx = '0x' + eTx.serialize().toString('hex'); + $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText('')); + } catch (e) { + $scope.showRaw = false; + $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + } + $scope.confirmSendTx = function(){ + try { + if($scope.signedTx=="" || !ethFuncs.validateHexString($scope.signedTx)) throw globalFuncs.errorMsgs[12]; + var eTx = new ethUtil.Tx($scope.signedTx); + $scope.tx.to = '0x'+eTx.to.toString('hex'); + $scope.tx.value = etherUnits.toEther('0x'+eTx.value.toString('hex'),'wei'); + $scope.tx.unit = 'ether'; + new Modal(document.getElementById('sendTransactionOffline')).open(); + } catch (e){ + $scope.offlineTxPublishStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + } + $scope.sendTx = function() { + new Modal(document.getElementById('sendTransactionOffline')).close(); + ajaxReq.sendRawTx($scope.signedTx, function(data) { + if (data.error) { + $scope.offlineTxPublishStatus = $sce.trustAsHtml(globalFuncs.getDangerText(data.msg)); + } else { + $scope.offlineTxPublishStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[2] + " " + data.data)); + } + }); + } +}; module.exports = sendOfflineTxCtrl; }).call(this,require("buffer").Buffer) -},{"buffer":83}],11:[function(require,module,exports){ -'use strict'; -var sendTxCtrl = function($scope, $sce, walletService) { - new Modal(document.getElementById('sendTransaction')); - walletService.wallet = null; - walletService.password = ''; - $scope.showAdvance = false; - $scope.showRaw = false; - $scope.tx = { - gasLimit: globalFuncs.urlGet('gaslimit') == null ? globalFuncs.defaultTxGasLimit : globalFuncs.urlGet('gaslimit'), - data: globalFuncs.urlGet('data') == null ? "" : globalFuncs.urlGet('data'), - to: globalFuncs.urlGet('to') == null ? "" : globalFuncs.urlGet('to'), - unit: "ether", - value: globalFuncs.urlGet('value') == null ? "" : globalFuncs.urlGet('value'), - nonce: null, - gasPrice: null, - donate: false - } - $scope.$watch(function() { - if (walletService.wallet == null) return null; - return walletService.wallet.getAddressString(); - }, function() { - if (walletService.wallet == null) return; - $scope.wallet = walletService.wallet; - $scope.setBalance(); - }); - $scope.setBalance = function() { - ajaxReq.getBalance($scope.wallet.getAddressString(), function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.etherBalance = etherUnits.toEther(data.data.balance, 'wei'); - ajaxReq.getETHvalue(function(data) { - $scope.usdBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.usd); - $scope.eurBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.eur); - $scope.btcBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.btc); - }); - } - }); - } - $scope.$watch('tx', function() { - $scope.showRaw = false; - $scope.sendTxStatus = ""; - }, true); - $scope.validateAddress = function() { - if (ethFuncs.validateEtherAddress($scope.tx.to)) { - $scope.validateAddressStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[0])); - } else { - $scope.validateAddressStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[5])); - } - } - $scope.toggleShowAdvance = function() { - $scope.showAdvance = !$scope.showAdvance; - } - $scope.onDonateClick = function() { - $scope.tx.to = globalFuncs.donateAddress; - $scope.tx.donate = true; - $scope.validateAddress(); - } - $scope.generateTx = function(){ - uiFuncs.generateTx($scope,$sce); - } - $scope.sendTx = function() { - uiFuncs.sendTx($scope,$sce); - } - $scope.transferAllBalance = function() { - uiFuncs.transferAllBalance($scope,$sce); - } -}; +},{"buffer":84}],11:[function(require,module,exports){ +'use strict'; +var sendTxCtrl = function($scope, $sce, walletService) { + new Modal(document.getElementById('sendTransaction')); + walletService.wallet = null; + walletService.password = ''; + $scope.showAdvance = false; + $scope.showRaw = false; + $scope.tx = { + gasLimit: globalFuncs.urlGet('gaslimit') == null ? globalFuncs.defaultTxGasLimit : globalFuncs.urlGet('gaslimit'), + data: globalFuncs.urlGet('data') == null ? "" : globalFuncs.urlGet('data'), + to: globalFuncs.urlGet('to') == null ? "" : globalFuncs.urlGet('to'), + unit: "ether", + value: globalFuncs.urlGet('value') == null ? "" : globalFuncs.urlGet('value'), + nonce: null, + gasPrice: null, + donate: false + } + $scope.$watch(function() { + if (walletService.wallet == null) return null; + return walletService.wallet.getAddressString(); + }, function() { + if (walletService.wallet == null) return; + $scope.wallet = walletService.wallet; + $scope.setBalance(); + }); + $scope.setBalance = function() { + ajaxReq.getBalance($scope.wallet.getAddressString(), function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.etherBalance = etherUnits.toEther(data.data.balance, 'wei'); + ajaxReq.getETHvalue(function(data) { + $scope.usdBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.usd); + $scope.eurBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.eur); + $scope.btcBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.btc); + }); + } + }); + } + $scope.$watch('tx', function() { + $scope.showRaw = false; + $scope.sendTxStatus = ""; + }, true); + $scope.validateAddress = function() { + if (ethFuncs.validateEtherAddress($scope.tx.to)) { + $scope.validateAddressStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[0])); + } else { + $scope.validateAddressStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[5])); + } + } + $scope.toggleShowAdvance = function() { + $scope.showAdvance = !$scope.showAdvance; + } + $scope.onDonateClick = function() { + $scope.tx.to = globalFuncs.donateAddress; + $scope.tx.donate = true; + $scope.validateAddress(); + } + $scope.generateTx = function(){ + uiFuncs.generateTx($scope,$sce); + } + $scope.sendTx = function() { + uiFuncs.sendTx($scope,$sce); + } + $scope.transferAllBalance = function() { + uiFuncs.transferAllBalance($scope,$sce); + } +}; module.exports = sendTxCtrl; },{}],12:[function(require,module,exports){ -'use strict'; -var tabsCtrl = function($scope, globalService) { - $scope.tabNames = globalService.tabs; - var hval = window.location.hash; - if(hval!=""){ - hval = hval.replace("#",''); - for (var key in $scope.tabNames) { - if($scope.tabNames[key].url == hval){ - $scope.activeTab = globalService.currentTab = $scope.tabNames[key].id; - break; - } - $scope.activeTab = globalService.currentTab; - } - } else { - $scope.activeTab = globalService.currentTab; - } - $scope.tabClick = function(id) { - $scope.activeTab = globalService.currentTab = id; - for (var key in $scope.tabNames) { - if($scope.tabNames[key].id == id) - location.hash = $scope.tabNames[key].url; - } - } -}; -module.exports = tabsCtrl; +'use strict'; +var tabsCtrl = function($scope, globalService) { + $scope.tabNames = globalService.tabs; + var hval = window.location.hash; + if(hval!=""){ + hval = hval.replace("#",''); + for (var key in $scope.tabNames) { + if($scope.tabNames[key].url == hval){ + $scope.activeTab = globalService.currentTab = $scope.tabNames[key].id; + break; + } + $scope.activeTab = globalService.currentTab; + } + } else { + $scope.activeTab = globalService.currentTab; + } + $scope.tabClick = function(id) { + $scope.activeTab = globalService.currentTab = id; + for (var key in $scope.tabNames) { + if($scope.tabNames[key].id == id) + location.hash = $scope.tabNames[key].url; + } + } +}; +module.exports = tabsCtrl; },{}],13:[function(require,module,exports){ -'use strict'; -var theDaoCtrl = function($scope, $sce, walletService) { - $scope.curTab = "send"; - new Modal(document.getElementById('sendTransaction')); - $scope.voteModal = new Modal(document.getElementById('voteProposal')); - $scope.showVoteYes = $scope.showVoteNo = true; - walletService.wallet = null; - walletService.password = ''; - $scope.showAdvance = false; - $scope.showRaw = false; - $scope.slockitContract = "0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413"; //0xd838f9c9792bf8398e1f5fbfbd3b43c5a86445aa - $scope.slockitBalance = "0x70a08231"; - $scope.slockitSupply = "0x18160ddd"; - $scope.slockitTransfer = "0xa9059cbb"; - $scope.slockitProposal = "0x013cf08b"; - $scope.slockitminQuorumDivisor = "0x674ed066"; - $scope.slockitABalance = "0x39d1f908"; - $scope.slockitRToken = "0xcdef91d0"; - $scope.slockitVote = "0xc9d27afe"; - $scope.tx = { - gasLimit: 150000, - data: '', - to: $scope.slockitContract, - unit: "ether", - value: 0, - nonce: null, - gasPrice: null, - donate: false - } - $scope.token = { - balance: 0, - total: 0, - totRaised: 0 - } - $scope.tokenTx = { - to: '', - value: 0, - unit: "dao" - } - $scope.$watch(function() { - if (walletService.wallet == null) return null; - return walletService.wallet.getAddressString(); - }, function() { - if (walletService.wallet == null) return; - $scope.wallet = walletService.wallet; - $scope.setBalance(); - }); - $scope.setBalance = function() { - ajaxReq.getBalance($scope.wallet.getAddressString(), function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.etherBalance = etherUnits.toEther(data.data.balance, 'wei'); - ajaxReq.getETHvalue(function(data) { - $scope.usdBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.usd); - $scope.eurBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.eur); - $scope.btcBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.btc); - }); - } - }); - var userInfo = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitBalance, [ethFuncs.getNakedAddress($scope.wallet.getAddressString())]); - ajaxReq.getEthCall(userInfo, function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.token.balance = new BigNumber(data.data).div(etherUnits.getValueOfUnit('milli') * 10).toString(); - } - }); - var totSupply = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitSupply, []); - ajaxReq.getEthCall(totSupply, function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.token.total = new BigNumber(data.data).toString(); - } - }); - ajaxReq.getBalance($scope.slockitContract, function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.token.totRaised = etherUnits.toEther(data.data.balance, 'wei'); - } - }); - var minq = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitminQuorumDivisor, []); - ajaxReq.getEthCall(minq, function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.minQuorumDivisor = new BigNumber(data.data).toNumber(); - } - }); - var actB = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitABalance, []); - ajaxReq.getEthCall(actB, function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.actualBalance = new BigNumber(data.data).toNumber(); - } - }); - var rToken = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitRToken, [ethFuncs.getNakedAddress($scope.slockitContract)]); - ajaxReq.getEthCall(rToken, function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.rewardToken = new BigNumber(data.data).toNumber(); - } - }); - } - - $scope.setProposal = function() { - try { - $scope.loadProposalStatus = ""; - if (!globalFuncs.isNumeric($scope.proposalId) || parseFloat($scope.proposalId) < 0) throw globalFuncs.errorMsgs[15]; - var callProposal = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitProposal, [new BigNumber($scope.proposalId).toString(16)]); - ajaxReq.getEthCall(callProposal, function(data) { - try { - if (data.error) { - $scope.loadProposalStatus = data.msg; - } else { - var proposal = ethFuncs.contractOutToArray(data.data); - $scope.objProposal = { - id: $scope.proposalId, - recipient: '0x' + proposal[0], - amount: etherUnits.toEther('0x' + proposal[1], 'wei'), - content: proposal[12] == "0" ? "" : proposal.slice(13).join(), - description: proposal[12] == "0" ? "Propsoal ID #" + $scope.proposalId : globalFuncs.hexToAscii(proposal.slice(13).join('')).replace(/
/g, '\n').replace(/\\n/g, '\n'), - votingDeadline: new Date(new BigNumber("0x" + proposal[3]).toNumber() * 1000), - today: new Date(), - open: proposal[4] == '1' ? true : false, - proposalPassed: proposal[5] == '1' ? true : false, - proposalHash: '0x' + proposal[6], - proposalDeposit: etherUnits.toEther('0x' + proposal[7], 'wei'), - split: proposal[8] == '1' ? true : false, - yea: etherUnits.toEther('0x' + proposal[9], 'wei'), - nay: etherUnits.toEther('0x' + proposal[10], 'wei'), - creator: "0x" + proposal[11], - enabled: true, - minQuroum: function() { - var totalInWei = etherUnits.toWei($scope.token.totRaised, "ether"); - return etherUnits.toEther(totalInWei / $scope.minQuorumDivisor + (etherUnits.toWei(this.amount, "ether") * totalInWei) / (3 * ($scope.actualBalance + $scope.rewardToken)), "wei"); - }, - data: proposal - }; - $scope.showProposal = true; - - var yeaBN = new BigNumber($scope.objProposal.yea); - var nayBN = new BigNumber($scope.objProposal.nay); - $scope.objProposal.totalVotes = yeaBN.plus(nayBN) - $scope.objProposal.yeaPer = yeaBN.plus(nayBN).toNumber() == '0' ? 0 : yeaBN.div($scope.objProposal.totalVotes).times(100).toNumber(); - $scope.objProposal.nayPer = yeaBN.plus(nayBN).toNumber() == '0' ? 0 : nayBN.div($scope.objProposal.totalVotes).times(100).toNumber(); - - $scope.objProposal.quorumCurrent = ($scope.objProposal.totalVotes * 100) / $scope.token.totRaised; - $scope.objProposal.quorumPer = ($scope.objProposal.minQuroum() * 100) / $scope.token.totRaised; - - $scope.objProposal.openEnglish = $scope.objProposal.open == true ? "Yes" : "No"; - $scope.objProposal.splitEnglish = $scope.objProposal.split == true ? "Yes" : "No"; - $scope.objProposal.proposalPassedEnglish = $scope.objProposal.proposalPassed == true ? "Yes" : "No"; - - if ($scope.objProposal.description.indexOf('\n') > 0) { - var firstLine = $scope.objProposal.description.substring(0, $scope.objProposal.description.indexOf('\n')); - $scope.objProposal.descriptionHTML = $sce.trustAsHtml(globalFuncs.stripTags(marked($scope.objProposal.description.substring(firstLine.length + 1) || ""))); - $scope.objProposal.description = firstLine; - } - } - } catch (e) { - $scope.loadProposalStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[15] + e)); - $scope.showProposal = false; - } - }); - } catch (e) { - $scope.loadProposalStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - } - $scope.$watch('curTab', function() { - $scope.tx.data = ''; - $scope.showRaw = $scope.showProposal = false; - }); - $scope.$watch('[tx,curTab]', function() { - $scope.showRaw = false; - $scope.sendTxStatus = ""; - }, true); - - // sending - $scope.generateTokenTx = function() { - try { - if (!ethFuncs.validateEtherAddress($scope.tokenTx.to)) throw globalFuncs.errorMsgs[5]; - else if (!globalFuncs.isNumeric($scope.tokenTx.value) || parseFloat($scope.tokenTx.value) < 0) throw globalFuncs.errorMsgs[7]; - $scope.tx.to = $scope.slockitContract; - var value = ethFuncs.padLeft(new BigNumber($scope.tokenTx.value).times(etherUnits.getValueOfUnit('milli') * 10).toString(16), 64); - var toAdd = ethFuncs.padLeft(ethFuncs.getNakedAddress($scope.tokenTx.to), 64); - $scope.tx.data = $scope.slockitTransfer + toAdd + value; - $scope.tx.value = 0; - $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText('')); - $scope.generateTx(); - } catch (e) { - $scope.showRaw = false; - $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - }; - - $scope.generateTx = function() { - uiFuncs.generateTx($scope, $sce); - } - $scope.sendTx = function() { - uiFuncs.sendTx($scope, $sce); - } - - // voting - $scope.generateVoteTx = function(isYes) { - if (isYes) $scope.showVoteNo = false; - else $scope.showVoteYes = false; - try { - $scope.tx.to = $scope.slockitContract; - var id = ethFuncs.padLeft(new BigNumber($scope.proposalId).toString(16), 64); - var vote = isYes ? ethFuncs.padLeft("1", 64) : ethFuncs.padLeft("0", 64); - $scope.tx.data = $scope.slockitVote + id + vote; - $scope.tx.value = 0; - $scope.generateTx2(); - } catch (e) { - $scope.showRaw = false; - $scope.voteTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - } - $scope.generateTx2 = function() { - uiFuncs.generateTx($scope, $sce, function() { - $scope.sendTx2(); - }); - } - $scope.sendTx2 = function() { - ajaxReq.sendRawTx($scope.signedTx, function(data) { - if (data.error) { - $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(data.msg + "
" + globalFuncs.errorMsgs[17])); - } else { - $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[4] + " " + globalFuncs.successMsgs[2] + " " + data.data)); - } - }); - } -}; -module.exports = theDaoCtrl; +'use strict'; +var theDaoCtrl = function($scope, $sce, walletService) { + $scope.curTab = "send"; + new Modal(document.getElementById('sendTransaction')); + $scope.voteModal = new Modal(document.getElementById('voteProposal')); + $scope.showVoteYes = $scope.showVoteNo = true; + walletService.wallet = null; + walletService.password = ''; + $scope.showAdvance = false; + $scope.showRaw = false; + $scope.slockitContract = "0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413"; //0xd838f9c9792bf8398e1f5fbfbd3b43c5a86445aa + $scope.slockitBalance = "0x70a08231"; + $scope.slockitSupply = "0x18160ddd"; + $scope.slockitTransfer = "0xa9059cbb"; + $scope.slockitProposal = "0x013cf08b"; + $scope.slockitminQuorumDivisor = "0x674ed066"; + $scope.slockitABalance = "0x39d1f908"; + $scope.slockitRToken = "0xcdef91d0"; + $scope.slockitVote = "0xc9d27afe"; + $scope.tx = { + gasLimit: 150000, + data: '', + to: $scope.slockitContract, + unit: "ether", + value: 0, + nonce: null, + gasPrice: null, + donate: false + } + $scope.token = { + balance: 0, + total: 0, + totRaised: 0 + } + $scope.tokenTx = { + to: '', + value: 0, + unit: "dao" + } + $scope.$watch(function() { + if (walletService.wallet == null) return null; + return walletService.wallet.getAddressString(); + }, function() { + if (walletService.wallet == null) return; + $scope.wallet = walletService.wallet; + $scope.setBalance(); + }); + $scope.setBalance = function() { + ajaxReq.getBalance($scope.wallet.getAddressString(), function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.etherBalance = etherUnits.toEther(data.data.balance, 'wei'); + ajaxReq.getETHvalue(function(data) { + $scope.usdBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.usd); + $scope.eurBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.eur); + $scope.btcBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.btc); + }); + } + }); + var userInfo = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitBalance, [ethFuncs.getNakedAddress($scope.wallet.getAddressString())]); + ajaxReq.getEthCall(userInfo, function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.token.balance = new BigNumber(data.data).div(etherUnits.getValueOfUnit('milli') * 10).toString(); + } + }); + var totSupply = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitSupply, []); + ajaxReq.getEthCall(totSupply, function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.token.total = new BigNumber(data.data).toString(); + } + }); + ajaxReq.getBalance($scope.slockitContract, function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.token.totRaised = etherUnits.toEther(data.data.balance, 'wei'); + } + }); + var minq = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitminQuorumDivisor, []); + ajaxReq.getEthCall(minq, function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.minQuorumDivisor = new BigNumber(data.data).toNumber(); + } + }); + var actB = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitABalance, []); + ajaxReq.getEthCall(actB, function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.actualBalance = new BigNumber(data.data).toNumber(); + } + }); + var rToken = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitRToken, [ethFuncs.getNakedAddress($scope.slockitContract)]); + ajaxReq.getEthCall(rToken, function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.rewardToken = new BigNumber(data.data).toNumber(); + } + }); + } + + $scope.setProposal = function() { + try { + $scope.loadProposalStatus = ""; + if (!globalFuncs.isNumeric($scope.proposalId) || parseFloat($scope.proposalId) < 0) throw globalFuncs.errorMsgs[15]; + var callProposal = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitProposal, [new BigNumber($scope.proposalId).toString(16)]); + ajaxReq.getEthCall(callProposal, function(data) { + try { + if (data.error) { + $scope.loadProposalStatus = data.msg; + } else { + var proposal = ethFuncs.contractOutToArray(data.data); + $scope.objProposal = { + id: $scope.proposalId, + recipient: '0x' + proposal[0], + amount: etherUnits.toEther('0x' + proposal[1], 'wei'), + content: proposal[12] == "0" ? "" : proposal.slice(13).join(), + description: proposal[12] == "0" ? "Propsoal ID #" + $scope.proposalId : globalFuncs.stripTags(globalFuncs.hexToAscii(proposal.slice(13).join('')).replace(/
/g, '\n').replace(/\\n/g, '\n')), + votingDeadline: new Date(new BigNumber("0x" + proposal[3]).toNumber() * 1000), + today: new Date(), + open: proposal[4] == '1' ? true : false, + proposalPassed: proposal[5] == '1' ? true : false, + proposalHash: '0x' + proposal[6], + proposalDeposit: etherUnits.toEther('0x' + proposal[7], 'wei'), + split: proposal[8] == '1' ? true : false, + yea: etherUnits.toEther('0x' + proposal[9], 'wei'), + nay: etherUnits.toEther('0x' + proposal[10], 'wei'), + creator: "0x" + proposal[11], + enabled: true, + minQuroum: function() { + var totalInWei = etherUnits.toWei($scope.token.totRaised, "ether"); + return etherUnits.toEther(totalInWei / $scope.minQuorumDivisor + (etherUnits.toWei(this.amount, "ether") * totalInWei) / (3 * ($scope.actualBalance + $scope.rewardToken)), "wei"); + }, + data: proposal + }; + $scope.showProposal = true; + + var yeaBN = new BigNumber($scope.objProposal.yea); + var nayBN = new BigNumber($scope.objProposal.nay); + $scope.objProposal.totalVotes = yeaBN.plus(nayBN) + $scope.objProposal.yeaPer = yeaBN.plus(nayBN).toNumber() == '0' ? 0 : yeaBN.div($scope.objProposal.totalVotes).times(100).toNumber(); + $scope.objProposal.nayPer = yeaBN.plus(nayBN).toNumber() == '0' ? 0 : nayBN.div($scope.objProposal.totalVotes).times(100).toNumber(); + + $scope.objProposal.quorumCurrent = ($scope.objProposal.totalVotes * 100) / $scope.token.totRaised; + $scope.objProposal.quorumPer = ($scope.objProposal.minQuroum() * 100) / $scope.token.totRaised; + + $scope.objProposal.openEnglish = $scope.objProposal.open == true ? "Yes" : "No"; + $scope.objProposal.splitEnglish = $scope.objProposal.split == true ? "Yes" : "No"; + $scope.objProposal.proposalPassedEnglish = $scope.objProposal.proposalPassed == true ? "Yes" : "No"; + + if ($scope.objProposal.description.indexOf('\n') > 0) { + var firstLine = $scope.objProposal.description.substring(0, $scope.objProposal.description.indexOf('\n')); + $scope.objProposal.descriptionHTML = $sce.trustAsHtml(marked($scope.objProposal.description.substring(firstLine.length + 1) || "")); + $scope.objProposal.description = firstLine; + } + } + } catch (e) { + $scope.loadProposalStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[15] + e)); + $scope.showProposal = false; + } + }); + } catch (e) { + $scope.loadProposalStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + } + $scope.$watch('curTab', function() { + $scope.tx.data = ''; + $scope.showRaw = $scope.showProposal = false; + }); + $scope.$watch('[tx,curTab]', function() { + $scope.showRaw = false; + $scope.sendTxStatus = ""; + }, true); + + // sending + $scope.generateTokenTx = function() { + try { + if (!ethFuncs.validateEtherAddress($scope.tokenTx.to)) throw globalFuncs.errorMsgs[5]; + else if (!globalFuncs.isNumeric($scope.tokenTx.value) || parseFloat($scope.tokenTx.value) < 0) throw globalFuncs.errorMsgs[7]; + $scope.tx.to = $scope.slockitContract; + var value = ethFuncs.padLeft(new BigNumber($scope.tokenTx.value).times(etherUnits.getValueOfUnit('milli') * 10).toString(16), 64); + var toAdd = ethFuncs.padLeft(ethFuncs.getNakedAddress($scope.tokenTx.to), 64); + $scope.tx.data = $scope.slockitTransfer + toAdd + value; + $scope.tx.value = 0; + $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText('')); + $scope.generateTx(); + } catch (e) { + $scope.showRaw = false; + $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + }; + + $scope.generateTx = function() { + uiFuncs.generateTx($scope, $sce); + } + $scope.sendTx = function() { + uiFuncs.sendTx($scope, $sce); + } + + // voting + $scope.generateVoteTx = function(isYes) { + if (isYes) $scope.showVoteNo = false; + else $scope.showVoteYes = false; + try { + $scope.tx.to = $scope.slockitContract; + var id = ethFuncs.padLeft(new BigNumber($scope.proposalId).toString(16), 64); + var vote = isYes ? ethFuncs.padLeft("1", 64) : ethFuncs.padLeft("0", 64); + $scope.tx.data = $scope.slockitVote + id + vote; + $scope.tx.value = 0; + $scope.generateTx2(); + } catch (e) { + $scope.showRaw = false; + $scope.voteTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + } + $scope.generateTx2 = function() { + uiFuncs.generateTx($scope, $sce, function() { + $scope.sendTx2(); + }); + } + $scope.sendTx2 = function() { + ajaxReq.sendRawTx($scope.signedTx, function(data) { + if (data.error) { + $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(data.msg + "
" + globalFuncs.errorMsgs[17])); + } else { + $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[4] + " " + globalFuncs.successMsgs[2] + " " + data.data)); + } + }); + } +}; +module.exports = theDaoCtrl; },{}],14:[function(require,module,exports){ -'use strict'; -var theDaoProposalCtrl = function($scope, $sce, walletService) { - walletService.wallet = null; - walletService.password = ''; - $scope.voteModal = new Modal(document.getElementById('voteProposal')); - $scope.showVoteYes = $scope.showVoteNo = true; - $scope.AllProposals = []; - $scope.slockitContract = "0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413"; - $scope.slockitBalance = "0x70a08231"; - $scope.slockitSupply = "0x18160ddd"; - $scope.slockitTransfer = "0xa9059cbb"; - $scope.slockitProposal = "0x013cf08b"; - $scope.slockitminQuorumDivisor = "0x674ed066"; - $scope.slockitABalance = "0x39d1f908"; - $scope.slockitRToken = "0xcdef91d0"; - $scope.slockitVote = "0xc9d27afe"; - $scope.initValues = function() { - ajaxReq.getBalance($scope.slockitContract, function(data) { - if (!data.error) $scope.totRaised = etherUnits.toEther(data.data.balance, 'wei'); - var minq = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitminQuorumDivisor, []); - ajaxReq.getEthCall(minq, function(data) { - if (!data.error) $scope.minQuorumDivisor = new BigNumber(data.data).toNumber(); - var actB = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitABalance, []); - ajaxReq.getEthCall(actB, function(data) { - if (!data.error) $scope.actualBalance = new BigNumber(data.data).toNumber(); - var rToken = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitRToken, [ethFuncs.getNakedAddress($scope.slockitContract)]); - ajaxReq.getEthCall(rToken, function(data) { - if (!data.error) $scope.rewardToken = new BigNumber(data.data).toNumber(); - $scope.getAllProposals(); - }); - }); - }); - }); - } - $scope.tx = { - gasLimit: 150000, - data: '', - to: $scope.slockitContract, - unit: "ether", - value: 0, - nonce: null, - gasPrice: null, - donate: false - } - $scope.$watch(function() { - if (walletService.wallet == null) return null; - return walletService.wallet.getAddressString(); - }, function() { - if (walletService.wallet == null) return; - $scope.wallet = walletService.wallet; - }); - $scope.openVote = function(id) { - $scope.voteID = id; - $scope.showVoteYes = $scope.showVoteNo = true; - $scope.voteTxStatus = $scope.sendTxStatus = ""; - $scope.voteModal.open(); - } - $scope.getAllProposals = function() { - ajaxReq.getDAOProposals(function(proposals) { - for (var i = 0; i < proposals.length; i++) { - $scope.AllProposals.push($scope.getProposalObj(proposals[i])); - } - }); - } - - $scope.filters = { - }; - - if (globalFuncs.urlGet('id') == null) { - $scope.comparator = false; - } else { - $scope.filters.id = parseInt(globalFuncs.urlGet('id')); - $scope.comparator = true; - } - - if (globalFuncs.urlGet('open') == null) { - } else { - $scope.filters.open = globalFuncs.urlGet('open'); - $scope.comparator = false; - } - - if (globalFuncs.urlGet('split') == null) { - } else { - $scope.filters.split = globalFuncs.urlGet('split'); - $scope.comparator = false; - } - - if (globalFuncs.urlGet('description') == null) { - } else { - $scope.filters.description = globalFuncs.urlGet('description'); - $scope.comparator = false; - } - - if (globalFuncs.urlGet('id') == null && globalFuncs.urlGet('open') == null && globalFuncs.urlGet('split') == null && globalFuncs.urlGet('description') == null ) { - $scope.filters.split = 'false'; - $scope.filters.open = 'true'; - $scope.comparator = false; - } - - $scope.$watch('filters.id', function() { - if ($scope.filters.id == '') { - $scope.comparator = false; - $scope.filters.id = ''; - } - if ($scope.filters.id == null) { - $scope.comparator = false; - } - console.log("split: " + JSON.stringify($scope.filters)); - console.log("split: comparator: " + $scope.comparator); - }); - - $scope.$watch('filters.open', function() { - if ($scope.filters.open == null) {} else { - $scope.comparator = false; - $scope.filters.id = ''; - } - console.log("open: " + JSON.stringify($scope.filters)); - console.log("open: comparator: " + $scope.comparator); - }); - $scope.$watch('filters.split', function() { - if ($scope.filters.split == null) {} else { - $scope.comparator = false; - $scope.filters.id = ''; - } - console.log("split: " + JSON.stringify($scope.filters)); - console.log("split: comparator: " + $scope.comparator); - }); - - console.log("load: " + JSON.stringify($scope.filters)); - console.log("load: comparator: " + $scope.comparator); - - - - $scope.initValues(); - $scope.showProposal = function(id) { - if (!$scope.AllProposals[id].showprop) { - var callProposal = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitProposal, [new BigNumber(id).toString(16)]); - ajaxReq.getEthCall(callProposal, function(data) { - var iobj = { - proposalID: id, - data: data.data - }; - $scope.AllProposals[id] = $scope.getProposalObj(iobj); - $scope.AllProposals[id].showprop = true; - }); - } else { - $scope.AllProposals[id].showprop = false; - } - } - $scope.generateVoteTx = function(isYes) { - if (isYes) $scope.showVoteNo = false; - else $scope.showVoteYes = false; - try { - $scope.tx.to = $scope.slockitContract; - var id = ethFuncs.padLeft(new BigNumber($scope.voteID).toString(16), 64); - var vote = isYes ? ethFuncs.padLeft("1", 64) : ethFuncs.padLeft("0", 64); - $scope.tx.data = $scope.slockitVote + id + vote; - $scope.tx.value = 0; - $scope.generateTx(); - } catch (e) { - $scope.showRaw = false; - $scope.voteTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - } - $scope.getProposalObj = function(tProposal) { - var proposal = ethFuncs.contractOutToArray(tProposal.data); - var objProposal = { - id: tProposal.proposalID, - recipient: '0x' + proposal[0], - amount: etherUnits.toEther('0x' + proposal[1], 'wei'), - content: proposal[12] == "0" ? "" : proposal.slice(13).join(), - description: proposal[12] == "0" ? "Propsoal ID #" + tProposal.proposalID : globalFuncs.hexToAscii(proposal.slice(13).join('')).replace(/
/g, '\n').replace(/\\n/g, '\n'), - votingDeadline: new Date(new BigNumber("0x" + proposal[3]).toNumber() * 1000), - today: new Date(), - open: proposal[4] == '1' ? true : false, - proposalPassed: proposal[5] == '1' ? true : false, - proposalHash: '0x' + proposal[6], - proposalDeposit: etherUnits.toEther('0x' + proposal[7], 'wei'), - split: proposal[8] == '1' ? true : false, - yea: etherUnits.toEther('0x' + proposal[9], 'wei'), - nay: etherUnits.toEther('0x' + proposal[10], 'wei'), - creator: "0x" + proposal[11], - show: true, - showprop: false, - minQuroum: function() { - var totalInWei = etherUnits.toWei($scope.totRaised, "ether"); - return etherUnits.toEther(totalInWei / $scope.minQuorumDivisor + (etherUnits.toWei(this.amount, "ether") * totalInWei) / (3 * ($scope.actualBalance + $scope.rewardToken)), "wei"); - }, - data: proposal - }; - var yeaBN = new BigNumber(objProposal.yea); - var nayBN = new BigNumber(objProposal.nay); - objProposal.totalVotes = yeaBN.plus(nayBN) - objProposal.yeaPer = yeaBN.plus(nayBN).toNumber() == '0' ? 0 : yeaBN.div(objProposal.totalVotes).times(100).toNumber(); - objProposal.nayPer = yeaBN.plus(nayBN).toNumber() == '0' ? 0 : nayBN.div(objProposal.totalVotes).times(100).toNumber(); - - objProposal.quorumCurrent = (objProposal.totalVotes * 100) / $scope.totRaised; - objProposal.quorumPer = (objProposal.minQuroum() * 100) / $scope.totRaised; - - objProposal.openEnglish = objProposal.open == true ? "Yes" : "No"; - objProposal.splitEnglish = objProposal.split == true ? "Yes" : "No"; - objProposal.proposalPassedEnglish = objProposal.proposalPassed == true ? "Yes" : "No"; - - if (objProposal.description.indexOf('\n') > 0) { - var firstLine = objProposal.description.substring(0, objProposal.description.indexOf('\n')); - objProposal.descriptionHTML = $sce.trustAsHtml(globalFuncs.stripTags(marked(objProposal.description.substring(firstLine.length + 1) || ""))); - objProposal.description = firstLine; - } - - return objProposal; - } - $scope.generateTx = function() { - uiFuncs.generateTx($scope, $sce, function(){ - $scope.sendTx(); - }); - } - $scope.sendTx = function() { - ajaxReq.sendRawTx($scope.signedTx, function(data) { - if (data.error) { - $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(data.msg + "
" + globalFuncs.errorMsgs[17] )); - } else { - $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[4] + " " +globalFuncs.successMsgs[2] + " " + data.data)); - } - }); - } - -}; - - -module.exports = theDaoProposalCtrl; +'use strict'; +var theDaoProposalCtrl = function($scope, $sce, walletService) { + walletService.wallet = null; + walletService.password = ''; + $scope.voteModal = new Modal(document.getElementById('voteProposal')); + $scope.showVoteYes = $scope.showVoteNo = true; + $scope.AllProposals = []; + $scope.slockitContract = "0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413"; + $scope.slockitBalance = "0x70a08231"; + $scope.slockitSupply = "0x18160ddd"; + $scope.slockitTransfer = "0xa9059cbb"; + $scope.slockitProposal = "0x013cf08b"; + $scope.slockitminQuorumDivisor = "0x674ed066"; + $scope.slockitABalance = "0x39d1f908"; + $scope.slockitRToken = "0xcdef91d0"; + $scope.slockitVote = "0xc9d27afe"; + $scope.initValues = function() { + ajaxReq.getBalance($scope.slockitContract, function(data) { + if (!data.error) $scope.totRaised = etherUnits.toEther(data.data.balance, 'wei'); + var minq = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitminQuorumDivisor, []); + ajaxReq.getEthCall(minq, function(data) { + if (!data.error) $scope.minQuorumDivisor = new BigNumber(data.data).toNumber(); + var actB = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitABalance, []); + ajaxReq.getEthCall(actB, function(data) { + if (!data.error) $scope.actualBalance = new BigNumber(data.data).toNumber(); + var rToken = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitRToken, [ethFuncs.getNakedAddress($scope.slockitContract)]); + ajaxReq.getEthCall(rToken, function(data) { + if (!data.error) $scope.rewardToken = new BigNumber(data.data).toNumber(); + $scope.getAllProposals(); + }); + }); + }); + }); + } + $scope.tx = { + gasLimit: 150000, + data: '', + to: $scope.slockitContract, + unit: "ether", + value: 0, + nonce: null, + gasPrice: null, + donate: false + } + $scope.$watch(function() { + if (walletService.wallet == null) return null; + return walletService.wallet.getAddressString(); + }, function() { + if (walletService.wallet == null) return; + $scope.wallet = walletService.wallet; + }); + $scope.openVote = function(id) { + $scope.voteID = id; + $scope.showVoteYes = $scope.showVoteNo = true; + $scope.voteTxStatus = $scope.sendTxStatus = ""; + $scope.voteModal.open(); + } + $scope.getAllProposals = function() { + ajaxReq.getDAOProposals(function(proposals) { + for (var i = 0; i < proposals.length; i++) { + $scope.AllProposals.push($scope.getProposalObj(proposals[i])); + } + }); + } + + $scope.filters = { + id: globalFuncs.urlGet('id') != null ? parseInt(globalFuncs.urlGet('id')) : '', + open: globalFuncs.urlGet('open') != null ? globalFuncs.urlGet('open') : '', + split: globalFuncs.urlGet('split') != null ? globalFuncs.urlGet('split') : '', + description: globalFuncs.urlGet('description') != null ? globalFuncs.urlGet('description') : '' + }; + $scope.comparator = globalFuncs.urlGet('id') != null; + if ($scope.filters.id == '' && $scope.filters.open == '' && $scope.filters.split == '' && $scope.filters.description == '' ) { + $scope.filters.split = 'false'; + $scope.filters.open = 'true'; + } + + $scope.$watch('filters', function(newValue, oldValue) { + if ((newValue.id!=oldValue.id)&&($scope.filters.id == '' || $scope.filters.id == null)) $scope.comparator = false; + if (newValue.open!=oldValue.open && $scope.filters.open == '') $scope.filters.id = ''; + if (newValue.split!=oldValue.split && $scope.filters.split != '') $scope.filters.id = ''; + }, true); + $scope.initValues(); + $scope.showProposal = function(id) { + if (!$scope.AllProposals[id].showprop) { + var callProposal = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitProposal, [new BigNumber(id).toString(16)]); + ajaxReq.getEthCall(callProposal, function(data) { + var iobj = { + proposalID: id, + data: data.data + }; + $scope.AllProposals[id] = $scope.getProposalObj(iobj); + $scope.AllProposals[id].showprop = true; + }); + } else { + $scope.AllProposals[id].showprop = false; + } + } + $scope.generateVoteTx = function(isYes) { + if (isYes) $scope.showVoteNo = false; + else $scope.showVoteYes = false; + try { + $scope.tx.to = $scope.slockitContract; + var id = ethFuncs.padLeft(new BigNumber($scope.voteID).toString(16), 64); + var vote = isYes ? ethFuncs.padLeft("1", 64) : ethFuncs.padLeft("0", 64); + $scope.tx.data = $scope.slockitVote + id + vote; + $scope.tx.value = 0; + $scope.generateTx(); + } catch (e) { + $scope.showRaw = false; + $scope.voteTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + } + $scope.getProposalObj = function(tProposal) { + var proposal = ethFuncs.contractOutToArray(tProposal.data); + var objProposal = { + id: tProposal.proposalID, + recipient: '0x' + proposal[0], + amount: etherUnits.toEther('0x' + proposal[1], 'wei'), + content: proposal[12] == "0" ? "" : proposal.slice(13).join(), + description: proposal[12] == "0" ? "Propsoal ID #" + tProposal.proposalID : globalFuncs.stripTags(globalFuncs.hexToAscii(proposal.slice(13).join('')).replace(/
/g, '\n').replace(/\\n/g, '\n')), + votingDeadline: new Date(new BigNumber("0x" + proposal[3]).toNumber() * 1000), + today: new Date(), + open: proposal[4] == '1' ? true : false, + proposalPassed: proposal[5] == '1' ? true : false, + proposalHash: '0x' + proposal[6], + proposalDeposit: etherUnits.toEther('0x' + proposal[7], 'wei'), + split: proposal[8] == '1' ? true : false, + yea: etherUnits.toEther('0x' + proposal[9], 'wei'), + nay: etherUnits.toEther('0x' + proposal[10], 'wei'), + creator: "0x" + proposal[11], + show: true, + showprop: false, + minQuroum: function() { + var totalInWei = etherUnits.toWei($scope.totRaised, "ether"); + return etherUnits.toEther(totalInWei / $scope.minQuorumDivisor + (etherUnits.toWei(this.amount, "ether") * totalInWei) / (3 * ($scope.actualBalance + $scope.rewardToken)), "wei"); + }, + data: proposal + }; + var yeaBN = new BigNumber(objProposal.yea); + var nayBN = new BigNumber(objProposal.nay); + objProposal.totalVotes = yeaBN.plus(nayBN) + objProposal.yeaPer = yeaBN.plus(nayBN).toNumber() == '0' ? 0 : yeaBN.div(objProposal.totalVotes).times(100).toNumber(); + objProposal.nayPer = yeaBN.plus(nayBN).toNumber() == '0' ? 0 : nayBN.div(objProposal.totalVotes).times(100).toNumber(); + + objProposal.quorumCurrent = (objProposal.totalVotes * 100) / $scope.totRaised; + objProposal.quorumPer = (objProposal.minQuroum() * 100) / $scope.totRaised; + + objProposal.openEnglish = objProposal.open == true ? "Yes" : "No"; + objProposal.splitEnglish = objProposal.split == true ? "Yes" : "No"; + objProposal.proposalPassedEnglish = objProposal.proposalPassed == true ? "Yes" : "No"; + + if (objProposal.description.indexOf('\n') > 0) { + var firstLine = objProposal.description.substring(0, objProposal.description.indexOf('\n')); + objProposal.descriptionHTML = $sce.trustAsHtml(marked(objProposal.description.substring(firstLine.length + 1) || "")); + objProposal.description = firstLine; + } + return objProposal; + } + $scope.generateTx = function() { + uiFuncs.generateTx($scope, $sce, function(){ + $scope.sendTx(); + }); + } + $scope.sendTx = function() { + ajaxReq.sendRawTx($scope.signedTx, function(data) { + if (data.error) { + $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(data.msg + "
" + globalFuncs.errorMsgs[17] )); + } else { + $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[4] + " " +globalFuncs.successMsgs[2] + " " + data.data)); + } + }); + } + +}; + + +module.exports = theDaoProposalCtrl; },{}],15:[function(require,module,exports){ -'use strict'; -var viewCtrl = function($scope, globalService) { - $scope.globalService = globalService; -}; +'use strict'; +var viewCtrl = function($scope, globalService) { + $scope.globalService = globalService; +}; module.exports = viewCtrl; },{}],16:[function(require,module,exports){ -'use strict'; -var viewWalletCtrl = function($scope, walletService) { - walletService.wallet = null; - walletService.password = ''; - $scope.$watch(function() { - if (walletService.wallet == null) return null; - return walletService.wallet.getAddressString(); - }, function() { - if (walletService.wallet == null) return; - $scope.wallet = walletService.wallet; - $scope.showEnc = walletService.password != ''; - $scope.blob = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toJSON()); - if (walletService.password != '') { - $scope.blobEnc = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toV3(walletService.password, { - kdf: globalFuncs.kdf, - n: globalFuncs.scrypt.n - })); - $scope.encFileName = $scope.wallet.getV3Filename(); - } - ajaxReq.getBalance($scope.wallet.getAddressString(), function(data){ - if(data.error){ - $scope.etherBalance = data.msg; - } else { - $scope.etherBalance = etherUnits.toEther(data.data.balance,'wei'); - ajaxReq.getETHvalue(function(data){ - $scope.usdBalance = etherUnits.toFiat($scope.etherBalance,'ether',data.usd); - $scope.eurBalance = etherUnits.toFiat($scope.etherBalance,'ether',data.eur); - $scope.btcBalance = etherUnits.toFiat($scope.etherBalance,'ether',data.btc); - }); - } - }); - }); - $scope.printQRCode = function() { - globalFuncs.printPaperWallets(JSON.stringify([{ - address: $scope.wallet.getAddressString(), - private: $scope.wallet.getPrivateKeyString() - }])); - } -}; +'use strict'; +var viewWalletCtrl = function($scope, walletService) { + walletService.wallet = null; + walletService.password = ''; + $scope.$watch(function() { + if (walletService.wallet == null) return null; + return walletService.wallet.getAddressString(); + }, function() { + if (walletService.wallet == null) return; + $scope.wallet = walletService.wallet; + $scope.showEnc = walletService.password != ''; + $scope.blob = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toJSON()); + if (walletService.password != '') { + $scope.blobEnc = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toV3(walletService.password, { + kdf: globalFuncs.kdf, + n: globalFuncs.scrypt.n + })); + $scope.encFileName = $scope.wallet.getV3Filename(); + } + ajaxReq.getBalance($scope.wallet.getAddressString(), function(data){ + if(data.error){ + $scope.etherBalance = data.msg; + } else { + $scope.etherBalance = etherUnits.toEther(data.data.balance,'wei'); + ajaxReq.getETHvalue(function(data){ + $scope.usdBalance = etherUnits.toFiat($scope.etherBalance,'ether',data.usd); + $scope.eurBalance = etherUnits.toFiat($scope.etherBalance,'ether',data.eur); + $scope.btcBalance = etherUnits.toFiat($scope.etherBalance,'ether',data.btc); + }); + } + }); + }); + $scope.printQRCode = function() { + globalFuncs.printPaperWallets(JSON.stringify([{ + address: $scope.wallet.getAddressString(), + private: $scope.wallet.getPrivateKeyString() + }])); + } +}; module.exports = viewWalletCtrl; },{}],17:[function(require,module,exports){ -'use strict'; -var walletGenCtrl = function($scope) { - $scope.password = ""; - $scope.wallet = null; - $scope.showWallet = false; - $scope.blob = $scope.blobEnc = ""; - $scope.isDone = true; - $scope.showPass = true; - $scope.genNewWallet = function() { - if (!$scope.isStrongPass()) { - alert(globalFuncs.errorMsgs[1]); - } else if($scope.isDone){ - $scope.isDone = false; - $scope.wallet = Wallet.generate(false); - $scope.showWallet = true; - $scope.blob = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toJSON()); - $scope.blobEnc = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toV3($scope.password, { - kdf: globalFuncs.kdf, - n: globalFuncs.scrypt.n - })); - $scope.encFileName = $scope.wallet.getV3Filename(); - if(parent!=null) - parent.postMessage(JSON.stringify({address:$scope.wallet.getAddressString(), checksumAddress: $scope.wallet.getChecksumAddressString()}),"*"); - $scope.isDone = true; - } - } - $scope.printQRCode = function() { - globalFuncs.printPaperWallets(JSON.stringify([{ - address: $scope.wallet.getAddressString(), - private: $scope.wallet.getPrivateKeyString() - }])); - } - $scope.isStrongPass = function(){ - return globalFuncs.isStrongPass($scope.password); - } -}; +'use strict'; +var walletGenCtrl = function($scope) { + $scope.password = ""; + $scope.wallet = null; + $scope.showWallet = false; + $scope.blob = $scope.blobEnc = ""; + $scope.isDone = true; + $scope.showPass = true; + $scope.genNewWallet = function() { + if (!$scope.isStrongPass()) { + alert(globalFuncs.errorMsgs[1]); + } else if($scope.isDone){ + $scope.isDone = false; + $scope.wallet = Wallet.generate(false); + $scope.showWallet = true; + $scope.blob = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toJSON()); + $scope.blobEnc = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toV3($scope.password, { + kdf: globalFuncs.kdf, + n: globalFuncs.scrypt.n + })); + $scope.encFileName = $scope.wallet.getV3Filename(); + if(parent!=null) + parent.postMessage(JSON.stringify({address:$scope.wallet.getAddressString(), checksumAddress: $scope.wallet.getChecksumAddressString()}),"*"); + $scope.isDone = true; + } + } + $scope.printQRCode = function() { + globalFuncs.printPaperWallets(JSON.stringify([{ + address: $scope.wallet.getAddressString(), + private: $scope.wallet.getPrivateKeyString() + }])); + } + $scope.isStrongPass = function(){ + return globalFuncs.isStrongPass($scope.password); + } +}; module.exports = walletGenCtrl; },{}],18:[function(require,module,exports){ -'use strict'; -var cxFuncs = function() {} -cxFuncs.storage = chrome.storage.sync; -cxFuncs.getAllNickNames = function(callback) { - var nickNames = []; - this.storage.get(null, function(items) { - for (var key in items) { - if (items.hasOwnProperty(key)) { - var tobj = JSON.parse(items[key]); - if (tobj.type == 'wallet' || tobj.type == 'watchOnly') { - nickNames.push(tobj.nick); - nickNames.push(key); - } - } - } - callback(nickNames); - }); -} -cxFuncs.addWalletToStorage = function(address, encStr, nickname, callback) { - nickname = nickname.replace(/(<([^>]+)>)/ig, ""); - var value = { - nick: nickname, - priv: encStr, - type: 'wallet' - }; - var keyname = ethUtil.toChecksumAddress(address); - var obj = {}; - obj[keyname] = JSON.stringify(value); - this.storage.set(obj, callback); -} -cxFuncs.addWatchOnlyAddress = function(address, nickname, callback) { - nickname = nickname.replace(/(<([^>]+)>)/ig, ""); - var value = { - nick: nickname, - type: 'watchOnly' - }; - var keyname = ethUtil.toChecksumAddress(address);; - var obj = {}; - obj[keyname] = JSON.stringify(value); - this.storage.set(obj, callback); -} -cxFuncs.getStorageArr = function(filter, callback) { - var wallets = []; - this.storage.get(null, function(items) { - for (var key in items) { - if (items.hasOwnProperty(key)) { - var tobj = JSON.parse(items[key]); - if (tobj.type == filter) { - tobj['addr'] = key; - wallets.push(tobj); - } - } - } - wallets.sort(function(a, b) { - if (a.nick < b.nick) return -1; - if (a.nick > b.nick) return 1; - return 0; - }); - callback(wallets); - }); -} -cxFuncs.getWalletsArr = function(callback) { - this.getStorageArr('wallet', callback); -} -cxFuncs.getWatchOnlyArr = function(callback) { - this.getStorageArr('watchOnly', callback); -} -cxFuncs.deleteAccount = function(address,callback){ - this.storage.remove(address,function(){ - callback(address); - }); -} -cxFuncs.editNickName = function(address,newNick, callback){ - newNick = newNick.replace(/(<([^>]+)>)/ig,""); - this.storage.get(address, function(account) { - var accountInfo = account[address]; - accountInfo = JSON.parse(accountInfo); - accountInfo['nick'] = newNick; - account[address] = JSON.stringify(accountInfo); - cxFuncs.storage.set(account,function(){ - callback(newNick); - }); - }); -} +'use strict'; +var cxFuncs = function() {} +cxFuncs.storage = chrome.storage.sync; +cxFuncs.getAllNickNames = function(callback) { + var nickNames = []; + this.storage.get(null, function(items) { + for (var key in items) { + if (items.hasOwnProperty(key)) { + var tobj = JSON.parse(items[key]); + if (tobj.type == 'wallet' || tobj.type == 'watchOnly') { + nickNames.push(tobj.nick); + nickNames.push(key); + } + } + } + callback(nickNames); + }); +} +cxFuncs.addWalletToStorage = function(address, encStr, nickname, callback) { + nickname = nickname.replace(/(<([^>]+)>)/ig, ""); + var value = { + nick: nickname, + priv: encStr, + type: 'wallet' + }; + var keyname = ethUtil.toChecksumAddress(address); + var obj = {}; + obj[keyname] = JSON.stringify(value); + this.storage.set(obj, callback); +} +cxFuncs.addWatchOnlyAddress = function(address, nickname, callback) { + nickname = nickname.replace(/(<([^>]+)>)/ig, ""); + var value = { + nick: nickname, + type: 'watchOnly' + }; + var keyname = ethUtil.toChecksumAddress(address);; + var obj = {}; + obj[keyname] = JSON.stringify(value); + this.storage.set(obj, callback); +} +cxFuncs.getStorageArr = function(filter, callback) { + var wallets = []; + this.storage.get(null, function(items) { + for (var key in items) { + if (items.hasOwnProperty(key)) { + var tobj = JSON.parse(items[key]); + if (tobj.type == filter) { + tobj['addr'] = key; + wallets.push(tobj); + } + } + } + wallets.sort(function(a, b) { + if (a.nick < b.nick) return -1; + if (a.nick > b.nick) return 1; + return 0; + }); + callback(wallets); + }); +} +cxFuncs.getWalletsArr = function(callback) { + this.getStorageArr('wallet', callback); +} +cxFuncs.getWatchOnlyArr = function(callback) { + this.getStorageArr('watchOnly', callback); +} +cxFuncs.deleteAccount = function(address,callback){ + this.storage.remove(address,function(){ + callback(address); + }); +} +cxFuncs.editNickName = function(address,newNick, callback){ + newNick = newNick.replace(/(<([^>]+)>)/ig,""); + this.storage.get(address, function(account) { + var accountInfo = account[address]; + accountInfo = JSON.parse(accountInfo); + accountInfo['nick'] = newNick; + account[address] = JSON.stringify(accountInfo); + cxFuncs.storage.set(account,function(){ + callback(newNick); + }); + }); +} module.exports = cxFuncs; },{}],19:[function(require,module,exports){ -'use strict'; -var QRCodeDrtv = function() { - return function(scope, element, attrs) { - var watchVar = attrs.watchVar; - scope.$watch(watchVar, function() { - var value = attrs.qrCode; - element.empty(); - var delay = 0; - if (element[0].clientWidth == 0) delay = 200; - setTimeout(function() { - new QRCode(element[0], { - text: value, - width: element[0].clientWidth, - height: element[0].clientWidth, - colorDark: "#000000", - colorLight: "#ffffff", - correctLevel: QRCode.CorrectLevel.H - }); - }, delay); - }); - }; -}; +'use strict'; +var QRCodeDrtv = function() { + return function(scope, element, attrs) { + var watchVar = attrs.watchVar; + scope.$watch(watchVar, function() { + var value = attrs.qrCode; + element.empty(); + var delay = 0; + if (element[0].clientWidth == 0) delay = 200; + setTimeout(function() { + new QRCode(element[0], { + text: value, + width: element[0].clientWidth, + height: element[0].clientWidth, + colorDark: "#000000", + colorLight: "#ffffff", + correctLevel: QRCode.CorrectLevel.H + }); + }, delay); + }); + }; +}; module.exports = QRCodeDrtv; },{}],20:[function(require,module,exports){ -'use strict'; -var blockiesDrtv = function() { - return function(scope, element, attrs){ - var watchVar = attrs.watchVar; - scope.$watch(watchVar, function() { - var address = attrs.blockieAddress; - var content = ethFuncs.validateEtherAddress(address) ? globalFuncs.getBlockie(address):''; - element.css({ - 'background-image': 'url(' + content +')' - }); - }); - }; -}; +'use strict'; +var blockiesDrtv = function() { + return function(scope, element, attrs){ + var watchVar = attrs.watchVar; + scope.$watch(watchVar, function() { + var address = attrs.blockieAddress; + var content = ethFuncs.validateEtherAddress(address) ? globalFuncs.getBlockie(address):''; + element.css({ + 'background-image': 'url(' + content +')' + }); + }); + }; +}; module.exports = blockiesDrtv; },{}],21:[function(require,module,exports){ -'use strict'; -var cxWalletDecryptDrtv = function() { - return { - restrict : "E", - template : '
\n \ -
\n \ -

Select a Wallet:

\n \ -
\n \ - \n \ -
\n \ -
\n \ -
\n \ -

Enter the Password:

\n \ - \n \ -
\n \ -
\n \ -

Access Your Wallet:

\n \ - \n \ -
\n \ -
\n \ -
' - }; -}; -module.exports = cxWalletDecryptDrtv; +'use strict'; +var cxWalletDecryptDrtv = function() { + return { + restrict : "E", + template : '
\n \ +
\n \ +

Select a Wallet:

\n \ +
\n \ + \n \ +
\n \ +
\n \ +
\n \ +

Enter the Password:

\n \ + \n \ +
\n \ +
\n \ +

Access Your Wallet:

\n \ + \n \ +
\n \ +
\n \ +
' + }; +}; +module.exports = cxWalletDecryptDrtv; },{}],22:[function(require,module,exports){ -'use strict'; -var fileReaderDrtv = function($parse) { - return { - restrict: 'A', - scope: false, - link: function(scope, element, attrs) { - var fn = $parse(attrs.onReadFile); - element.on('change', function(onChangeEvent) { - var reader = new FileReader(); - reader.onload = function(onLoadEvent) { - scope.$apply(function() { - fn(scope, { - $fileContent: onLoadEvent.target.result - }); - }); - }; - reader.readAsText((onChangeEvent.srcElement || onChangeEvent.target).files[0]); - }); - } - }; -}; +'use strict'; +var fileReaderDrtv = function($parse) { + return { + restrict: 'A', + scope: false, + link: function(scope, element, attrs) { + var fn = $parse(attrs.onReadFile); + element.on('change', function(onChangeEvent) { + var reader = new FileReader(); + reader.onload = function(onLoadEvent) { + scope.$apply(function() { + fn(scope, { + $fileContent: onLoadEvent.target.result + }); + }); + }; + reader.readAsText((onChangeEvent.srcElement || onChangeEvent.target).files[0]); + }); + } + }; +}; module.exports = fileReaderDrtv; },{}],23:[function(require,module,exports){ -'use strict'; -var walletDecryptDrtv = function() { - return { - restrict : "E", - template : '
\n \ -
\n \ -

Select the format of your private key:

\n \ -
\n \ - \n \ -
\n \ -
\n \ - \n \ -
\n \ -
\n \ -
\n \ - \n \ -
\n \ -

Select your wallet file:

\n \ -
\n \ - \n \ - SELECT WALLET FILE... \n \ -
\n \ -
\n \ -
\n \ -

Your file is encrypted. Please enter the password:

\n \ - \n \ -
\n \ -
\n \ - \n \ - \n \ -
\n \ -

Paste / type your private key:

\n \ -
\n \ - \n \ -
\n \ -
\n \ -

Your file is encrypted. Please enter the password:

\n \ - \n \ -
\n \ -
\n \ - \n \ -
\n \ -
\n \ -

Access Your Wallet:

\n \ -

Access Your Wallet:

\n \ - \n \ -
\n \ -
\n \ -
' - }; -}; -module.exports = walletDecryptDrtv; +'use strict'; +var walletDecryptDrtv = function() { + return { + restrict : "E", + template : '
\n \ +
\n \ +

Select the format of your private key:

\n \ +
\n \ + \n \ +
\n \ +
\n \ + \n \ +
\n \ +
\n \ +
\n \ + \n \ +
\n \ +

Select your wallet file:

\n \ +
\n \ + \n \ + SELECT WALLET FILE... \n \ +
\n \ +
\n \ +
\n \ +

Your file is encrypted. Please enter the password:

\n \ + \n \ +
\n \ +
\n \ + \n \ + \n \ +
\n \ +

Paste / type your private key:

\n \ +
\n \ + \n \ +
\n \ +
\n \ +

Your file is encrypted. Please enter the password:

\n \ + \n \ +
\n \ +
\n \ + \n \ +
\n \ +
\n \ +

Access Your Wallet:

\n \ +

Access Your Wallet:

\n \ + \n \ +
\n \ +
\n \ +
' + }; +}; +module.exports = walletDecryptDrtv; },{}],24:[function(require,module,exports){ -'use strict'; -var ethFuncs = function() {} -ethFuncs.validateEtherAddress = function(address) { - if (address.substring(0, 2) != "0x") return false; - else if (!/^(0x)?[0-9a-f]{40}$/i.test(address)) return false; - else if (/^(0x)?[0-9a-f]{40}$/.test(address) || /^(0x)?[0-9A-F]{40}$/.test(address)) return true; - else - return this.isChecksumAddress(address); -} -ethFuncs.isChecksumAddress = function(address) { - return address == ethUtil.toChecksumAddress(address); -} -ethFuncs.validateHexString = function(str) { - if (str == "") return true; - str = str.substring(0, 2) == '0x' ? str.substring(2) : str; - var re = /[0-9A-Fa-f]+$/g; - return re.test(str); -} -ethFuncs.sanitizeHex = function(hex) { - hex = hex.substring(0, 2) == '0x' ? hex.substring(2) : hex; - if (hex == "") return ""; - return '0x' + this.padLeftEven(hex); -} -ethFuncs.padLeftEven = function(hex) { - hex = hex.length % 2 != 0 ? '0' + hex : hex; - return hex; -} -ethFuncs.addTinyMoreToGas = function(hex) { - hex = this.sanitizeHex(hex); - return new BigNumber(hex).plus(etherUnits.getValueOfUnit('gwei')).toDigits(2).toString(16); -} -ethFuncs.decimalToHex = function(dec) { - return new BigNumber(dec).toString(16); -} -ethFuncs.hexToDecimal = function(hex) { - return new BigNumber(this.sanitizeHex(hex)).toString(); -} -ethFuncs.contractOutToArray = function(hex) { - hex = hex.replace('0x', '').match(/.{64}/g); - for(var i=0;i= width ? n : new Array(width - n.length + 1).join(z) + n; -} -ethFuncs.getDataObj = function(to, func, arrVals) { - var val=""; - for(var i=0;i= width ? n : new Array(width - n.length + 1).join(z) + n; +} +ethFuncs.getDataObj = function(to, func, arrVals) { + var val=""; + for(var i=0;i"); -} -globalFuncs.getBlob = function(mime, str) { - var str = (typeof str === 'object') ? JSON.stringify(str) : str; - if (str == null) return ''; - var blob = new Blob([str], { - type: mime - }); - return window.URL.createObjectURL(blob); -} -globalFuncs.getSuccessText = function(str) { - return '

' + str + '

' -} -globalFuncs.getDangerText = function(str) { - return '

' + str + '

' -} -globalFuncs.errorMsgs = [ - "Please enter valid amount. ", - "Your password must be at least 9 characters. Please ensure it is a strong password. ", - "Sorry! We don't have a clue what type of wallet file this is. ", - "This is not a valid wallet file. ", - "This unit doesn\'t exists, please use the one of the following units ", - "Invalid address. ", - "Invalid password. ", - "Invalid amount. ", - "Invalid gas limit. ", - "Invalid data value. ", - "Invalid gas amount. ", - "Invalid nonce. ", - "Invalid signed transaction. ", - "A wallet with this nickname already exists. ", - "Wallet not found. ", - "Whoops. It doesnt look like a proposal with this ID exists yet or there is an error reading this proposal. ", - "A wallet with this address already exists in storage. Please check your wallets page. ", - "You need to have at some ETH in your account to cover the cost of gas. .05ETH should be more than sufficient for a few sends and votes. "]; -globalFuncs.successMsgs = ["Valid address", "Wallet successfully decrypted", "Transaction submitted. TX ID: ", "New wallet added: ", "You have successfully voted. Thank you for being an active participant in The DAO."]; -globalFuncs.scrypt = { - n: 1024 -}; -globalFuncs.postDelay = 300; -globalFuncs.kdf = "scrypt"; -globalFuncs.defaultTxGasLimit = 21000; -globalFuncs.digixClaimTxGasLimit = 150000; -globalFuncs.donateAddress = "0x7cB57B5A97eAbe94205C07890BE4c1aD31E486A8"; -globalFuncs.isNumeric = function(n) { - return !isNaN(parseFloat(n)) && isFinite(n); -} -globalFuncs.urlGet = function(name) { - if (name = (new RegExp('[?&]' + encodeURIComponent(name) + '=([^&]*)')).exec(location.search)) return this.stripTags(decodeURIComponent(name[1])); -} -globalFuncs.stripTags = function(str) { - var SCRIPT_REGEX = /)<[^<]*)*<\/script>/gi; - while (SCRIPT_REGEX.test(str)) { - str = str.replace(SCRIPT_REGEX, ""); - } - return str; -} -globalFuncs.checkAndRedirectHTTPS = function() { - var host = "myetherwallet.com"; - var githost = "kvhnuke.github.io"; - var githostw = "www.kvhnuke.github.io"; - var hostw = "www.myetherwallet.com"; - if ((host == window.location.host || githost == window.location.host || hostw == window.location.host || githostw == window.location.host) && (window.location.protocol != "https:")) window.location.protocol = "https"; -} -globalFuncs.isStrongPass = function(password) { - if (password.length > 8) { - return true; - } else { - return false; - } - //var re = /(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}/; - //return re.test(password); -} -globalFuncs.hexToAscii = function(hex) { - return hex.match(/.{1,2}/g).map(function(v) { - return String.fromCharCode(parseInt(v, 16)); - }).join(''); -} -module.exports = globalFuncs; +'use strict'; +var globalFuncs = function() {} +globalFuncs.getBlockie = function(address) { + return blockies.create({ + seed: address.toLowerCase(), + size: 8, + scale: 16 + }).toDataURL(); +} +globalFuncs.printPaperWallets = function(strJson) { + var win = window.open("about:blank", "_blank"); + var data = ""); +} +globalFuncs.getBlob = function(mime, str) { + var str = (typeof str === 'object') ? JSON.stringify(str) : str; + if (str == null) return ''; + var blob = new Blob([str], { + type: mime + }); + return window.URL.createObjectURL(blob); +} +globalFuncs.getSuccessText = function(str) { + return '

' + str + '

' +} +globalFuncs.getDangerText = function(str) { + return '

' + str + '

' +} +globalFuncs.errorMsgs = [ + "Please enter valid amount. ", + "Your password must be at least 9 characters. Please ensure it is a strong password. ", + "Sorry! We don't have a clue what type of wallet file this is. ", + "This is not a valid wallet file. ", + "This unit doesn\'t exists, please use the one of the following units ", + "Invalid address. ", + "Invalid password. ", + "Invalid amount. ", + "Invalid gas limit. ", + "Invalid data value. ", + "Invalid gas amount. ", + "Invalid nonce. ", + "Invalid signed transaction. ", + "A wallet with this nickname already exists. ", + "Wallet not found. ", + "Whoops. It doesnt look like a proposal with this ID exists yet or there is an error reading this proposal. ", + "A wallet with this address already exists in storage. Please check your wallets page. ", + "You need to have at some ETH in your account to cover the cost of gas. .05ETH should be more than sufficient for a few sends and votes. "]; +globalFuncs.successMsgs = ["Valid address", "Wallet successfully decrypted", "Transaction submitted. TX ID: ", "New wallet added: ", "You have successfully voted. Thank you for being an active participant in The DAO."]; +globalFuncs.scrypt = { + n: 1024 +}; +globalFuncs.postDelay = 300; +globalFuncs.kdf = "scrypt"; +globalFuncs.defaultTxGasLimit = 21000; +globalFuncs.digixClaimTxGasLimit = 150000; +globalFuncs.donateAddress = "0x7cB57B5A97eAbe94205C07890BE4c1aD31E486A8"; +globalFuncs.isNumeric = function(n) { + return !isNaN(parseFloat(n)) && isFinite(n); +} +globalFuncs.urlGet = function(name) { + if (name = (new RegExp('[?&]' + encodeURIComponent(name) + '=([^&]*)')).exec(location.search)) return this.stripTags(decodeURIComponent(name[1])); +} +globalFuncs.stripTags = function(str) { + var SCRIPT_REGEX = /)<[^<]*)*<\/script>/gi; + while (SCRIPT_REGEX.test(str)) { + str = str.replace(SCRIPT_REGEX, ""); + } + return str; +} +globalFuncs.checkAndRedirectHTTPS = function() { + var host = "myetherwallet.com"; + var githost = "kvhnuke.github.io"; + var githostw = "www.kvhnuke.github.io"; + var hostw = "www.myetherwallet.com"; + if ((host == window.location.host || githost == window.location.host || hostw == window.location.host || githostw == window.location.host) && (window.location.protocol != "https:")) window.location.protocol = "https"; +} +globalFuncs.isStrongPass = function(password) { + return password.length > 8; +} +globalFuncs.hexToAscii = function(hex) { + return hex.match(/.{1,2}/g).map(function(v) { + return String.fromCharCode(parseInt(v, 16)); + }).join(''); +} +module.exports = globalFuncs; },{}],27:[function(require,module,exports){ -'use strict'; -var IS_CX = false; -if(typeof chrome != 'undefined') - IS_CX = chrome.windows === undefined ? false : true; -require("babel-polyfill"); -var angular = require('angular'); -var BigNumber = require('bignumber.js'); -window.BigNumber = BigNumber; -var marked = require('marked'); -window.marked = marked; -var ethUtil = require('ethereumjs-util'); -ethUtil.crypto = require('crypto'); -ethUtil.Tx = require('ethereumjs-tx'); -ethUtil.scrypt = require('scryptsy'); -ethUtil.uuid = require('uuid'); -window.ethUtil = ethUtil; -var Wallet = require('./myetherwallet'); -window.Wallet = Wallet; -var globalFuncs = require('./globalFuncs'); -window.globalFuncs = globalFuncs; -var uiFuncs = require('./uiFuncs'); -window.uiFuncs = uiFuncs; -var etherUnits = require('./etherUnits'); -window.etherUnits = etherUnits; -var ajaxReq = require('./ajaxReq'); -window.ajaxReq = ajaxReq; -var ethFuncs = require('./ethFuncs'); -window.ethFuncs = ethFuncs; -if(IS_CX){ - var cxFuncs = require('./cxFuncs'); - window.cxFuncs = cxFuncs; -} -var tabsCtrl = require('./controllers/tabsCtrl'); -var viewCtrl = require('./controllers/viewCtrl'); -var walletGenCtrl = require('./controllers/walletGenCtrl'); -var bulkGenCtrl = require('./controllers/bulkGenCtrl'); -var decryptWalletCtrl = require('./controllers/decryptWalletCtrl'); -var viewWalletCtrl = require('./controllers/viewWalletCtrl'); -var sendTxCtrl = require('./controllers/sendTxCtrl'); -var digixCtrl = require('./controllers/digixCtrl'); -var theDaoCtrl = require('./controllers/theDaoCtrl'); -var theDaoProposalCtrl = require('./controllers/theDaoProposalCtrl'); -var sendOfflineTxCtrl = require('./controllers/sendOfflineTxCtrl'); -var globalService = require('./services/globalService'); -var walletService = require('./services/walletService'); -var blockiesDrtv = require('./directives/blockiesDrtv'); -var QRCodeDrtv = require('./directives/QRCodeDrtv'); -var walletDecryptDrtv = require('./directives/walletDecryptDrtv'); -var cxWalletDecryptDrtv = require('./directives/cxWalletDecryptDrtv'); -var fileReaderDrtv = require('./directives/fileReaderDrtv'); -if(IS_CX){ - var addWalletCtrl = require('./controllers/CX/addWalletCtrl'); - var cxDecryptWalletCtrl = require('./controllers/CX/cxDecryptWalletCtrl'); - var myWalletsCtrl = require('./controllers/CX/myWalletsCtrl'); - var mainPopCtrl = require('./controllers/CX/mainPopCtrl'); - var quickSendCtrl = require('./controllers/CX/quickSendCtrl'); -} -var app = angular.module('mewApp', []); -app.config(['$compileProvider', function($compileProvider) { - $compileProvider.aHrefSanitizationWhitelist(/^\s*(|blob|):/); -}]); -app.factory('globalService', ['$http','$httpParamSerializerJQLike',globalService]); -app.factory('walletService', walletService); -app.directive('blockieAddress', blockiesDrtv); -app.directive('qrCode', QRCodeDrtv); -app.directive('onReadFile', fileReaderDrtv); -app.directive('walletDecryptDrtv', walletDecryptDrtv); -app.directive('cxWalletDecryptDrtv', cxWalletDecryptDrtv); -app.controller('tabsCtrl', ['$scope', 'globalService', tabsCtrl]); -app.controller('viewCtrl', ['$scope', 'globalService', viewCtrl]); -app.controller('walletGenCtrl', ['$scope', walletGenCtrl]); -app.controller('bulkGenCtrl', ['$scope', bulkGenCtrl]); -app.controller('decryptWalletCtrl', ['$scope','$sce','walletService', decryptWalletCtrl]); -app.controller('viewWalletCtrl', ['$scope','walletService', viewWalletCtrl]); -app.controller('sendTxCtrl', ['$scope','$sce','walletService', sendTxCtrl]); -app.controller('digixCtrl', ['$scope','$sce','walletService', digixCtrl]); -app.controller('theDaoCtrl', ['$scope','$sce','walletService', theDaoCtrl]); -app.controller('theDaoProposalCtrl', ['$scope','$sce','walletService', theDaoProposalCtrl]); -app.controller('sendOfflineTxCtrl', ['$scope','$sce','walletService', sendOfflineTxCtrl]); -if(IS_CX){ - app.controller('addWalletCtrl', ['$scope','$sce', addWalletCtrl]); - app.controller('myWalletsCtrl', ['$scope','$sce', myWalletsCtrl]); - app.controller('mainPopCtrl', ['$scope','$sce', mainPopCtrl]); - app.controller('quickSendCtrl', ['$scope','$sce', quickSendCtrl]); - app.controller('cxDecryptWalletCtrl', ['$scope','$sce','walletService', cxDecryptWalletCtrl]); -} - -},{"./ajaxReq":1,"./controllers/CX/addWalletCtrl":2,"./controllers/CX/cxDecryptWalletCtrl":3,"./controllers/CX/mainPopCtrl":4,"./controllers/CX/myWalletsCtrl":5,"./controllers/CX/quickSendCtrl":6,"./controllers/bulkGenCtrl":7,"./controllers/decryptWalletCtrl":8,"./controllers/digixCtrl":9,"./controllers/sendOfflineTxCtrl":10,"./controllers/sendTxCtrl":11,"./controllers/tabsCtrl":12,"./controllers/theDaoCtrl":13,"./controllers/theDaoProposalCtrl":14,"./controllers/viewCtrl":15,"./controllers/viewWalletCtrl":16,"./controllers/walletGenCtrl":17,"./cxFuncs":18,"./directives/QRCodeDrtv":19,"./directives/blockiesDrtv":20,"./directives/cxWalletDecryptDrtv":21,"./directives/fileReaderDrtv":22,"./directives/walletDecryptDrtv":23,"./ethFuncs":24,"./etherUnits":25,"./globalFuncs":26,"./myetherwallet":28,"./services/globalService":29,"./services/walletService":30,"./uiFuncs":31,"angular":33,"babel-polyfill":49,"bignumber.js":51,"crypto":386,"ethereumjs-tx":416,"ethereumjs-util":417,"marked":433,"scryptsy":463,"uuid":483}],28:[function(require,module,exports){ +'use strict'; +var IS_CX = false; +if(typeof chrome != 'undefined') + IS_CX = chrome.windows === undefined ? false : true; +require("babel-polyfill"); +var angular = require('angular'); +var BigNumber = require('bignumber.js'); +window.BigNumber = BigNumber; +var marked = require('marked'); +window.marked = marked; +var ethUtil = require('ethereumjs-util'); +ethUtil.crypto = require('crypto'); +ethUtil.Tx = require('ethereumjs-tx'); +ethUtil.scrypt = require('scryptsy'); +ethUtil.uuid = require('uuid'); +window.ethUtil = ethUtil; +var Wallet = require('./myetherwallet'); +window.Wallet = Wallet; +var globalFuncs = require('./globalFuncs'); +window.globalFuncs = globalFuncs; +var uiFuncs = require('./uiFuncs'); +window.uiFuncs = uiFuncs; +var etherUnits = require('./etherUnits'); +window.etherUnits = etherUnits; +var ajaxReq = require('./ajaxReq'); +window.ajaxReq = ajaxReq; +var ethFuncs = require('./ethFuncs'); +window.ethFuncs = ethFuncs; +if(IS_CX){ + var cxFuncs = require('./cxFuncs'); + window.cxFuncs = cxFuncs; +} +var tabsCtrl = require('./controllers/tabsCtrl'); +var viewCtrl = require('./controllers/viewCtrl'); +var walletGenCtrl = require('./controllers/walletGenCtrl'); +var bulkGenCtrl = require('./controllers/bulkGenCtrl'); +var decryptWalletCtrl = require('./controllers/decryptWalletCtrl'); +var viewWalletCtrl = require('./controllers/viewWalletCtrl'); +var sendTxCtrl = require('./controllers/sendTxCtrl'); +var digixCtrl = require('./controllers/digixCtrl'); +var theDaoCtrl = require('./controllers/theDaoCtrl'); +var theDaoProposalCtrl = require('./controllers/theDaoProposalCtrl'); +var sendOfflineTxCtrl = require('./controllers/sendOfflineTxCtrl'); +var globalService = require('./services/globalService'); +var walletService = require('./services/walletService'); +var blockiesDrtv = require('./directives/blockiesDrtv'); +var QRCodeDrtv = require('./directives/QRCodeDrtv'); +var walletDecryptDrtv = require('./directives/walletDecryptDrtv'); +var cxWalletDecryptDrtv = require('./directives/cxWalletDecryptDrtv'); +var fileReaderDrtv = require('./directives/fileReaderDrtv'); +if(IS_CX){ + var addWalletCtrl = require('./controllers/CX/addWalletCtrl'); + var cxDecryptWalletCtrl = require('./controllers/CX/cxDecryptWalletCtrl'); + var myWalletsCtrl = require('./controllers/CX/myWalletsCtrl'); + var mainPopCtrl = require('./controllers/CX/mainPopCtrl'); + var quickSendCtrl = require('./controllers/CX/quickSendCtrl'); +} +var app = angular.module('mewApp', []); +app.config(['$compileProvider', function($compileProvider) { + $compileProvider.aHrefSanitizationWhitelist(/^\s*(|blob|):/); +}]); +app.factory('globalService', ['$http','$httpParamSerializerJQLike',globalService]); +app.factory('walletService', walletService); +app.directive('blockieAddress', blockiesDrtv); +app.directive('qrCode', QRCodeDrtv); +app.directive('onReadFile', fileReaderDrtv); +app.directive('walletDecryptDrtv', walletDecryptDrtv); +app.directive('cxWalletDecryptDrtv', cxWalletDecryptDrtv); +app.controller('tabsCtrl', ['$scope', 'globalService', tabsCtrl]); +app.controller('viewCtrl', ['$scope', 'globalService', viewCtrl]); +app.controller('walletGenCtrl', ['$scope', walletGenCtrl]); +app.controller('bulkGenCtrl', ['$scope', bulkGenCtrl]); +app.controller('decryptWalletCtrl', ['$scope','$sce','walletService', decryptWalletCtrl]); +app.controller('viewWalletCtrl', ['$scope','walletService', viewWalletCtrl]); +app.controller('sendTxCtrl', ['$scope','$sce','walletService', sendTxCtrl]); +app.controller('digixCtrl', ['$scope','$sce','walletService', digixCtrl]); +app.controller('theDaoCtrl', ['$scope','$sce','walletService', theDaoCtrl]); +app.controller('theDaoProposalCtrl', ['$scope','$sce','walletService', theDaoProposalCtrl]); +app.controller('sendOfflineTxCtrl', ['$scope','$sce','walletService', sendOfflineTxCtrl]); +if(IS_CX){ + app.controller('addWalletCtrl', ['$scope','$sce', addWalletCtrl]); + app.controller('myWalletsCtrl', ['$scope','$sce', myWalletsCtrl]); + app.controller('mainPopCtrl', ['$scope','$sce', mainPopCtrl]); + app.controller('quickSendCtrl', ['$scope','$sce', quickSendCtrl]); + app.controller('cxDecryptWalletCtrl', ['$scope','$sce','walletService', cxDecryptWalletCtrl]); +} + +},{"./ajaxReq":1,"./controllers/CX/addWalletCtrl":2,"./controllers/CX/cxDecryptWalletCtrl":3,"./controllers/CX/mainPopCtrl":4,"./controllers/CX/myWalletsCtrl":5,"./controllers/CX/quickSendCtrl":6,"./controllers/bulkGenCtrl":7,"./controllers/decryptWalletCtrl":8,"./controllers/digixCtrl":9,"./controllers/sendOfflineTxCtrl":10,"./controllers/sendTxCtrl":11,"./controllers/tabsCtrl":12,"./controllers/theDaoCtrl":13,"./controllers/theDaoProposalCtrl":14,"./controllers/viewCtrl":15,"./controllers/viewWalletCtrl":16,"./controllers/walletGenCtrl":17,"./cxFuncs":18,"./directives/QRCodeDrtv":19,"./directives/blockiesDrtv":20,"./directives/cxWalletDecryptDrtv":21,"./directives/fileReaderDrtv":22,"./directives/walletDecryptDrtv":23,"./ethFuncs":24,"./etherUnits":25,"./globalFuncs":26,"./myetherwallet":28,"./services/globalService":29,"./services/walletService":30,"./uiFuncs":31,"angular":33,"babel-polyfill":49,"bignumber.js":52,"crypto":387,"ethereumjs-tx":417,"ethereumjs-util":418,"marked":434,"scryptsy":463,"uuid":483}],28:[function(require,module,exports){ (function (Buffer){ -'use strict'; -var Wallet = function(priv) { - this.privKey = priv.length == 32 ? priv : Buffer(priv, 'hex') -} -Wallet.generate = function(icapDirect) { - if (icapDirect) { - while (true) { - var privKey = ethUtil.crypto.randomBytes(32) - if (ethUtil.privateToAddress(privKey)[0] === 0) { - return new Wallet(privKey) - } - } - } else { - return new Wallet(ethUtil.crypto.randomBytes(32)) - } -} -Wallet.prototype.getPrivateKey = function() { - return this.privKey -} -Wallet.prototype.getPrivateKeyString = function() { - return this.getPrivateKey().toString('hex') -} -Wallet.prototype.getPublicKey = function() { - return ethUtil.privateToPublic(this.privKey) -} -Wallet.prototype.getPublicKeyString = function() { - return '0x' + this.getPublicKey().toString('hex') -} -Wallet.prototype.getAddress = function() { - return ethUtil.privateToAddress(this.privKey) -} -Wallet.prototype.getAddressString = function() { - return '0x' + this.getAddress().toString('hex') -} -Wallet.prototype.getChecksumAddressString = function() { - return ethUtil.toChecksumAddress(this.getAddressString()) -} -Wallet.fromPrivateKey = function(priv) { - return new Wallet(priv) -} -Wallet.prototype.toV3 = function(password, opts) { - opts = opts || {} - var salt = opts.salt || ethUtil.crypto.randomBytes(32) - var iv = opts.iv || ethUtil.crypto.randomBytes(16) - var derivedKey - var kdf = opts.kdf || 'scrypt' - var kdfparams = { - dklen: opts.dklen || 32, - salt: salt.toString('hex') - } - if (kdf === 'pbkdf2') { - kdfparams.c = opts.c || 262144 - kdfparams.prf = 'hmac-sha256' - derivedKey = ethUtil.crypto.pbkdf2Sync(new Buffer(password), salt, kdfparams.c, kdfparams.dklen, 'sha256') - } else if (kdf === 'scrypt') { - // FIXME: support progress reporting callback - kdfparams.n = opts.n || 262144 - kdfparams.r = opts.r || 8 - kdfparams.p = opts.p || 1 - derivedKey = ethUtil.scrypt(new Buffer(password), salt, kdfparams.n, kdfparams.r, kdfparams.p, kdfparams.dklen) - } else { - throw new Error('Unsupported kdf') - } - var cipher = ethUtil.crypto.createCipheriv(opts.cipher || 'aes-128-ctr', derivedKey.slice(0, 16), iv) - if (!cipher) { - throw new Error('Unsupported cipher') - } - var ciphertext = Buffer.concat([cipher.update(this.privKey), cipher.final()]) - var mac = ethUtil.sha3(Buffer.concat([derivedKey.slice(16, 32), new Buffer(ciphertext, 'hex')])) - return { - version: 3, - id: ethUtil.uuid.v4({ - random: opts.uuid || ethUtil.crypto.randomBytes(16) - }), - address: this.getAddress().toString('hex'), - Crypto: { - ciphertext: ciphertext.toString('hex'), - cipherparams: { - iv: iv.toString('hex') - }, - cipher: opts.cipher || 'aes-128-ctr', - kdf: kdf, - kdfparams: kdfparams, - mac: mac.toString('hex') - } - } -} -Wallet.prototype.toJSON = function() { - return { - address: this.getAddressString(), - checksumAddress: this.getChecksumAddressString(), - privKey: this.getPrivateKeyString(), - pubKey: this.getPublicKeyString(), - publisher:"MyEtherWallet", - encrypted:false, - version:2 - } -} -Wallet.fromMyEtherWallet = function(input, password) { - var json = (typeof input === 'object') ? input : JSON.parse(input) - var privKey - if (!json.locked) { - if (json.private.length !== 64) { - throw new Error('Invalid private key length') - } - privKey = new Buffer(json.private, 'hex') - } else { - if (typeof password !== 'string') { - throw new Error('Password required') - } - if (password.length < 7) { - throw new Error('Password must be at least 7 characters') - } - var cipher = json.encrypted ? json.private.slice(0, 128) : json.private - cipher = Wallet.decodeCryptojsSalt(cipher) - var evp = Wallet.evp_kdf(new Buffer(password), cipher.salt, { - keysize: 32, - ivsize: 16 - }) - var decipher = ethUtil.crypto.createDecipheriv('aes-256-cbc', evp.key, evp.iv) - privKey = Wallet.decipherBuffer(decipher, new Buffer(cipher.ciphertext)) - privKey = new Buffer((privKey.toString()), 'hex') - } - var wallet = new Wallet(privKey) - if (wallet.getAddressString() !== json.address) { - throw new Error('Invalid private key or address') - } - return wallet -} -Wallet.fromMyEtherWalletV2 = function (input){ - var json = (typeof input === 'object') ? input : JSON.parse(input); - if (json.privKey.length !== 64) { - throw new Error('Invalid private key length'); - }; - var privKey = new Buffer(json.privKey, 'hex'); - return new Wallet(privKey); -} -Wallet.fromEthSale = function(input, password) { - var json = (typeof input === 'object') ? input : JSON.parse(input) - var encseed = new Buffer(json.encseed, 'hex') - var derivedKey = ethUtil.crypto.pbkdf2Sync(Buffer(password), Buffer(password), 2000, 32, 'sha256').slice(0, 16) - var decipher = ethUtil.crypto.createDecipheriv('aes-128-cbc', derivedKey, encseed.slice(0, 16)) - var seed = Wallet.decipherBuffer(decipher, encseed.slice(16)) - var wallet = new Wallet(ethUtil.sha3(seed)) - if (wallet.getAddress().toString('hex') !== json.ethaddr) { - throw new Error('Decoded key mismatch - possibly wrong passphrase') - } - return wallet -} -Wallet.fromMyEtherWalletKey = function(input, password) { - var cipher = input.slice(0, 128) - cipher = Wallet.decodeCryptojsSalt(cipher) - var evp = Wallet.evp_kdf(new Buffer(password), cipher.salt, { - keysize: 32, - ivsize: 16 - }) - var decipher = ethUtil.crypto.createDecipheriv('aes-256-cbc', evp.key, evp.iv) - var privKey = Wallet.decipherBuffer(decipher, new Buffer(cipher.ciphertext)) - privKey = new Buffer((privKey.toString()), 'hex') - return new Wallet(privKey) -} -Wallet.fromV3 = function(input, password, nonStrict) { - var json = (typeof input === 'object') ? input : JSON.parse(nonStrict ? input.toLowerCase() : input) - if (json.version !== 3) { - throw new Error('Not a V3 wallet') - } - var derivedKey - var kdfparams - if (json.crypto.kdf === 'scrypt') { - kdfparams = json.crypto.kdfparams - derivedKey = ethUtil.scrypt(new Buffer(password), new Buffer(kdfparams.salt, 'hex'), kdfparams.n, kdfparams.r, kdfparams.p, kdfparams.dklen) - } else if (json.crypto.kdf === 'pbkdf2') { - kdfparams = json.crypto.kdfparams - if (kdfparams.prf !== 'hmac-sha256') { - throw new Error('Unsupported parameters to PBKDF2') - } - derivedKey = ethUtil.crypto.pbkdf2Sync(new Buffer(password), new Buffer(kdfparams.salt, 'hex'), kdfparams.c, kdfparams.dklen, 'sha256') - } else { - throw new Error('Unsupported key derivation scheme') - } - var ciphertext = new Buffer(json.crypto.ciphertext, 'hex') - var mac = ethUtil.sha3(Buffer.concat([derivedKey.slice(16, 32), ciphertext])) - if (mac.toString('hex') !== json.crypto.mac) { - throw new Error('Key derivation failed - possibly wrong passphrase') - } - var decipher = ethUtil.crypto.createDecipheriv(json.crypto.cipher, derivedKey.slice(0, 16), new Buffer(json.crypto.cipherparams.iv, 'hex')) - var seed = Wallet.decipherBuffer(decipher, ciphertext, 'hex') - return new Wallet(seed) -} -Wallet.prototype.toV3String = function(password, opts) { - return JSON.stringify(this.toV3(password, opts)) -} -Wallet.prototype.getV3Filename = function (timestamp) { - var ts = timestamp ? new Date(timestamp) : new Date() - return [ - 'UTC--', - ts.toJSON().replace(/:/g, '-'), - '--', - this.getAddress().toString('hex') - ].join('') -} -Wallet.decipherBuffer = function(decipher, data) { - return Buffer.concat([decipher.update(data), decipher.final()]) -} -Wallet.decodeCryptojsSalt = function(input) { - var ciphertext = new Buffer(input, 'base64') - if (ciphertext.slice(0, 8).toString() === 'Salted__') { - return { - salt: ciphertext.slice(8, 16), - ciphertext: ciphertext.slice(16) - } - } else { - return { - ciphertext: ciphertext - } - } -} -Wallet.evp_kdf = function(data, salt, opts) { - // A single EVP iteration, returns `D_i`, where block equlas to `D_(i-1)` - - function iter(block) { - var hash = ethUtil.crypto.createHash(opts.digest || 'md5') - hash.update(block) - hash.update(data) - hash.update(salt) - block = hash.digest() - for (var i = 1; i < (opts.count || 1); i++) { - hash = ethUtil.crypto.createHash(opts.digest || 'md5') - hash.update(block) - block = hash.digest() - } - return block - } - var keysize = opts.keysize || 16 - var ivsize = opts.ivsize || 16 - var ret = [] - var i = 0 - while (Buffer.concat(ret).length < (keysize + ivsize)) { - ret[i] = iter((i === 0) ? new Buffer(0) : ret[i - 1]) - i++ - } - var tmp = Buffer.concat(ret) - return { - key: tmp.slice(0, keysize), - iv: tmp.slice(keysize, keysize + ivsize) - } -} -Wallet.walletRequirePass = function(ethjson) { - var jsonArr; - try { - jsonArr = JSON.parse(ethjson); - } catch (err) { - throw globalFuncs.errorMsgs[3]; - } - if (jsonArr.encseed != null) return true; - else if (jsonArr.Crypto != null || jsonArr.crypto != null) return true - else if (jsonArr.hash != null && jsonArr.locked) return true; - else if (jsonArr.hash != null && !jsonArr.locked) return false; - else if (jsonArr.publisher == "MyEtherWallet" && !jsonArr.encrypted) return false; - else - throw globalFuncs.errorMsgs[2]; -} -Wallet.getWalletFromPrivKeyFile = function(strjson, password) { - var jsonArr = JSON.parse(strjson); - if (jsonArr.encseed != null) return Wallet.fromEthSale(strjson, password); - else if (jsonArr.Crypto != null || jsonArr.crypto != null) return Wallet.fromV3(strjson, password, true); - else if (jsonArr.hash != null) return Wallet.fromMyEtherWallet(strjson, password); - else if (jsonArr.publisher == "MyEtherWallet") return Wallet.fromMyEtherWalletV2(strjson); - else - throw globalFuncs.errorMsgs[2]; -} +'use strict'; +var Wallet = function(priv) { + this.privKey = priv.length == 32 ? priv : Buffer(priv, 'hex') +} +Wallet.generate = function(icapDirect) { + if (icapDirect) { + while (true) { + var privKey = ethUtil.crypto.randomBytes(32) + if (ethUtil.privateToAddress(privKey)[0] === 0) { + return new Wallet(privKey) + } + } + } else { + return new Wallet(ethUtil.crypto.randomBytes(32)) + } +} +Wallet.prototype.getPrivateKey = function() { + return this.privKey +} +Wallet.prototype.getPrivateKeyString = function() { + return this.getPrivateKey().toString('hex') +} +Wallet.prototype.getPublicKey = function() { + return ethUtil.privateToPublic(this.privKey) +} +Wallet.prototype.getPublicKeyString = function() { + return '0x' + this.getPublicKey().toString('hex') +} +Wallet.prototype.getAddress = function() { + return ethUtil.privateToAddress(this.privKey) +} +Wallet.prototype.getAddressString = function() { + return '0x' + this.getAddress().toString('hex') +} +Wallet.prototype.getChecksumAddressString = function() { + return ethUtil.toChecksumAddress(this.getAddressString()) +} +Wallet.fromPrivateKey = function(priv) { + return new Wallet(priv) +} +Wallet.prototype.toV3 = function(password, opts) { + opts = opts || {} + var salt = opts.salt || ethUtil.crypto.randomBytes(32) + var iv = opts.iv || ethUtil.crypto.randomBytes(16) + var derivedKey + var kdf = opts.kdf || 'scrypt' + var kdfparams = { + dklen: opts.dklen || 32, + salt: salt.toString('hex') + } + if (kdf === 'pbkdf2') { + kdfparams.c = opts.c || 262144 + kdfparams.prf = 'hmac-sha256' + derivedKey = ethUtil.crypto.pbkdf2Sync(new Buffer(password), salt, kdfparams.c, kdfparams.dklen, 'sha256') + } else if (kdf === 'scrypt') { + // FIXME: support progress reporting callback + kdfparams.n = opts.n || 262144 + kdfparams.r = opts.r || 8 + kdfparams.p = opts.p || 1 + derivedKey = ethUtil.scrypt(new Buffer(password), salt, kdfparams.n, kdfparams.r, kdfparams.p, kdfparams.dklen) + } else { + throw new Error('Unsupported kdf') + } + var cipher = ethUtil.crypto.createCipheriv(opts.cipher || 'aes-128-ctr', derivedKey.slice(0, 16), iv) + if (!cipher) { + throw new Error('Unsupported cipher') + } + var ciphertext = Buffer.concat([cipher.update(this.privKey), cipher.final()]) + var mac = ethUtil.sha3(Buffer.concat([derivedKey.slice(16, 32), new Buffer(ciphertext, 'hex')])) + return { + version: 3, + id: ethUtil.uuid.v4({ + random: opts.uuid || ethUtil.crypto.randomBytes(16) + }), + address: this.getAddress().toString('hex'), + Crypto: { + ciphertext: ciphertext.toString('hex'), + cipherparams: { + iv: iv.toString('hex') + }, + cipher: opts.cipher || 'aes-128-ctr', + kdf: kdf, + kdfparams: kdfparams, + mac: mac.toString('hex') + } + } +} +Wallet.prototype.toJSON = function() { + return { + address: this.getAddressString(), + checksumAddress: this.getChecksumAddressString(), + privKey: this.getPrivateKeyString(), + pubKey: this.getPublicKeyString(), + publisher:"MyEtherWallet", + encrypted:false, + version:2 + } +} +Wallet.fromMyEtherWallet = function(input, password) { + var json = (typeof input === 'object') ? input : JSON.parse(input) + var privKey + if (!json.locked) { + if (json.private.length !== 64) { + throw new Error('Invalid private key length') + } + privKey = new Buffer(json.private, 'hex') + } else { + if (typeof password !== 'string') { + throw new Error('Password required') + } + if (password.length < 7) { + throw new Error('Password must be at least 7 characters') + } + var cipher = json.encrypted ? json.private.slice(0, 128) : json.private + cipher = Wallet.decodeCryptojsSalt(cipher) + var evp = Wallet.evp_kdf(new Buffer(password), cipher.salt, { + keysize: 32, + ivsize: 16 + }) + var decipher = ethUtil.crypto.createDecipheriv('aes-256-cbc', evp.key, evp.iv) + privKey = Wallet.decipherBuffer(decipher, new Buffer(cipher.ciphertext)) + privKey = new Buffer((privKey.toString()), 'hex') + } + var wallet = new Wallet(privKey) + if (wallet.getAddressString() !== json.address) { + throw new Error('Invalid private key or address') + } + return wallet +} +Wallet.fromMyEtherWalletV2 = function (input){ + var json = (typeof input === 'object') ? input : JSON.parse(input); + if (json.privKey.length !== 64) { + throw new Error('Invalid private key length'); + }; + var privKey = new Buffer(json.privKey, 'hex'); + return new Wallet(privKey); +} +Wallet.fromEthSale = function(input, password) { + var json = (typeof input === 'object') ? input : JSON.parse(input) + var encseed = new Buffer(json.encseed, 'hex') + var derivedKey = ethUtil.crypto.pbkdf2Sync(Buffer(password), Buffer(password), 2000, 32, 'sha256').slice(0, 16) + var decipher = ethUtil.crypto.createDecipheriv('aes-128-cbc', derivedKey, encseed.slice(0, 16)) + var seed = Wallet.decipherBuffer(decipher, encseed.slice(16)) + var wallet = new Wallet(ethUtil.sha3(seed)) + if (wallet.getAddress().toString('hex') !== json.ethaddr) { + throw new Error('Decoded key mismatch - possibly wrong passphrase') + } + return wallet +} +Wallet.fromMyEtherWalletKey = function(input, password) { + var cipher = input.slice(0, 128) + cipher = Wallet.decodeCryptojsSalt(cipher) + var evp = Wallet.evp_kdf(new Buffer(password), cipher.salt, { + keysize: 32, + ivsize: 16 + }) + var decipher = ethUtil.crypto.createDecipheriv('aes-256-cbc', evp.key, evp.iv) + var privKey = Wallet.decipherBuffer(decipher, new Buffer(cipher.ciphertext)) + privKey = new Buffer((privKey.toString()), 'hex') + return new Wallet(privKey) +} +Wallet.fromV3 = function(input, password, nonStrict) { + var json = (typeof input === 'object') ? input : JSON.parse(nonStrict ? input.toLowerCase() : input) + if (json.version !== 3) { + throw new Error('Not a V3 wallet') + } + var derivedKey + var kdfparams + if (json.crypto.kdf === 'scrypt') { + kdfparams = json.crypto.kdfparams + derivedKey = ethUtil.scrypt(new Buffer(password), new Buffer(kdfparams.salt, 'hex'), kdfparams.n, kdfparams.r, kdfparams.p, kdfparams.dklen) + } else if (json.crypto.kdf === 'pbkdf2') { + kdfparams = json.crypto.kdfparams + if (kdfparams.prf !== 'hmac-sha256') { + throw new Error('Unsupported parameters to PBKDF2') + } + derivedKey = ethUtil.crypto.pbkdf2Sync(new Buffer(password), new Buffer(kdfparams.salt, 'hex'), kdfparams.c, kdfparams.dklen, 'sha256') + } else { + throw new Error('Unsupported key derivation scheme') + } + var ciphertext = new Buffer(json.crypto.ciphertext, 'hex') + var mac = ethUtil.sha3(Buffer.concat([derivedKey.slice(16, 32), ciphertext])) + if (mac.toString('hex') !== json.crypto.mac) { + throw new Error('Key derivation failed - possibly wrong passphrase') + } + var decipher = ethUtil.crypto.createDecipheriv(json.crypto.cipher, derivedKey.slice(0, 16), new Buffer(json.crypto.cipherparams.iv, 'hex')) + var seed = Wallet.decipherBuffer(decipher, ciphertext, 'hex') + return new Wallet(seed) +} +Wallet.prototype.toV3String = function(password, opts) { + return JSON.stringify(this.toV3(password, opts)) +} +Wallet.prototype.getV3Filename = function (timestamp) { + var ts = timestamp ? new Date(timestamp) : new Date() + return [ + 'UTC--', + ts.toJSON().replace(/:/g, '-'), + '--', + this.getAddress().toString('hex') + ].join('') +} +Wallet.decipherBuffer = function(decipher, data) { + return Buffer.concat([decipher.update(data), decipher.final()]) +} +Wallet.decodeCryptojsSalt = function(input) { + var ciphertext = new Buffer(input, 'base64') + if (ciphertext.slice(0, 8).toString() === 'Salted__') { + return { + salt: ciphertext.slice(8, 16), + ciphertext: ciphertext.slice(16) + } + } else { + return { + ciphertext: ciphertext + } + } +} +Wallet.evp_kdf = function(data, salt, opts) { + // A single EVP iteration, returns `D_i`, where block equlas to `D_(i-1)` + + function iter(block) { + var hash = ethUtil.crypto.createHash(opts.digest || 'md5') + hash.update(block) + hash.update(data) + hash.update(salt) + block = hash.digest() + for (var i = 1; i < (opts.count || 1); i++) { + hash = ethUtil.crypto.createHash(opts.digest || 'md5') + hash.update(block) + block = hash.digest() + } + return block + } + var keysize = opts.keysize || 16 + var ivsize = opts.ivsize || 16 + var ret = [] + var i = 0 + while (Buffer.concat(ret).length < (keysize + ivsize)) { + ret[i] = iter((i === 0) ? new Buffer(0) : ret[i - 1]) + i++ + } + var tmp = Buffer.concat(ret) + return { + key: tmp.slice(0, keysize), + iv: tmp.slice(keysize, keysize + ivsize) + } +} +Wallet.walletRequirePass = function(ethjson) { + var jsonArr; + try { + jsonArr = JSON.parse(ethjson); + } catch (err) { + throw globalFuncs.errorMsgs[3]; + } + if (jsonArr.encseed != null) return true; + else if (jsonArr.Crypto != null || jsonArr.crypto != null) return true + else if (jsonArr.hash != null && jsonArr.locked) return true; + else if (jsonArr.hash != null && !jsonArr.locked) return false; + else if (jsonArr.publisher == "MyEtherWallet" && !jsonArr.encrypted) return false; + else + throw globalFuncs.errorMsgs[2]; +} +Wallet.getWalletFromPrivKeyFile = function(strjson, password) { + var jsonArr = JSON.parse(strjson); + if (jsonArr.encseed != null) return Wallet.fromEthSale(strjson, password); + else if (jsonArr.Crypto != null || jsonArr.crypto != null) return Wallet.fromV3(strjson, password, true); + else if (jsonArr.hash != null) return Wallet.fromMyEtherWallet(strjson, password); + else if (jsonArr.publisher == "MyEtherWallet") return Wallet.fromMyEtherWalletV2(strjson); + else + throw globalFuncs.errorMsgs[2]; +} module.exports = Wallet; }).call(this,require("buffer").Buffer) -},{"buffer":83}],29:[function(require,module,exports){ -'use strict'; -var globalService = function($http, $httpParamSerializerJQLike) { - globalFuncs.checkAndRedirectHTTPS(); - ajaxReq.http = $http; - ajaxReq.postSerializer = $httpParamSerializerJQLike; - - var tabs = { - generateWallet: { - id: 0, - name: "Generate Wallet", - url: "generate-wallet", - mew: true, - cx: false - }, - bulkGenerate: { - id: 1, - name: "Bulk Generate", - url: "bulk-generate", - mew: false, - cx: false - }, - viewWalletInfo: { - id: 2, - name: "View Wallet Info", - url: "view-wallet-info", - mew: true, - cx: false - }, - myWallet: { - id: 3, - name: "My Wallets", - url: "my-wallet", - mew: false, - cx: true - }, - addWallet: { - id: 4, - name: "Add Wallet", - url: "add-wallet", - mew: false, - cx: true - }, - sendTransaction: { - id: 5, - name: "Send Transaction", - url: "send-transaction", - mew: true, - cx: true - }, - offlineTransaction: { - id: 6, - name: "Offline Transaction", - url:"offline-transaction", - mew: true, - cx: false - }, - dao: { - id: 7, - name: "The DAO", - url: "the-dao", - mew: true, - cx: true - }, - daoproposals: { - id: 8, - name: "DAO Proposals", - url: "dao-proposals", - mew: true, - cx: true - }, - digix: { - id: 9, - name: "Digix", - url: "digix", - mew: true, - cx: true - }, - contracts: { - id: 10, - name: "Contracts", - url:"contracts", - mew: false, - cx: false - }, - help: { - id: 11, - name: "Help", - url: "help", - mew: true, - cx: true - } - }; - var currentTab = 0; - if(typeof chrome != 'undefined') - currentTab = chrome.windows === undefined ? 0 : 3; - return { - tabs: tabs, - currentTab: currentTab - }; -}; -module.exports = globalService; - - +},{"buffer":84}],29:[function(require,module,exports){ +'use strict'; +var globalService = function($http, $httpParamSerializerJQLike) { + globalFuncs.checkAndRedirectHTTPS(); + ajaxReq.http = $http; + ajaxReq.postSerializer = $httpParamSerializerJQLike; + + var tabs = { + generateWallet: { + id: 0, + name: "Generate Wallet", + url: "generate-wallet", + mew: true, + cx: false + }, + bulkGenerate: { + id: 1, + name: "Bulk Generate", + url: "bulk-generate", + mew: false, + cx: false + }, + viewWalletInfo: { + id: 2, + name: "View Wallet Info", + url: "view-wallet-info", + mew: true, + cx: false + }, + myWallet: { + id: 3, + name: "My Wallets", + url: "my-wallet", + mew: false, + cx: true + }, + addWallet: { + id: 4, + name: "Add Wallet", + url: "add-wallet", + mew: false, + cx: true + }, + sendTransaction: { + id: 5, + name: "Send Transaction", + url: "send-transaction", + mew: true, + cx: true + }, + offlineTransaction: { + id: 6, + name: "Offline Transaction", + url:"offline-transaction", + mew: true, + cx: false + }, + dao: { + id: 7, + name: "The DAO", + url: "the-dao", + mew: true, + cx: true + }, + daoproposals: { + id: 8, + name: "DAO Proposals", + url: "dao-proposals", + mew: true, + cx: true + }, + digix: { + id: 9, + name: "Digix", + url: "digix", + mew: true, + cx: true + }, + contracts: { + id: 10, + name: "Contracts", + url:"contracts", + mew: false, + cx: false + }, + help: { + id: 11, + name: "Help", + url: "help", + mew: true, + cx: true + } + }; + var currentTab = 0; + if(typeof chrome != 'undefined') + currentTab = chrome.windows === undefined ? 0 : 3; + return { + tabs: tabs, + currentTab: currentTab + }; +}; +module.exports = globalService; + + },{}],30:[function(require,module,exports){ -'use strict'; -var walletService = function() { - return { - wallet: null, - password:'' - } -}; +'use strict'; +var walletService = function() { + return { + wallet: null, + password:'' + } +}; module.exports = walletService; },{}],31:[function(require,module,exports){ (function (Buffer){ -'use strict'; -var uiFuncs = function() {} -uiFuncs.generateTx = function($scope, $sce, callback) { - try { - if (!ethFuncs.validateEtherAddress($scope.tx.to)) throw globalFuncs.errorMsgs[5]; - else if (!globalFuncs.isNumeric($scope.tx.value) || parseFloat($scope.tx.value) < 0) throw globalFuncs.errorMsgs[7]; - else if (!globalFuncs.isNumeric($scope.tx.gasLimit) || parseFloat($scope.tx.gasLimit) <= 0) throw globalFuncs.errorMsgs[8]; - else if (!ethFuncs.validateHexString($scope.tx.data)) throw globalFuncs.errorMsgs[9]; - ajaxReq.getTransactionData($scope.wallet.getAddressString(), function(data) { - if (data.error) throw data.msg; - data = data.data; - var rawTx = { - nonce: ethFuncs.sanitizeHex(data.nonce), - gasPrice: ethFuncs.sanitizeHex(ethFuncs.addTinyMoreToGas(data.gasprice)), - gasLimit: ethFuncs.sanitizeHex(ethFuncs.decimalToHex($scope.tx.gasLimit)), - to: ethFuncs.sanitizeHex($scope.tx.to), - value: ethFuncs.sanitizeHex(ethFuncs.decimalToHex(etherUnits.toWei($scope.tx.value, $scope.tx.unit))), - data: ethFuncs.sanitizeHex($scope.tx.data) - } - var eTx = new ethUtil.Tx(rawTx); - eTx.sign(new Buffer($scope.wallet.getPrivateKeyString(), 'hex')); - $scope.rawTx = JSON.stringify(rawTx); - $scope.signedTx = '0x' + eTx.serialize().toString('hex'); - $scope.showRaw = true; - if($scope.autoSend){ - uiFuncs.sendTx($scope, $sce); - $scope.autoSend = false; - } - if(callback !== undefined) callback(); - }); - $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText('')); - } catch (e) { - $scope.showRaw = false; - $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } -} -uiFuncs.sendTx = function($scope, $sce) { - if(document.getElementById('sendTransaction')!=null) - new Modal(document.getElementById('sendTransaction')).close(); - ajaxReq.sendRawTx($scope.signedTx, function(data) { - if (data.error) { - $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(data.msg)); - } else { - if( $scope.setBalance !== undefined ) $scope.setBalance(); - $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[2] + " " + data.data)); - } - }); -} -uiFuncs.transferAllBalance = function($scope, $sce) { - try { - ajaxReq.getTransactionData($scope.wallet.getAddressString(), function(data) { - if (data.error) throw data.msg; - data = data.data; - var gasPrice = new BigNumber(ethFuncs.sanitizeHex(ethFuncs.addTinyMoreToGas(data.gasprice))).times($scope.tx.gasLimit); - var maxVal = new BigNumber(data.balance).minus(gasPrice); - $scope.tx.unit = "ether"; - $scope.tx.value = etherUnits.toEther(maxVal, 'wei'); - $scope.tx.value = $scope.tx.value < 0 ? 0 : $scope.tx.value; - }); - } catch (e) { - $scope.showRaw = false; - $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } -} +'use strict'; +var uiFuncs = function() {} +uiFuncs.generateTx = function($scope, $sce, callback) { + try { + if (!ethFuncs.validateEtherAddress($scope.tx.to)) throw globalFuncs.errorMsgs[5]; + else if (!globalFuncs.isNumeric($scope.tx.value) || parseFloat($scope.tx.value) < 0) throw globalFuncs.errorMsgs[7]; + else if (!globalFuncs.isNumeric($scope.tx.gasLimit) || parseFloat($scope.tx.gasLimit) <= 0) throw globalFuncs.errorMsgs[8]; + else if (!ethFuncs.validateHexString($scope.tx.data)) throw globalFuncs.errorMsgs[9]; + ajaxReq.getTransactionData($scope.wallet.getAddressString(), function(data) { + if (data.error) throw data.msg; + data = data.data; + var rawTx = { + nonce: ethFuncs.sanitizeHex(data.nonce), + gasPrice: ethFuncs.sanitizeHex(ethFuncs.addTinyMoreToGas(data.gasprice)), + gasLimit: ethFuncs.sanitizeHex(ethFuncs.decimalToHex($scope.tx.gasLimit)), + to: ethFuncs.sanitizeHex($scope.tx.to), + value: ethFuncs.sanitizeHex(ethFuncs.decimalToHex(etherUnits.toWei($scope.tx.value, $scope.tx.unit))), + data: ethFuncs.sanitizeHex($scope.tx.data) + } + var eTx = new ethUtil.Tx(rawTx); + eTx.sign(new Buffer($scope.wallet.getPrivateKeyString(), 'hex')); + $scope.rawTx = JSON.stringify(rawTx); + $scope.signedTx = '0x' + eTx.serialize().toString('hex'); + $scope.showRaw = true; + if($scope.autoSend){ + uiFuncs.sendTx($scope, $sce); + $scope.autoSend = false; + } + if(callback !== undefined) callback(); + }); + $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText('')); + } catch (e) { + $scope.showRaw = false; + $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } +} +uiFuncs.sendTx = function($scope, $sce) { + if(document.getElementById('sendTransaction')!=null) + new Modal(document.getElementById('sendTransaction')).close(); + ajaxReq.sendRawTx($scope.signedTx, function(data) { + if (data.error) { + $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(data.msg)); + } else { + if( $scope.setBalance !== undefined ) $scope.setBalance(); + $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[2] + " " + data.data)); + } + }); +} +uiFuncs.transferAllBalance = function($scope, $sce) { + try { + ajaxReq.getTransactionData($scope.wallet.getAddressString(), function(data) { + if (data.error) throw data.msg; + data = data.data; + var gasPrice = new BigNumber(ethFuncs.sanitizeHex(ethFuncs.addTinyMoreToGas(data.gasprice))).times($scope.tx.gasLimit); + var maxVal = new BigNumber(data.balance).minus(gasPrice); + $scope.tx.unit = "ether"; + $scope.tx.value = etherUnits.toEther(maxVal, 'wei'); + $scope.tx.value = $scope.tx.value < 0 ? 0 : $scope.tx.value; + }); + } catch (e) { + $scope.showRaw = false; + $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } +} module.exports = uiFuncs; }).call(this,require("buffer").Buffer) -},{"buffer":83}],32:[function(require,module,exports){ +},{"buffer":84}],32:[function(require,module,exports){ /** * @license AngularJS v1.5.6 * (c) 2010-2016 Google, Inc. http://angularjs.org @@ -33565,7 +33507,7 @@ asn1.constants = require('./asn1/constants'); asn1.decoders = require('./asn1/decoders'); asn1.encoders = require('./asn1/encoders'); -},{"./asn1/api":35,"./asn1/base":37,"./asn1/constants":41,"./asn1/decoders":43,"./asn1/encoders":46,"bn.js":53}],35:[function(require,module,exports){ +},{"./asn1/api":35,"./asn1/base":37,"./asn1/constants":41,"./asn1/decoders":43,"./asn1/encoders":46,"bn.js":54}],35:[function(require,module,exports){ var asn1 = require('../asn1'); var inherits = require('inherits'); @@ -33628,7 +33570,7 @@ Entity.prototype.encode = function encode(data, enc, /* internal */ reporter) { return this._getEncoder(enc).encode(data, reporter); }; -},{"../asn1":34,"inherits":428,"vm":484}],36:[function(require,module,exports){ +},{"../asn1":34,"inherits":429,"vm":484}],36:[function(require,module,exports){ var inherits = require('inherits'); var Reporter = require('../base').Reporter; var Buffer = require('buffer').Buffer; @@ -33746,7 +33688,7 @@ EncoderBuffer.prototype.join = function join(out, offset) { return out; }; -},{"../base":37,"buffer":83,"inherits":428}],37:[function(require,module,exports){ +},{"../base":37,"buffer":84,"inherits":429}],37:[function(require,module,exports){ var base = exports; base.Reporter = require('./reporter').Reporter; @@ -34371,7 +34313,7 @@ Node.prototype._isPrintstr = function isPrintstr(str) { return /^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(str); }; -},{"../base":37,"minimalistic-assert":435}],39:[function(require,module,exports){ +},{"../base":37,"minimalistic-assert":436}],39:[function(require,module,exports){ var inherits = require('inherits'); function Reporter(options) { @@ -34475,7 +34417,7 @@ ReporterError.prototype.rethrow = function rethrow(msg) { return this; }; -},{"inherits":428}],40:[function(require,module,exports){ +},{"inherits":429}],40:[function(require,module,exports){ var constants = require('../constants'); exports.tagClass = { @@ -34863,7 +34805,7 @@ function derDecodeLen(buf, primitive, fail) { return len; } -},{"../../asn1":34,"inherits":428}],43:[function(require,module,exports){ +},{"../../asn1":34,"inherits":429}],43:[function(require,module,exports){ var decoders = exports; decoders.der = require('./der'); @@ -34920,7 +34862,7 @@ PEMDecoder.prototype.decode = function decode(data, options) { return DERDecoder.prototype.decode.call(this, input, options); }; -},{"./der":42,"buffer":83,"inherits":428}],45:[function(require,module,exports){ +},{"./der":42,"buffer":84,"inherits":429}],45:[function(require,module,exports){ var inherits = require('inherits'); var Buffer = require('buffer').Buffer; @@ -35215,7 +35157,7 @@ function encodeTag(tag, primitive, cls, reporter) { return res; } -},{"../../asn1":34,"buffer":83,"inherits":428}],46:[function(require,module,exports){ +},{"../../asn1":34,"buffer":84,"inherits":429}],46:[function(require,module,exports){ var encoders = exports; encoders.der = require('./der'); @@ -35244,7 +35186,7 @@ PEMEncoder.prototype.encode = function encode(data, options) { return out.join('\n'); }; -},{"./der":45,"inherits":428}],48:[function(require,module,exports){ +},{"./der":45,"inherits":429}],48:[function(require,module,exports){ // http://wiki.commonjs.org/wiki/Unit_Testing/1.0 // // THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8! @@ -35607,13 +35549,13 @@ var objectKeys = Object.keys || function (obj) { },{"util/":481}],49:[function(require,module,exports){ (function (global){ -"use strict"; +/*istanbul ignore next*/"use strict"; -require("core-js/shim"); +/*istanbul ignore next*/require("core-js/shim"); -require("regenerator-runtime/runtime"); +/*istanbul ignore next*/require("babel-regenerator-runtime"); -require("core-js/fn/regexp/escape"); +/*istanbul ignore next*/require("core-js/fn/regexp/escape"); /* eslint max-len: 0 */ @@ -35640,7 +35582,668 @@ define(String.prototype, "padRight", "".padEnd); [][key] && define(Array, key, Function.call.bind([][key])); }); }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"core-js/fn/regexp/escape":85,"core-js/shim":379,"regenerator-runtime/runtime":460}],50:[function(require,module,exports){ +},{"babel-regenerator-runtime":50,"core-js/fn/regexp/escape":86,"core-js/shim":380}],50:[function(require,module,exports){ +(function (process,global){ +/** + * Copyright (c) 2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * https://raw.github.com/facebook/regenerator/master/LICENSE file. An + * additional grant of patent rights can be found in the PATENTS file in + * the same directory. + */ + +!(function(global) { + "use strict"; + + var hasOwn = Object.prototype.hasOwnProperty; + var undefined; // More compressible than void 0. + var iteratorSymbol = + typeof Symbol === "function" && Symbol.iterator || "@@iterator"; + + var inModule = typeof module === "object"; + var runtime = global.regeneratorRuntime; + if (runtime) { + if (inModule) { + // If regeneratorRuntime is defined globally and we're in a module, + // make the exports object identical to regeneratorRuntime. + module.exports = runtime; + } + // Don't bother evaluating the rest of this file if the runtime was + // already defined globally. + return; + } + + // Define the runtime globally (as expected by generated code) as either + // module.exports (if we're in a module) or a new, empty object. + runtime = global.regeneratorRuntime = inModule ? module.exports : {}; + + function wrap(innerFn, outerFn, self, tryLocsList) { + // If outerFn provided, then outerFn.prototype instanceof Generator. + var generator = Object.create((outerFn || Generator).prototype); + var context = new Context(tryLocsList || []); + + // The ._invoke method unifies the implementations of the .next, + // .throw, and .return methods. + generator._invoke = makeInvokeMethod(innerFn, self, context); + + return generator; + } + runtime.wrap = wrap; + + // Try/catch helper to minimize deoptimizations. Returns a completion + // record like context.tryEntries[i].completion. This interface could + // have been (and was previously) designed to take a closure to be + // invoked without arguments, but in all the cases we care about we + // already have an existing method we want to call, so there's no need + // to create a new function object. We can even get away with assuming + // the method takes exactly one argument, since that happens to be true + // in every case, so we don't have to touch the arguments object. The + // only additional allocation required is the completion record, which + // has a stable shape and so hopefully should be cheap to allocate. + function tryCatch(fn, obj, arg) { + try { + return { type: "normal", arg: fn.call(obj, arg) }; + } catch (err) { + return { type: "throw", arg: err }; + } + } + + var GenStateSuspendedStart = "suspendedStart"; + var GenStateSuspendedYield = "suspendedYield"; + var GenStateExecuting = "executing"; + var GenStateCompleted = "completed"; + + // Returning this object from the innerFn has the same effect as + // breaking out of the dispatch switch statement. + var ContinueSentinel = {}; + + // Dummy constructor functions that we use as the .constructor and + // .constructor.prototype properties for functions that return Generator + // objects. For full spec compliance, you may wish to configure your + // minifier not to mangle the names of these two functions. + function Generator() {} + function GeneratorFunction() {} + function GeneratorFunctionPrototype() {} + + var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype; + GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; + GeneratorFunctionPrototype.constructor = GeneratorFunction; + GeneratorFunction.displayName = "GeneratorFunction"; + + // Helper for defining the .next, .throw, and .return methods of the + // Iterator interface in terms of a single ._invoke method. + function defineIteratorMethods(prototype) { + ["next", "throw", "return"].forEach(function(method) { + prototype[method] = function(arg) { + return this._invoke(method, arg); + }; + }); + } + + runtime.isGeneratorFunction = function(genFun) { + var ctor = typeof genFun === "function" && genFun.constructor; + return ctor + ? ctor === GeneratorFunction || + // For the native GeneratorFunction constructor, the best we can + // do is to check its .name property. + (ctor.displayName || ctor.name) === "GeneratorFunction" + : false; + }; + + runtime.mark = function(genFun) { + if (Object.setPrototypeOf) { + Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); + } else { + genFun.__proto__ = GeneratorFunctionPrototype; + } + genFun.prototype = Object.create(Gp); + return genFun; + }; + + // Within the body of any async function, `await x` is transformed to + // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test + // `value instanceof AwaitArgument` to determine if the yielded value is + // meant to be awaited. Some may consider the name of this method too + // cutesy, but they are curmudgeons. + runtime.awrap = function(arg) { + return new AwaitArgument(arg); + }; + + function AwaitArgument(arg) { + this.arg = arg; + } + + function AsyncIterator(generator) { + // This invoke function is written in a style that assumes some + // calling function (or Promise) will handle exceptions. + function invoke(method, arg) { + var result = generator[method](arg); + var value = result.value; + return value instanceof AwaitArgument + ? Promise.resolve(value.arg).then(invokeNext, invokeThrow) + : Promise.resolve(value).then(function(unwrapped) { + // When a yielded Promise is resolved, its final value becomes + // the .value of the Promise<{value,done}> result for the + // current iteration. If the Promise is rejected, however, the + // result for this iteration will be rejected with the same + // reason. Note that rejections of yielded Promises are not + // thrown back into the generator function, as is the case + // when an awaited Promise is rejected. This difference in + // behavior between yield and await is important, because it + // allows the consumer to decide what to do with the yielded + // rejection (swallow it and continue, manually .throw it back + // into the generator, abandon iteration, whatever). With + // await, by contrast, there is no opportunity to examine the + // rejection reason outside the generator function, so the + // only option is to throw it from the await expression, and + // let the generator function handle the exception. + result.value = unwrapped; + return result; + }); + } + + if (typeof process === "object" && process.domain) { + invoke = process.domain.bind(invoke); + } + + var invokeNext = invoke.bind(generator, "next"); + var invokeThrow = invoke.bind(generator, "throw"); + var invokeReturn = invoke.bind(generator, "return"); + var previousPromise; + + function enqueue(method, arg) { + function callInvokeWithMethodAndArg() { + return invoke(method, arg); + } + + return previousPromise = + // If enqueue has been called before, then we want to wait until + // all previous Promises have been resolved before calling invoke, + // so that results are always delivered in the correct order. If + // enqueue has not been called before, then it is important to + // call invoke immediately, without waiting on a callback to fire, + // so that the async generator function has the opportunity to do + // any necessary setup in a predictable way. This predictability + // is why the Promise constructor synchronously invokes its + // executor callback, and why async functions synchronously + // execute code before the first await. Since we implement simple + // async functions in terms of async generators, it is especially + // important to get this right, even though it requires care. + previousPromise ? previousPromise.then( + callInvokeWithMethodAndArg, + // Avoid propagating failures to Promises returned by later + // invocations of the iterator. + callInvokeWithMethodAndArg + ) : new Promise(function (resolve) { + resolve(callInvokeWithMethodAndArg()); + }); + } + + // Define the unified helper method that is used to implement .next, + // .throw, and .return (see defineIteratorMethods). + this._invoke = enqueue; + } + + defineIteratorMethods(AsyncIterator.prototype); + + // Note that simple async functions are implemented on top of + // AsyncIterator objects; they just return a Promise for the value of + // the final result produced by the iterator. + runtime.async = function(innerFn, outerFn, self, tryLocsList) { + var iter = new AsyncIterator( + wrap(innerFn, outerFn, self, tryLocsList) + ); + + return runtime.isGeneratorFunction(outerFn) + ? iter // If outerFn is a generator, return the full iterator. + : iter.next().then(function(result) { + return result.done ? result.value : iter.next(); + }); + }; + + function makeInvokeMethod(innerFn, self, context) { + var state = GenStateSuspendedStart; + + return function invoke(method, arg) { + if (state === GenStateExecuting) { + throw new Error("Generator is already running"); + } + + if (state === GenStateCompleted) { + if (method === "throw") { + throw arg; + } + + // Be forgiving, per 25.3.3.3.3 of the spec: + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume + return doneResult(); + } + + while (true) { + var delegate = context.delegate; + if (delegate) { + if (method === "return" || + (method === "throw" && delegate.iterator[method] === undefined)) { + // A return or throw (when the delegate iterator has no throw + // method) always terminates the yield* loop. + context.delegate = null; + + // If the delegate iterator has a return method, give it a + // chance to clean up. + var returnMethod = delegate.iterator["return"]; + if (returnMethod) { + var record = tryCatch(returnMethod, delegate.iterator, arg); + if (record.type === "throw") { + // If the return method threw an exception, let that + // exception prevail over the original return or throw. + method = "throw"; + arg = record.arg; + continue; + } + } + + if (method === "return") { + // Continue with the outer return, now that the delegate + // iterator has been terminated. + continue; + } + } + + var record = tryCatch( + delegate.iterator[method], + delegate.iterator, + arg + ); + + if (record.type === "throw") { + context.delegate = null; + + // Like returning generator.throw(uncaught), but without the + // overhead of an extra function call. + method = "throw"; + arg = record.arg; + continue; + } + + // Delegate generator ran and handled its own exceptions so + // regardless of what the method was, we continue as if it is + // "next" with an undefined arg. + method = "next"; + arg = undefined; + + var info = record.arg; + if (info.done) { + context[delegate.resultName] = info.value; + context.next = delegate.nextLoc; + } else { + state = GenStateSuspendedYield; + return info; + } + + context.delegate = null; + } + + if (method === "next") { + context._sent = arg; + + if (state === GenStateSuspendedYield) { + context.sent = arg; + } else { + context.sent = undefined; + } + } else if (method === "throw") { + if (state === GenStateSuspendedStart) { + state = GenStateCompleted; + throw arg; + } + + if (context.dispatchException(arg)) { + // If the dispatched exception was caught by a catch block, + // then let that catch block handle the exception normally. + method = "next"; + arg = undefined; + } + + } else if (method === "return") { + context.abrupt("return", arg); + } + + state = GenStateExecuting; + + var record = tryCatch(innerFn, self, context); + if (record.type === "normal") { + // If an exception is thrown from innerFn, we leave state === + // GenStateExecuting and loop back for another invocation. + state = context.done + ? GenStateCompleted + : GenStateSuspendedYield; + + var info = { + value: record.arg, + done: context.done + }; + + if (record.arg === ContinueSentinel) { + if (context.delegate && method === "next") { + // Deliberately forget the last sent value so that we don't + // accidentally pass it on to the delegate. + arg = undefined; + } + } else { + return info; + } + + } else if (record.type === "throw") { + state = GenStateCompleted; + // Dispatch the exception by looping back around to the + // context.dispatchException(arg) call above. + method = "throw"; + arg = record.arg; + } + } + }; + } + + // Define Generator.prototype.{next,throw,return} in terms of the + // unified ._invoke helper method. + defineIteratorMethods(Gp); + + Gp[iteratorSymbol] = function() { + return this; + }; + + Gp.toString = function() { + return "[object Generator]"; + }; + + function pushTryEntry(locs) { + var entry = { tryLoc: locs[0] }; + + if (1 in locs) { + entry.catchLoc = locs[1]; + } + + if (2 in locs) { + entry.finallyLoc = locs[2]; + entry.afterLoc = locs[3]; + } + + this.tryEntries.push(entry); + } + + function resetTryEntry(entry) { + var record = entry.completion || {}; + record.type = "normal"; + delete record.arg; + entry.completion = record; + } + + function Context(tryLocsList) { + // The root entry object (effectively a try statement without a catch + // or a finally block) gives us a place to store values thrown from + // locations where there is no enclosing try statement. + this.tryEntries = [{ tryLoc: "root" }]; + tryLocsList.forEach(pushTryEntry, this); + this.reset(true); + } + + runtime.keys = function(object) { + var keys = []; + for (var key in object) { + keys.push(key); + } + keys.reverse(); + + // Rather than returning an object with a next method, we keep + // things simple and return the next function itself. + return function next() { + while (keys.length) { + var key = keys.pop(); + if (key in object) { + next.value = key; + next.done = false; + return next; + } + } + + // To avoid creating an additional object, we just hang the .value + // and .done properties off the next function object itself. This + // also ensures that the minifier will not anonymize the function. + next.done = true; + return next; + }; + }; + + function values(iterable) { + if (iterable) { + var iteratorMethod = iterable[iteratorSymbol]; + if (iteratorMethod) { + return iteratorMethod.call(iterable); + } + + if (typeof iterable.next === "function") { + return iterable; + } + + if (!isNaN(iterable.length)) { + var i = -1, next = function next() { + while (++i < iterable.length) { + if (hasOwn.call(iterable, i)) { + next.value = iterable[i]; + next.done = false; + return next; + } + } + + next.value = undefined; + next.done = true; + + return next; + }; + + return next.next = next; + } + } + + // Return an iterator with no values. + return { next: doneResult }; + } + runtime.values = values; + + function doneResult() { + return { value: undefined, done: true }; + } + + Context.prototype = { + constructor: Context, + + reset: function(skipTempReset) { + this.prev = 0; + this.next = 0; + this.sent = undefined; + this.done = false; + this.delegate = null; + + this.tryEntries.forEach(resetTryEntry); + + if (!skipTempReset) { + for (var name in this) { + // Not sure about the optimal order of these conditions: + if (name.charAt(0) === "t" && + hasOwn.call(this, name) && + !isNaN(+name.slice(1))) { + this[name] = undefined; + } + } + } + }, + + stop: function() { + this.done = true; + + var rootEntry = this.tryEntries[0]; + var rootRecord = rootEntry.completion; + if (rootRecord.type === "throw") { + throw rootRecord.arg; + } + + return this.rval; + }, + + dispatchException: function(exception) { + if (this.done) { + throw exception; + } + + var context = this; + function handle(loc, caught) { + record.type = "throw"; + record.arg = exception; + context.next = loc; + return !!caught; + } + + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + var record = entry.completion; + + if (entry.tryLoc === "root") { + // Exception thrown outside of any try block that could handle + // it, so set the completion value of the entire function to + // throw the exception. + return handle("end"); + } + + if (entry.tryLoc <= this.prev) { + var hasCatch = hasOwn.call(entry, "catchLoc"); + var hasFinally = hasOwn.call(entry, "finallyLoc"); + + if (hasCatch && hasFinally) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } else if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + + } else if (hasCatch) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } + + } else if (hasFinally) { + if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + + } else { + throw new Error("try statement without catch or finally"); + } + } + } + }, + + abrupt: function(type, arg) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc <= this.prev && + hasOwn.call(entry, "finallyLoc") && + this.prev < entry.finallyLoc) { + var finallyEntry = entry; + break; + } + } + + if (finallyEntry && + (type === "break" || + type === "continue") && + finallyEntry.tryLoc <= arg && + arg <= finallyEntry.finallyLoc) { + // Ignore the finally entry if control is not jumping to a + // location outside the try/catch block. + finallyEntry = null; + } + + var record = finallyEntry ? finallyEntry.completion : {}; + record.type = type; + record.arg = arg; + + if (finallyEntry) { + this.next = finallyEntry.finallyLoc; + } else { + this.complete(record); + } + + return ContinueSentinel; + }, + + complete: function(record, afterLoc) { + if (record.type === "throw") { + throw record.arg; + } + + if (record.type === "break" || + record.type === "continue") { + this.next = record.arg; + } else if (record.type === "return") { + this.rval = record.arg; + this.next = "end"; + } else if (record.type === "normal" && afterLoc) { + this.next = afterLoc; + } + }, + + finish: function(finallyLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.finallyLoc === finallyLoc) { + this.complete(entry.completion, entry.afterLoc); + resetTryEntry(entry); + return ContinueSentinel; + } + } + }, + + "catch": function(tryLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc === tryLoc) { + var record = entry.completion; + if (record.type === "throw") { + var thrown = record.arg; + resetTryEntry(entry); + } + return thrown; + } + } + + // The context.catch method must only be called with a location + // argument that corresponds to a known catch block. + throw new Error("illegal catch attempt"); + }, + + delegateYield: function(iterable, resultName, nextLoc) { + this.delegate = { + iterator: values(iterable), + resultName: resultName, + nextLoc: nextLoc + }; + + return ContinueSentinel; + } + }; +})( + // Among the various tricks for obtaining a reference to the global + // object, this seems to be the most reliable technique that does not + // use indirect eval (which violates Content Security Policy). + typeof global === "object" ? global : + typeof window === "object" ? window : + typeof self === "object" ? self : this +); + +}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"_process":443}],51:[function(require,module,exports){ 'use strict' exports.toByteArray = toByteArray @@ -35751,7 +36354,7 @@ function fromByteArray (uint8) { return parts.join('') } -},{}],51:[function(require,module,exports){ +},{}],52:[function(require,module,exports){ /*! bignumber.js v2.3.0 https://github.com/MikeMcl/bignumber.js/LICENCE */ ;(function (globalObj) { @@ -38486,7 +39089,7 @@ function fromByteArray (uint8) { } })(this); -},{}],52:[function(require,module,exports){ +},{}],53:[function(require,module,exports){ (function (Buffer){ // Reference https://github.com/bitcoin/bips/blob/master/bip-0066.mediawiki // Format: 0x30 [total-length] 0x02 [R-length] [R] 0x02 [S-length] [S] @@ -38601,7 +39204,7 @@ module.exports = { } }).call(this,require("buffer").Buffer) -},{"buffer":83}],53:[function(require,module,exports){ +},{"buffer":84}],54:[function(require,module,exports){ (function (module, exports) { 'use strict'; @@ -42022,7 +42625,7 @@ module.exports = { }; })(typeof module === 'undefined' || module, this); -},{}],54:[function(require,module,exports){ +},{}],55:[function(require,module,exports){ var r; module.exports = function rand(len) { @@ -42081,9 +42684,9 @@ if (typeof window === 'object') { } } -},{}],55:[function(require,module,exports){ - },{}],56:[function(require,module,exports){ + +},{}],57:[function(require,module,exports){ (function (Buffer){ // based on the aes implimentation in triple sec // https://github.com/keybase/triplesec @@ -42264,7 +42867,7 @@ AES.prototype._doCryptBlock = function (M, keySchedule, SUB_MIX, SBOX) { exports.AES = AES }).call(this,require("buffer").Buffer) -},{"buffer":83}],57:[function(require,module,exports){ +},{"buffer":84}],58:[function(require,module,exports){ (function (Buffer){ var aes = require('./aes') var Transform = require('cipher-base') @@ -42365,7 +42968,7 @@ function xorTest (a, b) { } }).call(this,require("buffer").Buffer) -},{"./aes":56,"./ghash":61,"buffer":83,"buffer-xor":82,"cipher-base":84,"inherits":428}],58:[function(require,module,exports){ +},{"./aes":57,"./ghash":62,"buffer":84,"buffer-xor":83,"cipher-base":85,"inherits":429}],59:[function(require,module,exports){ var ciphers = require('./encrypter') exports.createCipher = exports.Cipher = ciphers.createCipher exports.createCipheriv = exports.Cipheriv = ciphers.createCipheriv @@ -42378,7 +42981,7 @@ function getCiphers () { } exports.listCiphers = exports.getCiphers = getCiphers -},{"./decrypter":59,"./encrypter":60,"./modes":62}],59:[function(require,module,exports){ +},{"./decrypter":60,"./encrypter":61,"./modes":63}],60:[function(require,module,exports){ (function (Buffer){ var aes = require('./aes') var Transform = require('cipher-base') @@ -42519,7 +43122,7 @@ exports.createDecipher = createDecipher exports.createDecipheriv = createDecipheriv }).call(this,require("buffer").Buffer) -},{"./aes":56,"./authCipher":57,"./modes":62,"./modes/cbc":63,"./modes/cfb":64,"./modes/cfb1":65,"./modes/cfb8":66,"./modes/ctr":67,"./modes/ecb":68,"./modes/ofb":69,"./streamCipher":70,"buffer":83,"cipher-base":84,"evp_bytestokey":419,"inherits":428}],60:[function(require,module,exports){ +},{"./aes":57,"./authCipher":58,"./modes":63,"./modes/cbc":64,"./modes/cfb":65,"./modes/cfb1":66,"./modes/cfb8":67,"./modes/ctr":68,"./modes/ecb":69,"./modes/ofb":70,"./streamCipher":71,"buffer":84,"cipher-base":85,"evp_bytestokey":420,"inherits":429}],61:[function(require,module,exports){ (function (Buffer){ var aes = require('./aes') var Transform = require('cipher-base') @@ -42645,7 +43248,7 @@ exports.createCipheriv = createCipheriv exports.createCipher = createCipher }).call(this,require("buffer").Buffer) -},{"./aes":56,"./authCipher":57,"./modes":62,"./modes/cbc":63,"./modes/cfb":64,"./modes/cfb1":65,"./modes/cfb8":66,"./modes/ctr":67,"./modes/ecb":68,"./modes/ofb":69,"./streamCipher":70,"buffer":83,"cipher-base":84,"evp_bytestokey":419,"inherits":428}],61:[function(require,module,exports){ +},{"./aes":57,"./authCipher":58,"./modes":63,"./modes/cbc":64,"./modes/cfb":65,"./modes/cfb1":66,"./modes/cfb8":67,"./modes/ctr":68,"./modes/ecb":69,"./modes/ofb":70,"./streamCipher":71,"buffer":84,"cipher-base":85,"evp_bytestokey":420,"inherits":429}],62:[function(require,module,exports){ (function (Buffer){ var zeros = new Buffer(16) zeros.fill(0) @@ -42747,7 +43350,7 @@ function xor (a, b) { } }).call(this,require("buffer").Buffer) -},{"buffer":83}],62:[function(require,module,exports){ +},{"buffer":84}],63:[function(require,module,exports){ exports['aes-128-ecb'] = { cipher: 'AES', key: 128, @@ -42920,7 +43523,7 @@ exports['aes-256-gcm'] = { type: 'auth' } -},{}],63:[function(require,module,exports){ +},{}],64:[function(require,module,exports){ var xor = require('buffer-xor') exports.encrypt = function (self, block) { @@ -42939,7 +43542,7 @@ exports.decrypt = function (self, block) { return xor(out, pad) } -},{"buffer-xor":82}],64:[function(require,module,exports){ +},{"buffer-xor":83}],65:[function(require,module,exports){ (function (Buffer){ var xor = require('buffer-xor') @@ -42974,7 +43577,7 @@ function encryptStart (self, data, decrypt) { } }).call(this,require("buffer").Buffer) -},{"buffer":83,"buffer-xor":82}],65:[function(require,module,exports){ +},{"buffer":84,"buffer-xor":83}],66:[function(require,module,exports){ (function (Buffer){ function encryptByte (self, byteParam, decrypt) { var pad @@ -43012,7 +43615,7 @@ function shiftIn (buffer, value) { } }).call(this,require("buffer").Buffer) -},{"buffer":83}],66:[function(require,module,exports){ +},{"buffer":84}],67:[function(require,module,exports){ (function (Buffer){ function encryptByte (self, byteParam, decrypt) { var pad = self._cipher.encryptBlock(self._prev) @@ -43031,7 +43634,7 @@ exports.encrypt = function (self, chunk, decrypt) { } }).call(this,require("buffer").Buffer) -},{"buffer":83}],67:[function(require,module,exports){ +},{"buffer":84}],68:[function(require,module,exports){ (function (Buffer){ var xor = require('buffer-xor') @@ -43066,7 +43669,7 @@ exports.encrypt = function (self, chunk) { } }).call(this,require("buffer").Buffer) -},{"buffer":83,"buffer-xor":82}],68:[function(require,module,exports){ +},{"buffer":84,"buffer-xor":83}],69:[function(require,module,exports){ exports.encrypt = function (self, block) { return self._cipher.encryptBlock(block) } @@ -43074,7 +43677,7 @@ exports.decrypt = function (self, block) { return self._cipher.decryptBlock(block) } -},{}],69:[function(require,module,exports){ +},{}],70:[function(require,module,exports){ (function (Buffer){ var xor = require('buffer-xor') @@ -43094,7 +43697,7 @@ exports.encrypt = function (self, chunk) { } }).call(this,require("buffer").Buffer) -},{"buffer":83,"buffer-xor":82}],70:[function(require,module,exports){ +},{"buffer":84,"buffer-xor":83}],71:[function(require,module,exports){ (function (Buffer){ var aes = require('./aes') var Transform = require('cipher-base') @@ -43123,7 +43726,7 @@ StreamCipher.prototype._final = function () { } }).call(this,require("buffer").Buffer) -},{"./aes":56,"buffer":83,"cipher-base":84,"inherits":428}],71:[function(require,module,exports){ +},{"./aes":57,"buffer":84,"cipher-base":85,"inherits":429}],72:[function(require,module,exports){ var ebtk = require('evp_bytestokey') var aes = require('browserify-aes/browser') var DES = require('browserify-des') @@ -43198,7 +43801,7 @@ function getCiphers () { } exports.listCiphers = exports.getCiphers = getCiphers -},{"browserify-aes/browser":58,"browserify-aes/modes":62,"browserify-des":72,"browserify-des/modes":73,"evp_bytestokey":419}],72:[function(require,module,exports){ +},{"browserify-aes/browser":59,"browserify-aes/modes":63,"browserify-des":73,"browserify-des/modes":74,"evp_bytestokey":420}],73:[function(require,module,exports){ (function (Buffer){ var CipherBase = require('cipher-base') var des = require('des.js') @@ -43245,7 +43848,7 @@ DES.prototype._final = function () { } }).call(this,require("buffer").Buffer) -},{"buffer":83,"cipher-base":84,"des.js":387,"inherits":428}],73:[function(require,module,exports){ +},{"buffer":84,"cipher-base":85,"des.js":388,"inherits":429}],74:[function(require,module,exports){ exports['des-ecb'] = { key: 8, iv: 0 @@ -43271,7 +43874,7 @@ exports['des-ede'] = { iv: 0 } -},{}],74:[function(require,module,exports){ +},{}],75:[function(require,module,exports){ (function (Buffer){ var bn = require('bn.js'); var randomBytes = require('randombytes'); @@ -43315,7 +43918,7 @@ function getr(priv) { } }).call(this,require("buffer").Buffer) -},{"bn.js":53,"buffer":83,"randombytes":449}],75:[function(require,module,exports){ +},{"bn.js":54,"buffer":84,"randombytes":450}],76:[function(require,module,exports){ (function (Buffer){ const Sha3 = require('js-sha3') @@ -43353,7 +43956,7 @@ module.exports = { } }).call(this,require("buffer").Buffer) -},{"buffer":83,"js-sha3":431}],76:[function(require,module,exports){ +},{"buffer":84,"js-sha3":432}],77:[function(require,module,exports){ (function (Buffer){ 'use strict' exports['RSA-SHA224'] = exports.sha224WithRSAEncryption = { @@ -43429,7 +44032,7 @@ exports['RSA-MD5'] = exports.md5WithRSAEncryption = { } }).call(this,require("buffer").Buffer) -},{"buffer":83}],77:[function(require,module,exports){ +},{"buffer":84}],78:[function(require,module,exports){ (function (Buffer){ var _algos = require('./algos') var createHash = require('create-hash') @@ -43536,7 +44139,7 @@ module.exports = { } }).call(this,require("buffer").Buffer) -},{"./algos":76,"./sign":79,"./verify":80,"buffer":83,"create-hash":382,"inherits":428,"stream":477}],78:[function(require,module,exports){ +},{"./algos":77,"./sign":80,"./verify":81,"buffer":84,"create-hash":383,"inherits":429,"stream":477}],79:[function(require,module,exports){ 'use strict' exports['1.3.132.0.10'] = 'secp256k1' @@ -43550,7 +44153,7 @@ exports['1.3.132.0.34'] = 'p384' exports['1.3.132.0.35'] = 'p521' -},{}],79:[function(require,module,exports){ +},{}],80:[function(require,module,exports){ (function (Buffer){ // much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js var createHmac = require('create-hmac') @@ -43739,7 +44342,7 @@ module.exports.getKey = getKey module.exports.makeKey = makeKey }).call(this,require("buffer").Buffer) -},{"./curves":78,"bn.js":53,"browserify-rsa":74,"buffer":83,"create-hmac":385,"elliptic":397,"parse-asn1":439}],80:[function(require,module,exports){ +},{"./curves":79,"bn.js":54,"browserify-rsa":75,"buffer":84,"create-hmac":386,"elliptic":398,"parse-asn1":440}],81:[function(require,module,exports){ (function (Buffer){ // much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js var curves = require('./curves') @@ -43846,7 +44449,7 @@ function checkValue (b, q) { module.exports = verify }).call(this,require("buffer").Buffer) -},{"./curves":78,"bn.js":53,"buffer":83,"elliptic":397,"parse-asn1":439}],81:[function(require,module,exports){ +},{"./curves":79,"bn.js":54,"buffer":84,"elliptic":398,"parse-asn1":440}],82:[function(require,module,exports){ (function (global){ 'use strict'; @@ -43958,7 +44561,7 @@ exports.allocUnsafeSlow = function allocUnsafeSlow(size) { } }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"buffer":83}],82:[function(require,module,exports){ +},{"buffer":84}],83:[function(require,module,exports){ (function (Buffer){ module.exports = function xor (a, b) { var length = Math.min(a.length, b.length) @@ -43972,7 +44575,7 @@ module.exports = function xor (a, b) { } }).call(this,require("buffer").Buffer) -},{"buffer":83}],83:[function(require,module,exports){ +},{"buffer":84}],84:[function(require,module,exports){ (function (global){ /*! * The buffer module from node.js, for the browser. @@ -45687,7 +46290,7 @@ function isnan (val) { } }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"base64-js":50,"ieee754":426,"isarray":430}],84:[function(require,module,exports){ +},{"base64-js":51,"ieee754":427,"isarray":431}],85:[function(require,module,exports){ (function (Buffer){ var Transform = require('stream').Transform var inherits = require('inherits') @@ -45781,21 +46384,21 @@ CipherBase.prototype._toString = function (value, enc, final) { } }).call(this,require("buffer").Buffer) -},{"buffer":83,"inherits":428,"stream":477,"string_decoder":478}],85:[function(require,module,exports){ +},{"buffer":84,"inherits":429,"stream":477,"string_decoder":478}],86:[function(require,module,exports){ require('../../modules/core.regexp.escape'); module.exports = require('../../modules/_core').RegExp.escape; -},{"../../modules/_core":106,"../../modules/core.regexp.escape":203}],86:[function(require,module,exports){ +},{"../../modules/_core":107,"../../modules/core.regexp.escape":204}],87:[function(require,module,exports){ module.exports = function(it){ if(typeof it != 'function')throw TypeError(it + ' is not a function!'); return it; }; -},{}],87:[function(require,module,exports){ +},{}],88:[function(require,module,exports){ var cof = require('./_cof'); module.exports = function(it, msg){ if(typeof it != 'number' && cof(it) != 'Number')throw TypeError(msg); return +it; }; -},{"./_cof":101}],88:[function(require,module,exports){ +},{"./_cof":102}],89:[function(require,module,exports){ // 22.1.3.31 Array.prototype[@@unscopables] var UNSCOPABLES = require('./_wks')('unscopables') , ArrayProto = Array.prototype; @@ -45803,19 +46406,19 @@ if(ArrayProto[UNSCOPABLES] == undefined)require('./_hide')(ArrayProto, UNSCOPABL module.exports = function(key){ ArrayProto[UNSCOPABLES][key] = true; }; -},{"./_hide":123,"./_wks":200}],89:[function(require,module,exports){ +},{"./_hide":124,"./_wks":201}],90:[function(require,module,exports){ module.exports = function(it, Constructor, name, forbiddenField){ if(!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)){ throw TypeError(name + ': incorrect invocation!'); } return it; }; -},{}],90:[function(require,module,exports){ +},{}],91:[function(require,module,exports){ var isObject = require('./_is-object'); module.exports = function(it){ if(!isObject(it))throw TypeError(it + ' is not an object!'); return it; }; -},{"./_is-object":132}],91:[function(require,module,exports){ +},{"./_is-object":133}],92:[function(require,module,exports){ // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) 'use strict'; var toObject = require('./_to-object') @@ -45842,7 +46445,7 @@ module.exports = [].copyWithin || function copyWithin(target/*= 0*/, start/*= 0, from += inc; } return O; }; -},{"./_to-index":188,"./_to-length":191,"./_to-object":192}],92:[function(require,module,exports){ +},{"./_to-index":189,"./_to-length":192,"./_to-object":193}],93:[function(require,module,exports){ // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) 'use strict'; var toObject = require('./_to-object') @@ -45858,7 +46461,7 @@ module.exports = function fill(value /*, start = 0, end = @length */){ while(endPos > index)O[index++] = value; return O; }; -},{"./_to-index":188,"./_to-length":191,"./_to-object":192}],93:[function(require,module,exports){ +},{"./_to-index":189,"./_to-length":192,"./_to-object":193}],94:[function(require,module,exports){ var forOf = require('./_for-of'); module.exports = function(iter, ITERATOR){ @@ -45867,7 +46470,7 @@ module.exports = function(iter, ITERATOR){ return result; }; -},{"./_for-of":120}],94:[function(require,module,exports){ +},{"./_for-of":121}],95:[function(require,module,exports){ // false -> Array#indexOf // true -> Array#includes var toIObject = require('./_to-iobject') @@ -45889,7 +46492,7 @@ module.exports = function(IS_INCLUDES){ } return !IS_INCLUDES && -1; }; }; -},{"./_to-index":188,"./_to-iobject":190,"./_to-length":191}],95:[function(require,module,exports){ +},{"./_to-index":189,"./_to-iobject":191,"./_to-length":192}],96:[function(require,module,exports){ // 0 -> Array#forEach // 1 -> Array#map // 2 -> Array#filter @@ -45934,7 +46537,7 @@ module.exports = function(TYPE, $create){ return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; }; }; -},{"./_array-species-create":98,"./_ctx":108,"./_iobject":128,"./_to-length":191,"./_to-object":192}],96:[function(require,module,exports){ +},{"./_array-species-create":99,"./_ctx":109,"./_iobject":129,"./_to-length":192,"./_to-object":193}],97:[function(require,module,exports){ var aFunction = require('./_a-function') , toObject = require('./_to-object') , IObject = require('./_iobject') @@ -45963,7 +46566,7 @@ module.exports = function(that, callbackfn, aLen, memo, isRight){ } return memo; }; -},{"./_a-function":86,"./_iobject":128,"./_to-length":191,"./_to-object":192}],97:[function(require,module,exports){ +},{"./_a-function":87,"./_iobject":129,"./_to-length":192,"./_to-object":193}],98:[function(require,module,exports){ var isObject = require('./_is-object') , isArray = require('./_is-array') , SPECIES = require('./_wks')('species'); @@ -45980,14 +46583,14 @@ module.exports = function(original){ } } return C === undefined ? Array : C; }; -},{"./_is-array":130,"./_is-object":132,"./_wks":200}],98:[function(require,module,exports){ +},{"./_is-array":131,"./_is-object":133,"./_wks":201}],99:[function(require,module,exports){ // 9.4.2.3 ArraySpeciesCreate(originalArray, length) var speciesConstructor = require('./_array-species-constructor'); module.exports = function(original, length){ return new (speciesConstructor(original))(length); }; -},{"./_array-species-constructor":97}],99:[function(require,module,exports){ +},{"./_array-species-constructor":98}],100:[function(require,module,exports){ 'use strict'; var aFunction = require('./_a-function') , isObject = require('./_is-object') @@ -46012,7 +46615,7 @@ module.exports = Function.bind || function bind(that /*, args... */){ if(isObject(fn.prototype))bound.prototype = fn.prototype; return bound; }; -},{"./_a-function":86,"./_invoke":127,"./_is-object":132}],100:[function(require,module,exports){ +},{"./_a-function":87,"./_invoke":128,"./_is-object":133}],101:[function(require,module,exports){ // getting tag from 19.1.3.6 Object.prototype.toString() var cof = require('./_cof') , TAG = require('./_wks')('toStringTag') @@ -46036,13 +46639,13 @@ module.exports = function(it){ // ES3 arguments fallback : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; }; -},{"./_cof":101,"./_wks":200}],101:[function(require,module,exports){ +},{"./_cof":102,"./_wks":201}],102:[function(require,module,exports){ var toString = {}.toString; module.exports = function(it){ return toString.call(it).slice(8, -1); }; -},{}],102:[function(require,module,exports){ +},{}],103:[function(require,module,exports){ 'use strict'; var dP = require('./_object-dp').f , create = require('./_object-create') @@ -46186,7 +46789,7 @@ module.exports = { setSpecies(NAME); } }; -},{"./_an-instance":89,"./_ctx":108,"./_defined":110,"./_descriptors":111,"./_for-of":120,"./_hide":123,"./_iter-define":136,"./_iter-step":138,"./_meta":145,"./_object-create":149,"./_object-dp":150,"./_redefine-all":169,"./_set-species":174}],103:[function(require,module,exports){ +},{"./_an-instance":90,"./_ctx":109,"./_defined":111,"./_descriptors":112,"./_for-of":121,"./_hide":124,"./_iter-define":137,"./_iter-step":139,"./_meta":146,"./_object-create":150,"./_object-dp":151,"./_redefine-all":170,"./_set-species":175}],104:[function(require,module,exports){ // https://github.com/DavidBruant/Map-Set.prototype.toJSON var classof = require('./_classof') , from = require('./_array-from-iterable'); @@ -46196,7 +46799,7 @@ module.exports = function(NAME){ return from(this); }; }; -},{"./_array-from-iterable":93,"./_classof":100}],104:[function(require,module,exports){ +},{"./_array-from-iterable":94,"./_classof":101}],105:[function(require,module,exports){ 'use strict'; var redefineAll = require('./_redefine-all') , getWeak = require('./_meta').getWeak @@ -46280,7 +46883,7 @@ module.exports = { }, ufstore: uncaughtFrozenStore }; -},{"./_an-instance":89,"./_an-object":90,"./_array-methods":95,"./_for-of":120,"./_has":122,"./_is-object":132,"./_meta":145,"./_redefine-all":169}],105:[function(require,module,exports){ +},{"./_an-instance":90,"./_an-object":91,"./_array-methods":96,"./_for-of":121,"./_has":123,"./_is-object":133,"./_meta":146,"./_redefine-all":170}],106:[function(require,module,exports){ 'use strict'; var global = require('./_global') , $export = require('./_export') @@ -46366,10 +46969,10 @@ module.exports = function(NAME, wrapper, methods, common, IS_MAP, IS_WEAK){ return C; }; -},{"./_an-instance":89,"./_export":115,"./_fails":117,"./_for-of":120,"./_global":121,"./_inherit-if-required":126,"./_is-object":132,"./_iter-detect":137,"./_meta":145,"./_redefine":170,"./_redefine-all":169,"./_set-to-string-tag":175}],106:[function(require,module,exports){ +},{"./_an-instance":90,"./_export":116,"./_fails":118,"./_for-of":121,"./_global":122,"./_inherit-if-required":127,"./_is-object":133,"./_iter-detect":138,"./_meta":146,"./_redefine":171,"./_redefine-all":170,"./_set-to-string-tag":176}],107:[function(require,module,exports){ var core = module.exports = {version: '2.4.0'}; if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef -},{}],107:[function(require,module,exports){ +},{}],108:[function(require,module,exports){ 'use strict'; var $defineProperty = require('./_object-dp') , createDesc = require('./_property-desc'); @@ -46378,7 +46981,7 @@ module.exports = function(object, index, value){ if(index in object)$defineProperty.f(object, index, createDesc(0, value)); else object[index] = value; }; -},{"./_object-dp":150,"./_property-desc":168}],108:[function(require,module,exports){ +},{"./_object-dp":151,"./_property-desc":169}],109:[function(require,module,exports){ // optional / simple context binding var aFunction = require('./_a-function'); module.exports = function(fn, that, length){ @@ -46399,7 +47002,7 @@ module.exports = function(fn, that, length){ return fn.apply(that, arguments); }; }; -},{"./_a-function":86}],109:[function(require,module,exports){ +},{"./_a-function":87}],110:[function(require,module,exports){ 'use strict'; var anObject = require('./_an-object') , toPrimitive = require('./_to-primitive') @@ -46409,18 +47012,18 @@ module.exports = function(hint){ if(hint !== 'string' && hint !== NUMBER && hint !== 'default')throw TypeError('Incorrect hint'); return toPrimitive(anObject(this), hint != NUMBER); }; -},{"./_an-object":90,"./_to-primitive":193}],110:[function(require,module,exports){ +},{"./_an-object":91,"./_to-primitive":194}],111:[function(require,module,exports){ // 7.2.1 RequireObjectCoercible(argument) module.exports = function(it){ if(it == undefined)throw TypeError("Can't call method on " + it); return it; }; -},{}],111:[function(require,module,exports){ +},{}],112:[function(require,module,exports){ // Thank's IE8 for his funny defineProperty module.exports = !require('./_fails')(function(){ return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7; }); -},{"./_fails":117}],112:[function(require,module,exports){ +},{"./_fails":118}],113:[function(require,module,exports){ var isObject = require('./_is-object') , document = require('./_global').document // in old IE typeof document.createElement is 'object' @@ -46428,12 +47031,12 @@ var isObject = require('./_is-object') module.exports = function(it){ return is ? document.createElement(it) : {}; }; -},{"./_global":121,"./_is-object":132}],113:[function(require,module,exports){ +},{"./_global":122,"./_is-object":133}],114:[function(require,module,exports){ // IE 8- don't enum bug keys module.exports = ( 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' ).split(','); -},{}],114:[function(require,module,exports){ +},{}],115:[function(require,module,exports){ // all enumerable object keys, includes symbols var getKeys = require('./_object-keys') , gOPS = require('./_object-gops') @@ -46449,7 +47052,7 @@ module.exports = function(it){ while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))result.push(key); } return result; }; -},{"./_object-gops":156,"./_object-keys":159,"./_object-pie":160}],115:[function(require,module,exports){ +},{"./_object-gops":157,"./_object-keys":160,"./_object-pie":161}],116:[function(require,module,exports){ var global = require('./_global') , core = require('./_core') , hide = require('./_hide') @@ -46493,7 +47096,7 @@ $export.W = 32; // wrap $export.U = 64; // safe $export.R = 128; // real proto method for `library` module.exports = $export; -},{"./_core":106,"./_ctx":108,"./_global":121,"./_hide":123,"./_redefine":170}],116:[function(require,module,exports){ +},{"./_core":107,"./_ctx":109,"./_global":122,"./_hide":124,"./_redefine":171}],117:[function(require,module,exports){ var MATCH = require('./_wks')('match'); module.exports = function(KEY){ var re = /./; @@ -46506,7 +47109,7 @@ module.exports = function(KEY){ } catch(f){ /* empty */ } } return true; }; -},{"./_wks":200}],117:[function(require,module,exports){ +},{"./_wks":201}],118:[function(require,module,exports){ module.exports = function(exec){ try { return !!exec(); @@ -46514,7 +47117,7 @@ module.exports = function(exec){ return true; } }; -},{}],118:[function(require,module,exports){ +},{}],119:[function(require,module,exports){ 'use strict'; var hide = require('./_hide') , redefine = require('./_redefine') @@ -46543,7 +47146,7 @@ module.exports = function(KEY, length, exec){ ); } }; -},{"./_defined":110,"./_fails":117,"./_hide":123,"./_redefine":170,"./_wks":200}],119:[function(require,module,exports){ +},{"./_defined":111,"./_fails":118,"./_hide":124,"./_redefine":171,"./_wks":201}],120:[function(require,module,exports){ 'use strict'; // 21.2.5.3 get RegExp.prototype.flags var anObject = require('./_an-object'); @@ -46557,7 +47160,7 @@ module.exports = function(){ if(that.sticky) result += 'y'; return result; }; -},{"./_an-object":90}],120:[function(require,module,exports){ +},{"./_an-object":91}],121:[function(require,module,exports){ var ctx = require('./_ctx') , call = require('./_iter-call') , isArrayIter = require('./_is-array-iter') @@ -46583,17 +47186,17 @@ var exports = module.exports = function(iterable, entries, fn, that, ITERATOR){ }; exports.BREAK = BREAK; exports.RETURN = RETURN; -},{"./_an-object":90,"./_ctx":108,"./_is-array-iter":129,"./_iter-call":134,"./_to-length":191,"./core.get-iterator-method":201}],121:[function(require,module,exports){ +},{"./_an-object":91,"./_ctx":109,"./_is-array-iter":130,"./_iter-call":135,"./_to-length":192,"./core.get-iterator-method":202}],122:[function(require,module,exports){ // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 var global = module.exports = typeof window != 'undefined' && window.Math == Math ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')(); if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef -},{}],122:[function(require,module,exports){ +},{}],123:[function(require,module,exports){ var hasOwnProperty = {}.hasOwnProperty; module.exports = function(it, key){ return hasOwnProperty.call(it, key); }; -},{}],123:[function(require,module,exports){ +},{}],124:[function(require,module,exports){ var dP = require('./_object-dp') , createDesc = require('./_property-desc'); module.exports = require('./_descriptors') ? function(object, key, value){ @@ -46602,13 +47205,13 @@ module.exports = require('./_descriptors') ? function(object, key, value){ object[key] = value; return object; }; -},{"./_descriptors":111,"./_object-dp":150,"./_property-desc":168}],124:[function(require,module,exports){ +},{"./_descriptors":112,"./_object-dp":151,"./_property-desc":169}],125:[function(require,module,exports){ module.exports = require('./_global').document && document.documentElement; -},{"./_global":121}],125:[function(require,module,exports){ +},{"./_global":122}],126:[function(require,module,exports){ module.exports = !require('./_descriptors') && !require('./_fails')(function(){ return Object.defineProperty(require('./_dom-create')('div'), 'a', {get: function(){ return 7; }}).a != 7; }); -},{"./_descriptors":111,"./_dom-create":112,"./_fails":117}],126:[function(require,module,exports){ +},{"./_descriptors":112,"./_dom-create":113,"./_fails":118}],127:[function(require,module,exports){ var isObject = require('./_is-object') , setPrototypeOf = require('./_set-proto').set; module.exports = function(that, target, C){ @@ -46617,7 +47220,7 @@ module.exports = function(that, target, C){ setPrototypeOf(that, P); } return that; }; -},{"./_is-object":132,"./_set-proto":173}],127:[function(require,module,exports){ +},{"./_is-object":133,"./_set-proto":174}],128:[function(require,module,exports){ // fast apply, http://jsperf.lnkit.com/fast-apply/5 module.exports = function(fn, args, that){ var un = that === undefined; @@ -46634,13 +47237,13 @@ module.exports = function(fn, args, that){ : fn.call(that, args[0], args[1], args[2], args[3]); } return fn.apply(that, args); }; -},{}],128:[function(require,module,exports){ +},{}],129:[function(require,module,exports){ // fallback for non-array-like ES3 and non-enumerable old V8 strings var cof = require('./_cof'); module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){ return cof(it) == 'String' ? it.split('') : Object(it); }; -},{"./_cof":101}],129:[function(require,module,exports){ +},{"./_cof":102}],130:[function(require,module,exports){ // check on default Array iterator var Iterators = require('./_iterators') , ITERATOR = require('./_wks')('iterator') @@ -46649,24 +47252,24 @@ var Iterators = require('./_iterators') module.exports = function(it){ return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); }; -},{"./_iterators":139,"./_wks":200}],130:[function(require,module,exports){ +},{"./_iterators":140,"./_wks":201}],131:[function(require,module,exports){ // 7.2.2 IsArray(argument) var cof = require('./_cof'); module.exports = Array.isArray || function isArray(arg){ return cof(arg) == 'Array'; }; -},{"./_cof":101}],131:[function(require,module,exports){ +},{"./_cof":102}],132:[function(require,module,exports){ // 20.1.2.3 Number.isInteger(number) var isObject = require('./_is-object') , floor = Math.floor; module.exports = function isInteger(it){ return !isObject(it) && isFinite(it) && floor(it) === it; }; -},{"./_is-object":132}],132:[function(require,module,exports){ +},{"./_is-object":133}],133:[function(require,module,exports){ module.exports = function(it){ return typeof it === 'object' ? it !== null : typeof it === 'function'; }; -},{}],133:[function(require,module,exports){ +},{}],134:[function(require,module,exports){ // 7.2.8 IsRegExp(argument) var isObject = require('./_is-object') , cof = require('./_cof') @@ -46675,7 +47278,7 @@ module.exports = function(it){ var isRegExp; return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp'); }; -},{"./_cof":101,"./_is-object":132,"./_wks":200}],134:[function(require,module,exports){ +},{"./_cof":102,"./_is-object":133,"./_wks":201}],135:[function(require,module,exports){ // call something on iterator step with safe closing on error var anObject = require('./_an-object'); module.exports = function(iterator, fn, value, entries){ @@ -46688,7 +47291,7 @@ module.exports = function(iterator, fn, value, entries){ throw e; } }; -},{"./_an-object":90}],135:[function(require,module,exports){ +},{"./_an-object":91}],136:[function(require,module,exports){ 'use strict'; var create = require('./_object-create') , descriptor = require('./_property-desc') @@ -46702,7 +47305,7 @@ module.exports = function(Constructor, NAME, next){ Constructor.prototype = create(IteratorPrototype, {next: descriptor(1, next)}); setToStringTag(Constructor, NAME + ' Iterator'); }; -},{"./_hide":123,"./_object-create":149,"./_property-desc":168,"./_set-to-string-tag":175,"./_wks":200}],136:[function(require,module,exports){ +},{"./_hide":124,"./_object-create":150,"./_property-desc":169,"./_set-to-string-tag":176,"./_wks":201}],137:[function(require,module,exports){ 'use strict'; var LIBRARY = require('./_library') , $export = require('./_export') @@ -46773,7 +47376,7 @@ module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED } return methods; }; -},{"./_export":115,"./_has":122,"./_hide":123,"./_iter-create":135,"./_iterators":139,"./_library":141,"./_object-gpo":157,"./_redefine":170,"./_set-to-string-tag":175,"./_wks":200}],137:[function(require,module,exports){ +},{"./_export":116,"./_has":123,"./_hide":124,"./_iter-create":136,"./_iterators":140,"./_library":142,"./_object-gpo":158,"./_redefine":171,"./_set-to-string-tag":176,"./_wks":201}],138:[function(require,module,exports){ var ITERATOR = require('./_wks')('iterator') , SAFE_CLOSING = false; @@ -46795,13 +47398,13 @@ module.exports = function(exec, skipClosing){ } catch(e){ /* empty */ } return safe; }; -},{"./_wks":200}],138:[function(require,module,exports){ +},{"./_wks":201}],139:[function(require,module,exports){ module.exports = function(done, value){ return {value: value, done: !!done}; }; -},{}],139:[function(require,module,exports){ -module.exports = {}; },{}],140:[function(require,module,exports){ +module.exports = {}; +},{}],141:[function(require,module,exports){ var getKeys = require('./_object-keys') , toIObject = require('./_to-iobject'); module.exports = function(object, el){ @@ -46812,9 +47415,9 @@ module.exports = function(object, el){ , key; while(length > index)if(O[key = keys[index++]] === el)return key; }; -},{"./_object-keys":159,"./_to-iobject":190}],141:[function(require,module,exports){ +},{"./_object-keys":160,"./_to-iobject":191}],142:[function(require,module,exports){ module.exports = false; -},{}],142:[function(require,module,exports){ +},{}],143:[function(require,module,exports){ // 20.2.2.14 Math.expm1(x) var $expm1 = Math.expm1; module.exports = (!$expm1 @@ -46825,17 +47428,17 @@ module.exports = (!$expm1 ) ? function expm1(x){ return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1; } : $expm1; -},{}],143:[function(require,module,exports){ +},{}],144:[function(require,module,exports){ // 20.2.2.20 Math.log1p(x) module.exports = Math.log1p || function log1p(x){ return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x); }; -},{}],144:[function(require,module,exports){ +},{}],145:[function(require,module,exports){ // 20.2.2.28 Math.sign(x) module.exports = Math.sign || function sign(x){ return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; }; -},{}],145:[function(require,module,exports){ +},{}],146:[function(require,module,exports){ var META = require('./_uid')('meta') , isObject = require('./_is-object') , has = require('./_has') @@ -46889,7 +47492,7 @@ var meta = module.exports = { getWeak: getWeak, onFreeze: onFreeze }; -},{"./_fails":117,"./_has":122,"./_is-object":132,"./_object-dp":150,"./_uid":197}],146:[function(require,module,exports){ +},{"./_fails":118,"./_has":123,"./_is-object":133,"./_object-dp":151,"./_uid":198}],147:[function(require,module,exports){ var Map = require('./es6.map') , $export = require('./_export') , shared = require('./_shared')('metadata') @@ -46941,7 +47544,7 @@ module.exports = { key: toMetaKey, exp: exp }; -},{"./_export":115,"./_shared":177,"./es6.map":233,"./es6.weak-map":339}],147:[function(require,module,exports){ +},{"./_export":116,"./_shared":178,"./es6.map":234,"./es6.weak-map":340}],148:[function(require,module,exports){ var global = require('./_global') , macrotask = require('./_task').set , Observer = global.MutationObserver || global.WebKitMutationObserver @@ -47010,7 +47613,7 @@ module.exports = function(){ } last = task; }; }; -},{"./_cof":101,"./_global":121,"./_task":187}],148:[function(require,module,exports){ +},{"./_cof":102,"./_global":122,"./_task":188}],149:[function(require,module,exports){ 'use strict'; // 19.1.2.1 Object.assign(target, source, ...) var getKeys = require('./_object-keys') @@ -47044,7 +47647,7 @@ module.exports = !$assign || require('./_fails')(function(){ while(length > j)if(isEnum.call(S, key = keys[j++]))T[key] = S[key]; } return T; } : $assign; -},{"./_fails":117,"./_iobject":128,"./_object-gops":156,"./_object-keys":159,"./_object-pie":160,"./_to-object":192}],149:[function(require,module,exports){ +},{"./_fails":118,"./_iobject":129,"./_object-gops":157,"./_object-keys":160,"./_object-pie":161,"./_to-object":193}],150:[function(require,module,exports){ // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) var anObject = require('./_an-object') , dPs = require('./_object-dps') @@ -47085,7 +47688,7 @@ module.exports = Object.create || function create(O, Properties){ } else result = createDict(); return Properties === undefined ? result : dPs(result, Properties); }; -},{"./_an-object":90,"./_dom-create":112,"./_enum-bug-keys":113,"./_html":124,"./_object-dps":151,"./_shared-key":176}],150:[function(require,module,exports){ +},{"./_an-object":91,"./_dom-create":113,"./_enum-bug-keys":114,"./_html":125,"./_object-dps":152,"./_shared-key":177}],151:[function(require,module,exports){ var anObject = require('./_an-object') , IE8_DOM_DEFINE = require('./_ie8-dom-define') , toPrimitive = require('./_to-primitive') @@ -47102,7 +47705,7 @@ exports.f = require('./_descriptors') ? Object.defineProperty : function defineP if('value' in Attributes)O[P] = Attributes.value; return O; }; -},{"./_an-object":90,"./_descriptors":111,"./_ie8-dom-define":125,"./_to-primitive":193}],151:[function(require,module,exports){ +},{"./_an-object":91,"./_descriptors":112,"./_ie8-dom-define":126,"./_to-primitive":194}],152:[function(require,module,exports){ var dP = require('./_object-dp') , anObject = require('./_an-object') , getKeys = require('./_object-keys'); @@ -47116,7 +47719,7 @@ module.exports = require('./_descriptors') ? Object.defineProperties : function while(length > i)dP.f(O, P = keys[i++], Properties[P]); return O; }; -},{"./_an-object":90,"./_descriptors":111,"./_object-dp":150,"./_object-keys":159}],152:[function(require,module,exports){ +},{"./_an-object":91,"./_descriptors":112,"./_object-dp":151,"./_object-keys":160}],153:[function(require,module,exports){ // Forced replacement prototype accessors methods module.exports = require('./_library')|| !require('./_fails')(function(){ var K = Math.random(); @@ -47124,7 +47727,7 @@ module.exports = require('./_library')|| !require('./_fails')(function(){ __defineSetter__.call(null, K, function(){ /* empty */}); delete require('./_global')[K]; }); -},{"./_fails":117,"./_global":121,"./_library":141}],153:[function(require,module,exports){ +},{"./_fails":118,"./_global":122,"./_library":142}],154:[function(require,module,exports){ var pIE = require('./_object-pie') , createDesc = require('./_property-desc') , toIObject = require('./_to-iobject') @@ -47141,7 +47744,7 @@ exports.f = require('./_descriptors') ? gOPD : function getOwnPropertyDescriptor } catch(e){ /* empty */ } if(has(O, P))return createDesc(!pIE.f.call(O, P), O[P]); }; -},{"./_descriptors":111,"./_has":122,"./_ie8-dom-define":125,"./_object-pie":160,"./_property-desc":168,"./_to-iobject":190,"./_to-primitive":193}],154:[function(require,module,exports){ +},{"./_descriptors":112,"./_has":123,"./_ie8-dom-define":126,"./_object-pie":161,"./_property-desc":169,"./_to-iobject":191,"./_to-primitive":194}],155:[function(require,module,exports){ // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window var toIObject = require('./_to-iobject') , gOPN = require('./_object-gopn').f @@ -47162,7 +47765,7 @@ module.exports.f = function getOwnPropertyNames(it){ return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it)); }; -},{"./_object-gopn":155,"./_to-iobject":190}],155:[function(require,module,exports){ +},{"./_object-gopn":156,"./_to-iobject":191}],156:[function(require,module,exports){ // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) var $keys = require('./_object-keys-internal') , hiddenKeys = require('./_enum-bug-keys').concat('length', 'prototype'); @@ -47170,9 +47773,9 @@ var $keys = require('./_object-keys-internal') exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O){ return $keys(O, hiddenKeys); }; -},{"./_enum-bug-keys":113,"./_object-keys-internal":158}],156:[function(require,module,exports){ +},{"./_enum-bug-keys":114,"./_object-keys-internal":159}],157:[function(require,module,exports){ exports.f = Object.getOwnPropertySymbols; -},{}],157:[function(require,module,exports){ +},{}],158:[function(require,module,exports){ // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) var has = require('./_has') , toObject = require('./_to-object') @@ -47186,7 +47789,7 @@ module.exports = Object.getPrototypeOf || function(O){ return O.constructor.prototype; } return O instanceof Object ? ObjectProto : null; }; -},{"./_has":122,"./_shared-key":176,"./_to-object":192}],158:[function(require,module,exports){ +},{"./_has":123,"./_shared-key":177,"./_to-object":193}],159:[function(require,module,exports){ var has = require('./_has') , toIObject = require('./_to-iobject') , arrayIndexOf = require('./_array-includes')(false) @@ -47204,7 +47807,7 @@ module.exports = function(object, names){ } return result; }; -},{"./_array-includes":94,"./_has":122,"./_shared-key":176,"./_to-iobject":190}],159:[function(require,module,exports){ +},{"./_array-includes":95,"./_has":123,"./_shared-key":177,"./_to-iobject":191}],160:[function(require,module,exports){ // 19.1.2.14 / 15.2.3.14 Object.keys(O) var $keys = require('./_object-keys-internal') , enumBugKeys = require('./_enum-bug-keys'); @@ -47212,9 +47815,9 @@ var $keys = require('./_object-keys-internal') module.exports = Object.keys || function keys(O){ return $keys(O, enumBugKeys); }; -},{"./_enum-bug-keys":113,"./_object-keys-internal":158}],160:[function(require,module,exports){ +},{"./_enum-bug-keys":114,"./_object-keys-internal":159}],161:[function(require,module,exports){ exports.f = {}.propertyIsEnumerable; -},{}],161:[function(require,module,exports){ +},{}],162:[function(require,module,exports){ // most Object methods by ES6 should accept primitives var $export = require('./_export') , core = require('./_core') @@ -47225,7 +47828,7 @@ module.exports = function(KEY, exec){ exp[KEY] = exec(fn); $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp); }; -},{"./_core":106,"./_export":115,"./_fails":117}],162:[function(require,module,exports){ +},{"./_core":107,"./_export":116,"./_fails":118}],163:[function(require,module,exports){ var getKeys = require('./_object-keys') , toIObject = require('./_to-iobject') , isEnum = require('./_object-pie').f; @@ -47242,7 +47845,7 @@ module.exports = function(isEntries){ } return result; }; }; -},{"./_object-keys":159,"./_object-pie":160,"./_to-iobject":190}],163:[function(require,module,exports){ +},{"./_object-keys":160,"./_object-pie":161,"./_to-iobject":191}],164:[function(require,module,exports){ // all object keys, includes non-enumerable and symbols var gOPN = require('./_object-gopn') , gOPS = require('./_object-gops') @@ -47253,7 +47856,7 @@ module.exports = Reflect && Reflect.ownKeys || function ownKeys(it){ , getSymbols = gOPS.f; return getSymbols ? keys.concat(getSymbols(it)) : keys; }; -},{"./_an-object":90,"./_global":121,"./_object-gopn":155,"./_object-gops":156}],164:[function(require,module,exports){ +},{"./_an-object":91,"./_global":122,"./_object-gopn":156,"./_object-gops":157}],165:[function(require,module,exports){ var $parseFloat = require('./_global').parseFloat , $trim = require('./_string-trim').trim; @@ -47262,7 +47865,7 @@ module.exports = 1 / $parseFloat(require('./_string-ws') + '-0') !== -Infinity ? , result = $parseFloat(string); return result === 0 && string.charAt(0) == '-' ? -0 : result; } : $parseFloat; -},{"./_global":121,"./_string-trim":185,"./_string-ws":186}],165:[function(require,module,exports){ +},{"./_global":122,"./_string-trim":186,"./_string-ws":187}],166:[function(require,module,exports){ var $parseInt = require('./_global').parseInt , $trim = require('./_string-trim').trim , ws = require('./_string-ws') @@ -47272,7 +47875,7 @@ module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? f var string = $trim(String(str), 3); return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10)); } : $parseInt; -},{"./_global":121,"./_string-trim":185,"./_string-ws":186}],166:[function(require,module,exports){ +},{"./_global":122,"./_string-trim":186,"./_string-ws":187}],167:[function(require,module,exports){ 'use strict'; var path = require('./_path') , invoke = require('./_invoke') @@ -47296,9 +47899,9 @@ module.exports = function(/* ...pargs */){ return invoke(fn, args, that); }; }; -},{"./_a-function":86,"./_invoke":127,"./_path":167}],167:[function(require,module,exports){ +},{"./_a-function":87,"./_invoke":128,"./_path":168}],168:[function(require,module,exports){ module.exports = require('./_global'); -},{"./_global":121}],168:[function(require,module,exports){ +},{"./_global":122}],169:[function(require,module,exports){ module.exports = function(bitmap, value){ return { enumerable : !(bitmap & 1), @@ -47307,13 +47910,13 @@ module.exports = function(bitmap, value){ value : value }; }; -},{}],169:[function(require,module,exports){ +},{}],170:[function(require,module,exports){ var redefine = require('./_redefine'); module.exports = function(target, src, safe){ for(var key in src)redefine(target, key, src[key], safe); return target; }; -},{"./_redefine":170}],170:[function(require,module,exports){ +},{"./_redefine":171}],171:[function(require,module,exports){ var global = require('./_global') , hide = require('./_hide') , has = require('./_has') @@ -47346,7 +47949,7 @@ require('./_core').inspectSource = function(it){ })(Function.prototype, TO_STRING, function toString(){ return typeof this == 'function' && this[SRC] || $toString.call(this); }); -},{"./_core":106,"./_global":121,"./_has":122,"./_hide":123,"./_uid":197}],171:[function(require,module,exports){ +},{"./_core":107,"./_global":122,"./_has":123,"./_hide":124,"./_uid":198}],172:[function(require,module,exports){ module.exports = function(regExp, replace){ var replacer = replace === Object(replace) ? function(part){ return replace[part]; @@ -47355,12 +47958,12 @@ module.exports = function(regExp, replace){ return String(it).replace(regExp, replacer); }; }; -},{}],172:[function(require,module,exports){ +},{}],173:[function(require,module,exports){ // 7.2.9 SameValue(x, y) module.exports = Object.is || function is(x, y){ return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; }; -},{}],173:[function(require,module,exports){ +},{}],174:[function(require,module,exports){ // Works with __proto__ only. Old v8 can't work with null proto objects. /* eslint-disable no-proto */ var isObject = require('./_is-object') @@ -47386,7 +47989,7 @@ module.exports = { }({}, false) : undefined), check: check }; -},{"./_an-object":90,"./_ctx":108,"./_is-object":132,"./_object-gopd":153}],174:[function(require,module,exports){ +},{"./_an-object":91,"./_ctx":109,"./_is-object":133,"./_object-gopd":154}],175:[function(require,module,exports){ 'use strict'; var global = require('./_global') , dP = require('./_object-dp') @@ -47400,7 +48003,7 @@ module.exports = function(KEY){ get: function(){ return this; } }); }; -},{"./_descriptors":111,"./_global":121,"./_object-dp":150,"./_wks":200}],175:[function(require,module,exports){ +},{"./_descriptors":112,"./_global":122,"./_object-dp":151,"./_wks":201}],176:[function(require,module,exports){ var def = require('./_object-dp').f , has = require('./_has') , TAG = require('./_wks')('toStringTag'); @@ -47408,20 +48011,20 @@ var def = require('./_object-dp').f module.exports = function(it, tag, stat){ if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag}); }; -},{"./_has":122,"./_object-dp":150,"./_wks":200}],176:[function(require,module,exports){ +},{"./_has":123,"./_object-dp":151,"./_wks":201}],177:[function(require,module,exports){ var shared = require('./_shared')('keys') , uid = require('./_uid'); module.exports = function(key){ return shared[key] || (shared[key] = uid(key)); }; -},{"./_shared":177,"./_uid":197}],177:[function(require,module,exports){ +},{"./_shared":178,"./_uid":198}],178:[function(require,module,exports){ var global = require('./_global') , SHARED = '__core-js_shared__' , store = global[SHARED] || (global[SHARED] = {}); module.exports = function(key){ return store[key] || (store[key] = {}); }; -},{"./_global":121}],178:[function(require,module,exports){ +},{"./_global":122}],179:[function(require,module,exports){ // 7.3.20 SpeciesConstructor(O, defaultConstructor) var anObject = require('./_an-object') , aFunction = require('./_a-function') @@ -47430,7 +48033,7 @@ module.exports = function(O, D){ var C = anObject(O).constructor, S; return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); }; -},{"./_a-function":86,"./_an-object":90,"./_wks":200}],179:[function(require,module,exports){ +},{"./_a-function":87,"./_an-object":91,"./_wks":201}],180:[function(require,module,exports){ var fails = require('./_fails'); module.exports = function(method, arg){ @@ -47438,7 +48041,7 @@ module.exports = function(method, arg){ arg ? method.call(null, function(){}, 1) : method.call(null); }); }; -},{"./_fails":117}],180:[function(require,module,exports){ +},{"./_fails":118}],181:[function(require,module,exports){ var toInteger = require('./_to-integer') , defined = require('./_defined'); // true -> String#at @@ -47456,7 +48059,7 @@ module.exports = function(TO_STRING){ : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; }; }; -},{"./_defined":110,"./_to-integer":189}],181:[function(require,module,exports){ +},{"./_defined":111,"./_to-integer":190}],182:[function(require,module,exports){ // helper for String#{startsWith, endsWith, includes} var isRegExp = require('./_is-regexp') , defined = require('./_defined'); @@ -47465,7 +48068,7 @@ module.exports = function(that, searchString, NAME){ if(isRegExp(searchString))throw TypeError('String#' + NAME + " doesn't accept regex!"); return String(defined(that)); }; -},{"./_defined":110,"./_is-regexp":133}],182:[function(require,module,exports){ +},{"./_defined":111,"./_is-regexp":134}],183:[function(require,module,exports){ var $export = require('./_export') , fails = require('./_fails') , defined = require('./_defined') @@ -47485,7 +48088,7 @@ module.exports = function(NAME, exec){ return test !== test.toLowerCase() || test.split('"').length > 3; }), 'String', O); }; -},{"./_defined":110,"./_export":115,"./_fails":117}],183:[function(require,module,exports){ +},{"./_defined":111,"./_export":116,"./_fails":118}],184:[function(require,module,exports){ // https://github.com/tc39/proposal-string-pad-start-end var toLength = require('./_to-length') , repeat = require('./_string-repeat') @@ -47503,7 +48106,7 @@ module.exports = function(that, maxLength, fillString, left){ return left ? stringFiller + S : S + stringFiller; }; -},{"./_defined":110,"./_string-repeat":184,"./_to-length":191}],184:[function(require,module,exports){ +},{"./_defined":111,"./_string-repeat":185,"./_to-length":192}],185:[function(require,module,exports){ 'use strict'; var toInteger = require('./_to-integer') , defined = require('./_defined'); @@ -47516,7 +48119,7 @@ module.exports = function repeat(count){ for(;n > 0; (n >>>= 1) && (str += str))if(n & 1)res += str; return res; }; -},{"./_defined":110,"./_to-integer":189}],185:[function(require,module,exports){ +},{"./_defined":111,"./_to-integer":190}],186:[function(require,module,exports){ var $export = require('./_export') , defined = require('./_defined') , fails = require('./_fails') @@ -47547,10 +48150,10 @@ var trim = exporter.trim = function(string, TYPE){ }; module.exports = exporter; -},{"./_defined":110,"./_export":115,"./_fails":117,"./_string-ws":186}],186:[function(require,module,exports){ +},{"./_defined":111,"./_export":116,"./_fails":118,"./_string-ws":187}],187:[function(require,module,exports){ module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; -},{}],187:[function(require,module,exports){ +},{}],188:[function(require,module,exports){ var ctx = require('./_ctx') , invoke = require('./_invoke') , html = require('./_html') @@ -47626,7 +48229,7 @@ module.exports = { set: setTask, clear: clearTask }; -},{"./_cof":101,"./_ctx":108,"./_dom-create":112,"./_global":121,"./_html":124,"./_invoke":127}],188:[function(require,module,exports){ +},{"./_cof":102,"./_ctx":109,"./_dom-create":113,"./_global":122,"./_html":125,"./_invoke":128}],189:[function(require,module,exports){ var toInteger = require('./_to-integer') , max = Math.max , min = Math.min; @@ -47634,34 +48237,34 @@ module.exports = function(index, length){ index = toInteger(index); return index < 0 ? max(index + length, 0) : min(index, length); }; -},{"./_to-integer":189}],189:[function(require,module,exports){ +},{"./_to-integer":190}],190:[function(require,module,exports){ // 7.1.4 ToInteger var ceil = Math.ceil , floor = Math.floor; module.exports = function(it){ return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); }; -},{}],190:[function(require,module,exports){ +},{}],191:[function(require,module,exports){ // to indexed object, toObject with fallback for non-array-like ES3 strings var IObject = require('./_iobject') , defined = require('./_defined'); module.exports = function(it){ return IObject(defined(it)); }; -},{"./_defined":110,"./_iobject":128}],191:[function(require,module,exports){ +},{"./_defined":111,"./_iobject":129}],192:[function(require,module,exports){ // 7.1.15 ToLength var toInteger = require('./_to-integer') , min = Math.min; module.exports = function(it){ return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 }; -},{"./_to-integer":189}],192:[function(require,module,exports){ +},{"./_to-integer":190}],193:[function(require,module,exports){ // 7.1.13 ToObject(argument) var defined = require('./_defined'); module.exports = function(it){ return Object(defined(it)); }; -},{"./_defined":110}],193:[function(require,module,exports){ +},{"./_defined":111}],194:[function(require,module,exports){ // 7.1.1 ToPrimitive(input [, PreferredType]) var isObject = require('./_is-object'); // instead of the ES6 spec version, we didn't implement @@toPrimitive case @@ -47674,7 +48277,7 @@ module.exports = function(it, S){ if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; throw TypeError("Can't convert object to primitive value"); }; -},{"./_is-object":132}],194:[function(require,module,exports){ +},{"./_is-object":133}],195:[function(require,module,exports){ 'use strict'; if(require('./_descriptors')){ var LIBRARY = require('./_library') @@ -48156,7 +48759,7 @@ if(require('./_descriptors')){ if(!LIBRARY && !CORRECT_ITER_NAME)hide(TypedArrayPrototype, ITERATOR, $iterator); }; } else module.exports = function(){ /* empty */ }; -},{"./_an-instance":89,"./_array-copy-within":91,"./_array-fill":92,"./_array-includes":94,"./_array-methods":95,"./_classof":100,"./_ctx":108,"./_descriptors":111,"./_export":115,"./_fails":117,"./_global":121,"./_has":122,"./_hide":123,"./_is-array-iter":129,"./_is-integer":131,"./_is-object":132,"./_iter-detect":137,"./_iterators":139,"./_library":141,"./_object-create":149,"./_object-dp":150,"./_object-gopd":153,"./_object-gopn":155,"./_object-gpo":157,"./_property-desc":168,"./_redefine-all":169,"./_same-value":172,"./_set-species":174,"./_species-constructor":178,"./_to-index":188,"./_to-integer":189,"./_to-length":191,"./_to-object":192,"./_to-primitive":193,"./_typed":196,"./_typed-buffer":195,"./_uid":197,"./_wks":200,"./core.get-iterator-method":201,"./core.is-iterable":202,"./es6.array.iterator":214}],195:[function(require,module,exports){ +},{"./_an-instance":90,"./_array-copy-within":92,"./_array-fill":93,"./_array-includes":95,"./_array-methods":96,"./_classof":101,"./_ctx":109,"./_descriptors":112,"./_export":116,"./_fails":118,"./_global":122,"./_has":123,"./_hide":124,"./_is-array-iter":130,"./_is-integer":132,"./_is-object":133,"./_iter-detect":138,"./_iterators":140,"./_library":142,"./_object-create":150,"./_object-dp":151,"./_object-gopd":154,"./_object-gopn":156,"./_object-gpo":158,"./_property-desc":169,"./_redefine-all":170,"./_same-value":173,"./_set-species":175,"./_species-constructor":179,"./_to-index":189,"./_to-integer":190,"./_to-length":192,"./_to-object":193,"./_to-primitive":194,"./_typed":197,"./_typed-buffer":196,"./_uid":198,"./_wks":201,"./core.get-iterator-method":202,"./core.is-iterable":203,"./es6.array.iterator":215}],196:[function(require,module,exports){ 'use strict'; var global = require('./_global') , DESCRIPTORS = require('./_descriptors') @@ -48432,7 +49035,7 @@ setToStringTag($DataView, DATA_VIEW); hide($DataView[PROTOTYPE], $typed.VIEW, true); exports[ARRAY_BUFFER] = $ArrayBuffer; exports[DATA_VIEW] = $DataView; -},{"./_an-instance":89,"./_array-fill":92,"./_descriptors":111,"./_fails":117,"./_global":121,"./_hide":123,"./_library":141,"./_object-dp":150,"./_object-gopn":155,"./_redefine-all":169,"./_set-to-string-tag":175,"./_to-integer":189,"./_to-length":191,"./_typed":196}],196:[function(require,module,exports){ +},{"./_an-instance":90,"./_array-fill":93,"./_descriptors":112,"./_fails":118,"./_global":122,"./_hide":124,"./_library":142,"./_object-dp":151,"./_object-gopn":156,"./_redefine-all":170,"./_set-to-string-tag":176,"./_to-integer":190,"./_to-length":192,"./_typed":197}],197:[function(require,module,exports){ var global = require('./_global') , hide = require('./_hide') , uid = require('./_uid') @@ -48459,13 +49062,13 @@ module.exports = { TYPED: TYPED, VIEW: VIEW }; -},{"./_global":121,"./_hide":123,"./_uid":197}],197:[function(require,module,exports){ +},{"./_global":122,"./_hide":124,"./_uid":198}],198:[function(require,module,exports){ var id = 0 , px = Math.random(); module.exports = function(key){ return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); }; -},{}],198:[function(require,module,exports){ +},{}],199:[function(require,module,exports){ var global = require('./_global') , core = require('./_core') , LIBRARY = require('./_library') @@ -48475,9 +49078,9 @@ module.exports = function(name){ var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); if(name.charAt(0) != '_' && !(name in $Symbol))defineProperty($Symbol, name, {value: wksExt.f(name)}); }; -},{"./_core":106,"./_global":121,"./_library":141,"./_object-dp":150,"./_wks-ext":199}],199:[function(require,module,exports){ +},{"./_core":107,"./_global":122,"./_library":142,"./_object-dp":151,"./_wks-ext":200}],200:[function(require,module,exports){ exports.f = require('./_wks'); -},{"./_wks":200}],200:[function(require,module,exports){ +},{"./_wks":201}],201:[function(require,module,exports){ var store = require('./_shared')('wks') , uid = require('./_uid') , Symbol = require('./_global').Symbol @@ -48489,7 +49092,7 @@ var $exports = module.exports = function(name){ }; $exports.store = store; -},{"./_global":121,"./_shared":177,"./_uid":197}],201:[function(require,module,exports){ +},{"./_global":122,"./_shared":178,"./_uid":198}],202:[function(require,module,exports){ var classof = require('./_classof') , ITERATOR = require('./_wks')('iterator') , Iterators = require('./_iterators'); @@ -48498,7 +49101,7 @@ module.exports = require('./_core').getIteratorMethod = function(it){ || it['@@iterator'] || Iterators[classof(it)]; }; -},{"./_classof":100,"./_core":106,"./_iterators":139,"./_wks":200}],202:[function(require,module,exports){ +},{"./_classof":101,"./_core":107,"./_iterators":140,"./_wks":201}],203:[function(require,module,exports){ var classof = require('./_classof') , ITERATOR = require('./_wks')('iterator') , Iterators = require('./_iterators'); @@ -48508,21 +49111,21 @@ module.exports = require('./_core').isIterable = function(it){ || '@@iterator' in O || Iterators.hasOwnProperty(classof(O)); }; -},{"./_classof":100,"./_core":106,"./_iterators":139,"./_wks":200}],203:[function(require,module,exports){ +},{"./_classof":101,"./_core":107,"./_iterators":140,"./_wks":201}],204:[function(require,module,exports){ // https://github.com/benjamingr/RexExp.escape var $export = require('./_export') , $re = require('./_replacer')(/[\\^$*+?.()|[\]{}]/g, '\\$&'); $export($export.S, 'RegExp', {escape: function escape(it){ return $re(it); }}); -},{"./_export":115,"./_replacer":171}],204:[function(require,module,exports){ +},{"./_export":116,"./_replacer":172}],205:[function(require,module,exports){ // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) var $export = require('./_export'); $export($export.P, 'Array', {copyWithin: require('./_array-copy-within')}); require('./_add-to-unscopables')('copyWithin'); -},{"./_add-to-unscopables":88,"./_array-copy-within":91,"./_export":115}],205:[function(require,module,exports){ +},{"./_add-to-unscopables":89,"./_array-copy-within":92,"./_export":116}],206:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $every = require('./_array-methods')(4); @@ -48533,14 +49136,14 @@ $export($export.P + $export.F * !require('./_strict-method')([].every, true), 'A return $every(this, callbackfn, arguments[1]); } }); -},{"./_array-methods":95,"./_export":115,"./_strict-method":179}],206:[function(require,module,exports){ +},{"./_array-methods":96,"./_export":116,"./_strict-method":180}],207:[function(require,module,exports){ // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) var $export = require('./_export'); $export($export.P, 'Array', {fill: require('./_array-fill')}); require('./_add-to-unscopables')('fill'); -},{"./_add-to-unscopables":88,"./_array-fill":92,"./_export":115}],207:[function(require,module,exports){ +},{"./_add-to-unscopables":89,"./_array-fill":93,"./_export":116}],208:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $filter = require('./_array-methods')(2); @@ -48551,7 +49154,7 @@ $export($export.P + $export.F * !require('./_strict-method')([].filter, true), ' return $filter(this, callbackfn, arguments[1]); } }); -},{"./_array-methods":95,"./_export":115,"./_strict-method":179}],208:[function(require,module,exports){ +},{"./_array-methods":96,"./_export":116,"./_strict-method":180}],209:[function(require,module,exports){ 'use strict'; // 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined) var $export = require('./_export') @@ -48566,7 +49169,7 @@ $export($export.P + $export.F * forced, 'Array', { } }); require('./_add-to-unscopables')(KEY); -},{"./_add-to-unscopables":88,"./_array-methods":95,"./_export":115}],209:[function(require,module,exports){ +},{"./_add-to-unscopables":89,"./_array-methods":96,"./_export":116}],210:[function(require,module,exports){ 'use strict'; // 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined) var $export = require('./_export') @@ -48581,7 +49184,7 @@ $export($export.P + $export.F * forced, 'Array', { } }); require('./_add-to-unscopables')(KEY); -},{"./_add-to-unscopables":88,"./_array-methods":95,"./_export":115}],210:[function(require,module,exports){ +},{"./_add-to-unscopables":89,"./_array-methods":96,"./_export":116}],211:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $forEach = require('./_array-methods')(0) @@ -48593,7 +49196,7 @@ $export($export.P + $export.F * !STRICT, 'Array', { return $forEach(this, callbackfn, arguments[1]); } }); -},{"./_array-methods":95,"./_export":115,"./_strict-method":179}],211:[function(require,module,exports){ +},{"./_array-methods":96,"./_export":116,"./_strict-method":180}],212:[function(require,module,exports){ 'use strict'; var ctx = require('./_ctx') , $export = require('./_export') @@ -48632,7 +49235,7 @@ $export($export.S + $export.F * !require('./_iter-detect')(function(iter){ Array } }); -},{"./_create-property":107,"./_ctx":108,"./_export":115,"./_is-array-iter":129,"./_iter-call":134,"./_iter-detect":137,"./_to-length":191,"./_to-object":192,"./core.get-iterator-method":201}],212:[function(require,module,exports){ +},{"./_create-property":108,"./_ctx":109,"./_export":116,"./_is-array-iter":130,"./_iter-call":135,"./_iter-detect":138,"./_to-length":192,"./_to-object":193,"./core.get-iterator-method":202}],213:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $indexOf = require('./_array-includes')(false) @@ -48648,12 +49251,12 @@ $export($export.P + $export.F * (NEGATIVE_ZERO || !require('./_strict-method')($ : $indexOf(this, searchElement, arguments[1]); } }); -},{"./_array-includes":94,"./_export":115,"./_strict-method":179}],213:[function(require,module,exports){ +},{"./_array-includes":95,"./_export":116,"./_strict-method":180}],214:[function(require,module,exports){ // 22.1.2.2 / 15.4.3.2 Array.isArray(arg) var $export = require('./_export'); $export($export.S, 'Array', {isArray: require('./_is-array')}); -},{"./_export":115,"./_is-array":130}],214:[function(require,module,exports){ +},{"./_export":116,"./_is-array":131}],215:[function(require,module,exports){ 'use strict'; var addToUnscopables = require('./_add-to-unscopables') , step = require('./_iter-step') @@ -48688,7 +49291,7 @@ Iterators.Arguments = Iterators.Array; addToUnscopables('keys'); addToUnscopables('values'); addToUnscopables('entries'); -},{"./_add-to-unscopables":88,"./_iter-define":136,"./_iter-step":138,"./_iterators":139,"./_to-iobject":190}],215:[function(require,module,exports){ +},{"./_add-to-unscopables":89,"./_iter-define":137,"./_iter-step":139,"./_iterators":140,"./_to-iobject":191}],216:[function(require,module,exports){ 'use strict'; // 22.1.3.13 Array.prototype.join(separator) var $export = require('./_export') @@ -48701,7 +49304,7 @@ $export($export.P + $export.F * (require('./_iobject') != Object || !require('./ return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator); } }); -},{"./_export":115,"./_iobject":128,"./_strict-method":179,"./_to-iobject":190}],216:[function(require,module,exports){ +},{"./_export":116,"./_iobject":129,"./_strict-method":180,"./_to-iobject":191}],217:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , toIObject = require('./_to-iobject') @@ -48724,7 +49327,7 @@ $export($export.P + $export.F * (NEGATIVE_ZERO || !require('./_strict-method')($ return -1; } }); -},{"./_export":115,"./_strict-method":179,"./_to-integer":189,"./_to-iobject":190,"./_to-length":191}],217:[function(require,module,exports){ +},{"./_export":116,"./_strict-method":180,"./_to-integer":190,"./_to-iobject":191,"./_to-length":192}],218:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $map = require('./_array-methods')(1); @@ -48735,7 +49338,7 @@ $export($export.P + $export.F * !require('./_strict-method')([].map, true), 'Arr return $map(this, callbackfn, arguments[1]); } }); -},{"./_array-methods":95,"./_export":115,"./_strict-method":179}],218:[function(require,module,exports){ +},{"./_array-methods":96,"./_export":116,"./_strict-method":180}],219:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , createProperty = require('./_create-property'); @@ -48755,7 +49358,7 @@ $export($export.S + $export.F * require('./_fails')(function(){ return result; } }); -},{"./_create-property":107,"./_export":115,"./_fails":117}],219:[function(require,module,exports){ +},{"./_create-property":108,"./_export":116,"./_fails":118}],220:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $reduce = require('./_array-reduce'); @@ -48766,7 +49369,7 @@ $export($export.P + $export.F * !require('./_strict-method')([].reduceRight, tru return $reduce(this, callbackfn, arguments.length, arguments[1], true); } }); -},{"./_array-reduce":96,"./_export":115,"./_strict-method":179}],220:[function(require,module,exports){ +},{"./_array-reduce":97,"./_export":116,"./_strict-method":180}],221:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $reduce = require('./_array-reduce'); @@ -48777,7 +49380,7 @@ $export($export.P + $export.F * !require('./_strict-method')([].reduce, true), ' return $reduce(this, callbackfn, arguments.length, arguments[1], false); } }); -},{"./_array-reduce":96,"./_export":115,"./_strict-method":179}],221:[function(require,module,exports){ +},{"./_array-reduce":97,"./_export":116,"./_strict-method":180}],222:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , html = require('./_html') @@ -48806,7 +49409,7 @@ $export($export.P + $export.F * require('./_fails')(function(){ return cloned; } }); -},{"./_cof":101,"./_export":115,"./_fails":117,"./_html":124,"./_to-index":188,"./_to-length":191}],222:[function(require,module,exports){ +},{"./_cof":102,"./_export":116,"./_fails":118,"./_html":125,"./_to-index":189,"./_to-length":192}],223:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $some = require('./_array-methods')(3); @@ -48817,7 +49420,7 @@ $export($export.P + $export.F * !require('./_strict-method')([].some, true), 'Ar return $some(this, callbackfn, arguments[1]); } }); -},{"./_array-methods":95,"./_export":115,"./_strict-method":179}],223:[function(require,module,exports){ +},{"./_array-methods":96,"./_export":116,"./_strict-method":180}],224:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , aFunction = require('./_a-function') @@ -48841,14 +49444,14 @@ $export($export.P + $export.F * (fails(function(){ : $sort.call(toObject(this), aFunction(comparefn)); } }); -},{"./_a-function":86,"./_export":115,"./_fails":117,"./_strict-method":179,"./_to-object":192}],224:[function(require,module,exports){ +},{"./_a-function":87,"./_export":116,"./_fails":118,"./_strict-method":180,"./_to-object":193}],225:[function(require,module,exports){ require('./_set-species')('Array'); -},{"./_set-species":174}],225:[function(require,module,exports){ +},{"./_set-species":175}],226:[function(require,module,exports){ // 20.3.3.1 / 15.9.4.4 Date.now() var $export = require('./_export'); $export($export.S, 'Date', {now: function(){ return new Date().getTime(); }}); -},{"./_export":115}],226:[function(require,module,exports){ +},{"./_export":116}],227:[function(require,module,exports){ 'use strict'; // 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() var $export = require('./_export') @@ -48877,7 +49480,7 @@ $export($export.P + $export.F * (fails(function(){ ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z'; } }); -},{"./_export":115,"./_fails":117}],227:[function(require,module,exports){ +},{"./_export":116,"./_fails":118}],228:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , toObject = require('./_to-object') @@ -48892,12 +49495,12 @@ $export($export.P + $export.F * require('./_fails')(function(){ return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString(); } }); -},{"./_export":115,"./_fails":117,"./_to-object":192,"./_to-primitive":193}],228:[function(require,module,exports){ +},{"./_export":116,"./_fails":118,"./_to-object":193,"./_to-primitive":194}],229:[function(require,module,exports){ var TO_PRIMITIVE = require('./_wks')('toPrimitive') , proto = Date.prototype; if(!(TO_PRIMITIVE in proto))require('./_hide')(proto, TO_PRIMITIVE, require('./_date-to-primitive')); -},{"./_date-to-primitive":109,"./_hide":123,"./_wks":200}],229:[function(require,module,exports){ +},{"./_date-to-primitive":110,"./_hide":124,"./_wks":201}],230:[function(require,module,exports){ var DateProto = Date.prototype , INVALID_DATE = 'Invalid Date' , TO_STRING = 'toString' @@ -48909,12 +49512,12 @@ if(new Date(NaN) + '' != INVALID_DATE){ return value === value ? $toString.call(this) : INVALID_DATE; }); } -},{"./_redefine":170}],230:[function(require,module,exports){ +},{"./_redefine":171}],231:[function(require,module,exports){ // 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...) var $export = require('./_export'); $export($export.P, 'Function', {bind: require('./_bind')}); -},{"./_bind":99,"./_export":115}],231:[function(require,module,exports){ +},{"./_bind":100,"./_export":116}],232:[function(require,module,exports){ 'use strict'; var isObject = require('./_is-object') , getPrototypeOf = require('./_object-gpo') @@ -48928,7 +49531,7 @@ if(!(HAS_INSTANCE in FunctionProto))require('./_object-dp').f(FunctionProto, HAS while(O = getPrototypeOf(O))if(this.prototype === O)return true; return false; }}); -},{"./_is-object":132,"./_object-dp":150,"./_object-gpo":157,"./_wks":200}],232:[function(require,module,exports){ +},{"./_is-object":133,"./_object-dp":151,"./_object-gpo":158,"./_wks":201}],233:[function(require,module,exports){ var dP = require('./_object-dp').f , createDesc = require('./_property-desc') , has = require('./_has') @@ -48954,7 +49557,7 @@ NAME in FProto || require('./_descriptors') && dP(FProto, NAME, { } } }); -},{"./_descriptors":111,"./_has":122,"./_object-dp":150,"./_property-desc":168}],233:[function(require,module,exports){ +},{"./_descriptors":112,"./_has":123,"./_object-dp":151,"./_property-desc":169}],234:[function(require,module,exports){ 'use strict'; var strong = require('./_collection-strong'); @@ -48972,7 +49575,7 @@ module.exports = require('./_collection')('Map', function(get){ return strong.def(this, key === 0 ? 0 : key, value); } }, strong, true); -},{"./_collection":105,"./_collection-strong":102}],234:[function(require,module,exports){ +},{"./_collection":106,"./_collection-strong":103}],235:[function(require,module,exports){ // 20.2.2.3 Math.acosh(x) var $export = require('./_export') , log1p = require('./_math-log1p') @@ -48991,7 +49594,7 @@ $export($export.S + $export.F * !($acosh : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1)); } }); -},{"./_export":115,"./_math-log1p":143}],235:[function(require,module,exports){ +},{"./_export":116,"./_math-log1p":144}],236:[function(require,module,exports){ // 20.2.2.5 Math.asinh(x) var $export = require('./_export') , $asinh = Math.asinh; @@ -49002,7 +49605,7 @@ function asinh(x){ // Tor Browser bug: Math.asinh(0) -> -0 $export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', {asinh: asinh}); -},{"./_export":115}],236:[function(require,module,exports){ +},{"./_export":116}],237:[function(require,module,exports){ // 20.2.2.7 Math.atanh(x) var $export = require('./_export') , $atanh = Math.atanh; @@ -49013,7 +49616,7 @@ $export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', { return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2; } }); -},{"./_export":115}],237:[function(require,module,exports){ +},{"./_export":116}],238:[function(require,module,exports){ // 20.2.2.9 Math.cbrt(x) var $export = require('./_export') , sign = require('./_math-sign'); @@ -49023,7 +49626,7 @@ $export($export.S, 'Math', { return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3); } }); -},{"./_export":115,"./_math-sign":144}],238:[function(require,module,exports){ +},{"./_export":116,"./_math-sign":145}],239:[function(require,module,exports){ // 20.2.2.11 Math.clz32(x) var $export = require('./_export'); @@ -49032,7 +49635,7 @@ $export($export.S, 'Math', { return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32; } }); -},{"./_export":115}],239:[function(require,module,exports){ +},{"./_export":116}],240:[function(require,module,exports){ // 20.2.2.12 Math.cosh(x) var $export = require('./_export') , exp = Math.exp; @@ -49042,13 +49645,13 @@ $export($export.S, 'Math', { return (exp(x = +x) + exp(-x)) / 2; } }); -},{"./_export":115}],240:[function(require,module,exports){ +},{"./_export":116}],241:[function(require,module,exports){ // 20.2.2.14 Math.expm1(x) var $export = require('./_export') , $expm1 = require('./_math-expm1'); $export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', {expm1: $expm1}); -},{"./_export":115,"./_math-expm1":142}],241:[function(require,module,exports){ +},{"./_export":116,"./_math-expm1":143}],242:[function(require,module,exports){ // 20.2.2.16 Math.fround(x) var $export = require('./_export') , sign = require('./_math-sign') @@ -49075,7 +49678,7 @@ $export($export.S, 'Math', { return $sign * result; } }); -},{"./_export":115,"./_math-sign":144}],242:[function(require,module,exports){ +},{"./_export":116,"./_math-sign":145}],243:[function(require,module,exports){ // 20.2.2.17 Math.hypot([value1[, value2[, … ]]]) var $export = require('./_export') , abs = Math.abs; @@ -49101,7 +49704,7 @@ $export($export.S, 'Math', { return larg === Infinity ? Infinity : larg * Math.sqrt(sum); } }); -},{"./_export":115}],243:[function(require,module,exports){ +},{"./_export":116}],244:[function(require,module,exports){ // 20.2.2.18 Math.imul(x, y) var $export = require('./_export') , $imul = Math.imul; @@ -49119,7 +49722,7 @@ $export($export.S + $export.F * require('./_fails')(function(){ return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0); } }); -},{"./_export":115,"./_fails":117}],244:[function(require,module,exports){ +},{"./_export":116,"./_fails":118}],245:[function(require,module,exports){ // 20.2.2.21 Math.log10(x) var $export = require('./_export'); @@ -49128,12 +49731,12 @@ $export($export.S, 'Math', { return Math.log(x) / Math.LN10; } }); -},{"./_export":115}],245:[function(require,module,exports){ +},{"./_export":116}],246:[function(require,module,exports){ // 20.2.2.20 Math.log1p(x) var $export = require('./_export'); $export($export.S, 'Math', {log1p: require('./_math-log1p')}); -},{"./_export":115,"./_math-log1p":143}],246:[function(require,module,exports){ +},{"./_export":116,"./_math-log1p":144}],247:[function(require,module,exports){ // 20.2.2.22 Math.log2(x) var $export = require('./_export'); @@ -49142,12 +49745,12 @@ $export($export.S, 'Math', { return Math.log(x) / Math.LN2; } }); -},{"./_export":115}],247:[function(require,module,exports){ +},{"./_export":116}],248:[function(require,module,exports){ // 20.2.2.28 Math.sign(x) var $export = require('./_export'); $export($export.S, 'Math', {sign: require('./_math-sign')}); -},{"./_export":115,"./_math-sign":144}],248:[function(require,module,exports){ +},{"./_export":116,"./_math-sign":145}],249:[function(require,module,exports){ // 20.2.2.30 Math.sinh(x) var $export = require('./_export') , expm1 = require('./_math-expm1') @@ -49163,7 +49766,7 @@ $export($export.S + $export.F * require('./_fails')(function(){ : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2); } }); -},{"./_export":115,"./_fails":117,"./_math-expm1":142}],249:[function(require,module,exports){ +},{"./_export":116,"./_fails":118,"./_math-expm1":143}],250:[function(require,module,exports){ // 20.2.2.33 Math.tanh(x) var $export = require('./_export') , expm1 = require('./_math-expm1') @@ -49176,7 +49779,7 @@ $export($export.S, 'Math', { return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x)); } }); -},{"./_export":115,"./_math-expm1":142}],250:[function(require,module,exports){ +},{"./_export":116,"./_math-expm1":143}],251:[function(require,module,exports){ // 20.2.2.34 Math.trunc(x) var $export = require('./_export'); @@ -49185,7 +49788,7 @@ $export($export.S, 'Math', { return (it > 0 ? Math.floor : Math.ceil)(it); } }); -},{"./_export":115}],251:[function(require,module,exports){ +},{"./_export":116}],252:[function(require,module,exports){ 'use strict'; var global = require('./_global') , has = require('./_has') @@ -49255,12 +49858,12 @@ if(!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')){ proto.constructor = $Number; require('./_redefine')(global, NUMBER, $Number); } -},{"./_cof":101,"./_descriptors":111,"./_fails":117,"./_global":121,"./_has":122,"./_inherit-if-required":126,"./_object-create":149,"./_object-dp":150,"./_object-gopd":153,"./_object-gopn":155,"./_redefine":170,"./_string-trim":185,"./_to-primitive":193}],252:[function(require,module,exports){ +},{"./_cof":102,"./_descriptors":112,"./_fails":118,"./_global":122,"./_has":123,"./_inherit-if-required":127,"./_object-create":150,"./_object-dp":151,"./_object-gopd":154,"./_object-gopn":156,"./_redefine":171,"./_string-trim":186,"./_to-primitive":194}],253:[function(require,module,exports){ // 20.1.2.1 Number.EPSILON var $export = require('./_export'); $export($export.S, 'Number', {EPSILON: Math.pow(2, -52)}); -},{"./_export":115}],253:[function(require,module,exports){ +},{"./_export":116}],254:[function(require,module,exports){ // 20.1.2.2 Number.isFinite(number) var $export = require('./_export') , _isFinite = require('./_global').isFinite; @@ -49270,12 +49873,12 @@ $export($export.S, 'Number', { return typeof it == 'number' && _isFinite(it); } }); -},{"./_export":115,"./_global":121}],254:[function(require,module,exports){ +},{"./_export":116,"./_global":122}],255:[function(require,module,exports){ // 20.1.2.3 Number.isInteger(number) var $export = require('./_export'); $export($export.S, 'Number', {isInteger: require('./_is-integer')}); -},{"./_export":115,"./_is-integer":131}],255:[function(require,module,exports){ +},{"./_export":116,"./_is-integer":132}],256:[function(require,module,exports){ // 20.1.2.4 Number.isNaN(number) var $export = require('./_export'); @@ -49284,7 +49887,7 @@ $export($export.S, 'Number', { return number != number; } }); -},{"./_export":115}],256:[function(require,module,exports){ +},{"./_export":116}],257:[function(require,module,exports){ // 20.1.2.5 Number.isSafeInteger(number) var $export = require('./_export') , isInteger = require('./_is-integer') @@ -49295,27 +49898,27 @@ $export($export.S, 'Number', { return isInteger(number) && abs(number) <= 0x1fffffffffffff; } }); -},{"./_export":115,"./_is-integer":131}],257:[function(require,module,exports){ +},{"./_export":116,"./_is-integer":132}],258:[function(require,module,exports){ // 20.1.2.6 Number.MAX_SAFE_INTEGER var $export = require('./_export'); $export($export.S, 'Number', {MAX_SAFE_INTEGER: 0x1fffffffffffff}); -},{"./_export":115}],258:[function(require,module,exports){ +},{"./_export":116}],259:[function(require,module,exports){ // 20.1.2.10 Number.MIN_SAFE_INTEGER var $export = require('./_export'); $export($export.S, 'Number', {MIN_SAFE_INTEGER: -0x1fffffffffffff}); -},{"./_export":115}],259:[function(require,module,exports){ +},{"./_export":116}],260:[function(require,module,exports){ var $export = require('./_export') , $parseFloat = require('./_parse-float'); // 20.1.2.12 Number.parseFloat(string) $export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', {parseFloat: $parseFloat}); -},{"./_export":115,"./_parse-float":164}],260:[function(require,module,exports){ +},{"./_export":116,"./_parse-float":165}],261:[function(require,module,exports){ var $export = require('./_export') , $parseInt = require('./_parse-int'); // 20.1.2.13 Number.parseInt(string, radix) $export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', {parseInt: $parseInt}); -},{"./_export":115,"./_parse-int":165}],261:[function(require,module,exports){ +},{"./_export":116,"./_parse-int":166}],262:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , anInstance = require('./_an-instance') @@ -49430,7 +50033,7 @@ $export($export.P + $export.F * (!!$toFixed && ( } return m; } }); -},{"./_a-number-value":87,"./_an-instance":89,"./_export":115,"./_fails":117,"./_string-repeat":184,"./_to-integer":189}],262:[function(require,module,exports){ +},{"./_a-number-value":88,"./_an-instance":90,"./_export":116,"./_fails":118,"./_string-repeat":185,"./_to-integer":190}],263:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $fails = require('./_fails') @@ -49449,24 +50052,24 @@ $export($export.P + $export.F * ($fails(function(){ return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision); } }); -},{"./_a-number-value":87,"./_export":115,"./_fails":117}],263:[function(require,module,exports){ +},{"./_a-number-value":88,"./_export":116,"./_fails":118}],264:[function(require,module,exports){ // 19.1.3.1 Object.assign(target, source) var $export = require('./_export'); $export($export.S + $export.F, 'Object', {assign: require('./_object-assign')}); -},{"./_export":115,"./_object-assign":148}],264:[function(require,module,exports){ +},{"./_export":116,"./_object-assign":149}],265:[function(require,module,exports){ var $export = require('./_export') // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) $export($export.S, 'Object', {create: require('./_object-create')}); -},{"./_export":115,"./_object-create":149}],265:[function(require,module,exports){ +},{"./_export":116,"./_object-create":150}],266:[function(require,module,exports){ var $export = require('./_export'); // 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) $export($export.S + $export.F * !require('./_descriptors'), 'Object', {defineProperties: require('./_object-dps')}); -},{"./_descriptors":111,"./_export":115,"./_object-dps":151}],266:[function(require,module,exports){ +},{"./_descriptors":112,"./_export":116,"./_object-dps":152}],267:[function(require,module,exports){ var $export = require('./_export'); // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) $export($export.S + $export.F * !require('./_descriptors'), 'Object', {defineProperty: require('./_object-dp').f}); -},{"./_descriptors":111,"./_export":115,"./_object-dp":150}],267:[function(require,module,exports){ +},{"./_descriptors":112,"./_export":116,"./_object-dp":151}],268:[function(require,module,exports){ // 19.1.2.5 Object.freeze(O) var isObject = require('./_is-object') , meta = require('./_meta').onFreeze; @@ -49476,7 +50079,7 @@ require('./_object-sap')('freeze', function($freeze){ return $freeze && isObject(it) ? $freeze(meta(it)) : it; }; }); -},{"./_is-object":132,"./_meta":145,"./_object-sap":161}],268:[function(require,module,exports){ +},{"./_is-object":133,"./_meta":146,"./_object-sap":162}],269:[function(require,module,exports){ // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) var toIObject = require('./_to-iobject') , $getOwnPropertyDescriptor = require('./_object-gopd').f; @@ -49486,12 +50089,12 @@ require('./_object-sap')('getOwnPropertyDescriptor', function(){ return $getOwnPropertyDescriptor(toIObject(it), key); }; }); -},{"./_object-gopd":153,"./_object-sap":161,"./_to-iobject":190}],269:[function(require,module,exports){ +},{"./_object-gopd":154,"./_object-sap":162,"./_to-iobject":191}],270:[function(require,module,exports){ // 19.1.2.7 Object.getOwnPropertyNames(O) require('./_object-sap')('getOwnPropertyNames', function(){ return require('./_object-gopn-ext').f; }); -},{"./_object-gopn-ext":154,"./_object-sap":161}],270:[function(require,module,exports){ +},{"./_object-gopn-ext":155,"./_object-sap":162}],271:[function(require,module,exports){ // 19.1.2.9 Object.getPrototypeOf(O) var toObject = require('./_to-object') , $getPrototypeOf = require('./_object-gpo'); @@ -49501,7 +50104,7 @@ require('./_object-sap')('getPrototypeOf', function(){ return $getPrototypeOf(toObject(it)); }; }); -},{"./_object-gpo":157,"./_object-sap":161,"./_to-object":192}],271:[function(require,module,exports){ +},{"./_object-gpo":158,"./_object-sap":162,"./_to-object":193}],272:[function(require,module,exports){ // 19.1.2.11 Object.isExtensible(O) var isObject = require('./_is-object'); @@ -49510,7 +50113,7 @@ require('./_object-sap')('isExtensible', function($isExtensible){ return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false; }; }); -},{"./_is-object":132,"./_object-sap":161}],272:[function(require,module,exports){ +},{"./_is-object":133,"./_object-sap":162}],273:[function(require,module,exports){ // 19.1.2.12 Object.isFrozen(O) var isObject = require('./_is-object'); @@ -49519,7 +50122,7 @@ require('./_object-sap')('isFrozen', function($isFrozen){ return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true; }; }); -},{"./_is-object":132,"./_object-sap":161}],273:[function(require,module,exports){ +},{"./_is-object":133,"./_object-sap":162}],274:[function(require,module,exports){ // 19.1.2.13 Object.isSealed(O) var isObject = require('./_is-object'); @@ -49528,11 +50131,11 @@ require('./_object-sap')('isSealed', function($isSealed){ return isObject(it) ? $isSealed ? $isSealed(it) : false : true; }; }); -},{"./_is-object":132,"./_object-sap":161}],274:[function(require,module,exports){ +},{"./_is-object":133,"./_object-sap":162}],275:[function(require,module,exports){ // 19.1.3.10 Object.is(value1, value2) var $export = require('./_export'); $export($export.S, 'Object', {is: require('./_same-value')}); -},{"./_export":115,"./_same-value":172}],275:[function(require,module,exports){ +},{"./_export":116,"./_same-value":173}],276:[function(require,module,exports){ // 19.1.2.14 Object.keys(O) var toObject = require('./_to-object') , $keys = require('./_object-keys'); @@ -49542,7 +50145,7 @@ require('./_object-sap')('keys', function(){ return $keys(toObject(it)); }; }); -},{"./_object-keys":159,"./_object-sap":161,"./_to-object":192}],276:[function(require,module,exports){ +},{"./_object-keys":160,"./_object-sap":162,"./_to-object":193}],277:[function(require,module,exports){ // 19.1.2.15 Object.preventExtensions(O) var isObject = require('./_is-object') , meta = require('./_meta').onFreeze; @@ -49552,7 +50155,7 @@ require('./_object-sap')('preventExtensions', function($preventExtensions){ return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it; }; }); -},{"./_is-object":132,"./_meta":145,"./_object-sap":161}],277:[function(require,module,exports){ +},{"./_is-object":133,"./_meta":146,"./_object-sap":162}],278:[function(require,module,exports){ // 19.1.2.17 Object.seal(O) var isObject = require('./_is-object') , meta = require('./_meta').onFreeze; @@ -49562,11 +50165,11 @@ require('./_object-sap')('seal', function($seal){ return $seal && isObject(it) ? $seal(meta(it)) : it; }; }); -},{"./_is-object":132,"./_meta":145,"./_object-sap":161}],278:[function(require,module,exports){ +},{"./_is-object":133,"./_meta":146,"./_object-sap":162}],279:[function(require,module,exports){ // 19.1.3.19 Object.setPrototypeOf(O, proto) var $export = require('./_export'); $export($export.S, 'Object', {setPrototypeOf: require('./_set-proto').set}); -},{"./_export":115,"./_set-proto":173}],279:[function(require,module,exports){ +},{"./_export":116,"./_set-proto":174}],280:[function(require,module,exports){ 'use strict'; // 19.1.3.6 Object.prototype.toString() var classof = require('./_classof') @@ -49577,17 +50180,17 @@ if(test + '' != '[object z]'){ return '[object ' + classof(this) + ']'; }, true); } -},{"./_classof":100,"./_redefine":170,"./_wks":200}],280:[function(require,module,exports){ +},{"./_classof":101,"./_redefine":171,"./_wks":201}],281:[function(require,module,exports){ var $export = require('./_export') , $parseFloat = require('./_parse-float'); // 18.2.4 parseFloat(string) $export($export.G + $export.F * (parseFloat != $parseFloat), {parseFloat: $parseFloat}); -},{"./_export":115,"./_parse-float":164}],281:[function(require,module,exports){ +},{"./_export":116,"./_parse-float":165}],282:[function(require,module,exports){ var $export = require('./_export') , $parseInt = require('./_parse-int'); // 18.2.5 parseInt(string, radix) $export($export.G + $export.F * (parseInt != $parseInt), {parseInt: $parseInt}); -},{"./_export":115,"./_parse-int":165}],282:[function(require,module,exports){ +},{"./_export":116,"./_parse-int":166}],283:[function(require,module,exports){ 'use strict'; var LIBRARY = require('./_library') , global = require('./_global') @@ -49889,7 +50492,7 @@ $export($export.S + $export.F * !(USE_NATIVE && require('./_iter-detect')(functi return capability.promise; } }); -},{"./_a-function":86,"./_an-instance":89,"./_an-object":90,"./_classof":100,"./_core":106,"./_ctx":108,"./_export":115,"./_for-of":120,"./_global":121,"./_is-object":132,"./_iter-detect":137,"./_library":141,"./_microtask":147,"./_redefine-all":169,"./_set-proto":173,"./_set-species":174,"./_set-to-string-tag":175,"./_species-constructor":178,"./_task":187,"./_wks":200}],283:[function(require,module,exports){ +},{"./_a-function":87,"./_an-instance":90,"./_an-object":91,"./_classof":101,"./_core":107,"./_ctx":109,"./_export":116,"./_for-of":121,"./_global":122,"./_is-object":133,"./_iter-detect":138,"./_library":142,"./_microtask":148,"./_redefine-all":170,"./_set-proto":174,"./_set-species":175,"./_set-to-string-tag":176,"./_species-constructor":179,"./_task":188,"./_wks":201}],284:[function(require,module,exports){ // 26.1.1 Reflect.apply(target, thisArgument, argumentsList) var $export = require('./_export') , aFunction = require('./_a-function') @@ -49901,7 +50504,7 @@ $export($export.S, 'Reflect', { return _apply.call(aFunction(target), thisArgument, anObject(argumentsList)); } }); -},{"./_a-function":86,"./_an-object":90,"./_export":115}],284:[function(require,module,exports){ +},{"./_a-function":87,"./_an-object":91,"./_export":116}],285:[function(require,module,exports){ // 26.1.2 Reflect.construct(target, argumentsList [, newTarget]) var $export = require('./_export') , create = require('./_object-create') @@ -49941,7 +50544,7 @@ $export($export.S + $export.F * require('./_fails')(function(){ return isObject(result) ? result : instance; } }); -},{"./_a-function":86,"./_an-object":90,"./_bind":99,"./_export":115,"./_fails":117,"./_is-object":132,"./_object-create":149}],285:[function(require,module,exports){ +},{"./_a-function":87,"./_an-object":91,"./_bind":100,"./_export":116,"./_fails":118,"./_is-object":133,"./_object-create":150}],286:[function(require,module,exports){ // 26.1.3 Reflect.defineProperty(target, propertyKey, attributes) var dP = require('./_object-dp') , $export = require('./_export') @@ -49964,7 +50567,7 @@ $export($export.S + $export.F * require('./_fails')(function(){ } } }); -},{"./_an-object":90,"./_export":115,"./_fails":117,"./_object-dp":150,"./_to-primitive":193}],286:[function(require,module,exports){ +},{"./_an-object":91,"./_export":116,"./_fails":118,"./_object-dp":151,"./_to-primitive":194}],287:[function(require,module,exports){ // 26.1.4 Reflect.deleteProperty(target, propertyKey) var $export = require('./_export') , gOPD = require('./_object-gopd').f @@ -49976,7 +50579,7 @@ $export($export.S, 'Reflect', { return desc && !desc.configurable ? false : delete target[propertyKey]; } }); -},{"./_an-object":90,"./_export":115,"./_object-gopd":153}],287:[function(require,module,exports){ +},{"./_an-object":91,"./_export":116,"./_object-gopd":154}],288:[function(require,module,exports){ 'use strict'; // 26.1.5 Reflect.enumerate(target) var $export = require('./_export') @@ -50003,7 +50606,7 @@ $export($export.S, 'Reflect', { return new Enumerate(target); } }); -},{"./_an-object":90,"./_export":115,"./_iter-create":135}],288:[function(require,module,exports){ +},{"./_an-object":91,"./_export":116,"./_iter-create":136}],289:[function(require,module,exports){ // 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey) var gOPD = require('./_object-gopd') , $export = require('./_export') @@ -50014,7 +50617,7 @@ $export($export.S, 'Reflect', { return gOPD.f(anObject(target), propertyKey); } }); -},{"./_an-object":90,"./_export":115,"./_object-gopd":153}],289:[function(require,module,exports){ +},{"./_an-object":91,"./_export":116,"./_object-gopd":154}],290:[function(require,module,exports){ // 26.1.8 Reflect.getPrototypeOf(target) var $export = require('./_export') , getProto = require('./_object-gpo') @@ -50025,7 +50628,7 @@ $export($export.S, 'Reflect', { return getProto(anObject(target)); } }); -},{"./_an-object":90,"./_export":115,"./_object-gpo":157}],290:[function(require,module,exports){ +},{"./_an-object":91,"./_export":116,"./_object-gpo":158}],291:[function(require,module,exports){ // 26.1.6 Reflect.get(target, propertyKey [, receiver]) var gOPD = require('./_object-gopd') , getPrototypeOf = require('./_object-gpo') @@ -50047,7 +50650,7 @@ function get(target, propertyKey/*, receiver*/){ } $export($export.S, 'Reflect', {get: get}); -},{"./_an-object":90,"./_export":115,"./_has":122,"./_is-object":132,"./_object-gopd":153,"./_object-gpo":157}],291:[function(require,module,exports){ +},{"./_an-object":91,"./_export":116,"./_has":123,"./_is-object":133,"./_object-gopd":154,"./_object-gpo":158}],292:[function(require,module,exports){ // 26.1.9 Reflect.has(target, propertyKey) var $export = require('./_export'); @@ -50056,7 +50659,7 @@ $export($export.S, 'Reflect', { return propertyKey in target; } }); -},{"./_export":115}],292:[function(require,module,exports){ +},{"./_export":116}],293:[function(require,module,exports){ // 26.1.10 Reflect.isExtensible(target) var $export = require('./_export') , anObject = require('./_an-object') @@ -50068,12 +50671,12 @@ $export($export.S, 'Reflect', { return $isExtensible ? $isExtensible(target) : true; } }); -},{"./_an-object":90,"./_export":115}],293:[function(require,module,exports){ +},{"./_an-object":91,"./_export":116}],294:[function(require,module,exports){ // 26.1.11 Reflect.ownKeys(target) var $export = require('./_export'); $export($export.S, 'Reflect', {ownKeys: require('./_own-keys')}); -},{"./_export":115,"./_own-keys":163}],294:[function(require,module,exports){ +},{"./_export":116,"./_own-keys":164}],295:[function(require,module,exports){ // 26.1.12 Reflect.preventExtensions(target) var $export = require('./_export') , anObject = require('./_an-object') @@ -50090,7 +50693,7 @@ $export($export.S, 'Reflect', { } } }); -},{"./_an-object":90,"./_export":115}],295:[function(require,module,exports){ +},{"./_an-object":91,"./_export":116}],296:[function(require,module,exports){ // 26.1.14 Reflect.setPrototypeOf(target, proto) var $export = require('./_export') , setProto = require('./_set-proto'); @@ -50106,7 +50709,7 @@ if(setProto)$export($export.S, 'Reflect', { } } }); -},{"./_export":115,"./_set-proto":173}],296:[function(require,module,exports){ +},{"./_export":116,"./_set-proto":174}],297:[function(require,module,exports){ // 26.1.13 Reflect.set(target, propertyKey, V [, receiver]) var dP = require('./_object-dp') , gOPD = require('./_object-gopd') @@ -50138,7 +50741,7 @@ function set(target, propertyKey, V/*, receiver*/){ } $export($export.S, 'Reflect', {set: set}); -},{"./_an-object":90,"./_export":115,"./_has":122,"./_is-object":132,"./_object-dp":150,"./_object-gopd":153,"./_object-gpo":157,"./_property-desc":168}],297:[function(require,module,exports){ +},{"./_an-object":91,"./_export":116,"./_has":123,"./_is-object":133,"./_object-dp":151,"./_object-gopd":154,"./_object-gpo":158,"./_property-desc":169}],298:[function(require,module,exports){ var global = require('./_global') , inheritIfRequired = require('./_inherit-if-required') , dP = require('./_object-dp').f @@ -50182,13 +50785,13 @@ if(require('./_descriptors') && (!CORRECT_NEW || require('./_fails')(function(){ } require('./_set-species')('RegExp'); -},{"./_descriptors":111,"./_fails":117,"./_flags":119,"./_global":121,"./_inherit-if-required":126,"./_is-regexp":133,"./_object-dp":150,"./_object-gopn":155,"./_redefine":170,"./_set-species":174,"./_wks":200}],298:[function(require,module,exports){ +},{"./_descriptors":112,"./_fails":118,"./_flags":120,"./_global":122,"./_inherit-if-required":127,"./_is-regexp":134,"./_object-dp":151,"./_object-gopn":156,"./_redefine":171,"./_set-species":175,"./_wks":201}],299:[function(require,module,exports){ // 21.2.5.3 get RegExp.prototype.flags() if(require('./_descriptors') && /./g.flags != 'g')require('./_object-dp').f(RegExp.prototype, 'flags', { configurable: true, get: require('./_flags') }); -},{"./_descriptors":111,"./_flags":119,"./_object-dp":150}],299:[function(require,module,exports){ +},{"./_descriptors":112,"./_flags":120,"./_object-dp":151}],300:[function(require,module,exports){ // @@match logic require('./_fix-re-wks')('match', 1, function(defined, MATCH, $match){ // 21.1.3.11 String.prototype.match(regexp) @@ -50199,7 +50802,7 @@ require('./_fix-re-wks')('match', 1, function(defined, MATCH, $match){ return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O)); }, $match]; }); -},{"./_fix-re-wks":118}],300:[function(require,module,exports){ +},{"./_fix-re-wks":119}],301:[function(require,module,exports){ // @@replace logic require('./_fix-re-wks')('replace', 2, function(defined, REPLACE, $replace){ // 21.1.3.14 String.prototype.replace(searchValue, replaceValue) @@ -50212,7 +50815,7 @@ require('./_fix-re-wks')('replace', 2, function(defined, REPLACE, $replace){ : $replace.call(String(O), searchValue, replaceValue); }, $replace]; }); -},{"./_fix-re-wks":118}],301:[function(require,module,exports){ +},{"./_fix-re-wks":119}],302:[function(require,module,exports){ // @@search logic require('./_fix-re-wks')('search', 1, function(defined, SEARCH, $search){ // 21.1.3.15 String.prototype.search(regexp) @@ -50223,7 +50826,7 @@ require('./_fix-re-wks')('search', 1, function(defined, SEARCH, $search){ return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O)); }, $search]; }); -},{"./_fix-re-wks":118}],302:[function(require,module,exports){ +},{"./_fix-re-wks":119}],303:[function(require,module,exports){ // @@split logic require('./_fix-re-wks')('split', 2, function(defined, SPLIT, $split){ 'use strict'; @@ -50294,7 +50897,7 @@ require('./_fix-re-wks')('split', 2, function(defined, SPLIT, $split){ return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit); }, $split]; }); -},{"./_fix-re-wks":118,"./_is-regexp":133}],303:[function(require,module,exports){ +},{"./_fix-re-wks":119,"./_is-regexp":134}],304:[function(require,module,exports){ 'use strict'; require('./es6.regexp.flags'); var anObject = require('./_an-object') @@ -50320,7 +50923,7 @@ if(require('./_fails')(function(){ return $toString.call({source: 'a', flags: 'b return $toString.call(this); }); } -},{"./_an-object":90,"./_descriptors":111,"./_fails":117,"./_flags":119,"./_redefine":170,"./es6.regexp.flags":298}],304:[function(require,module,exports){ +},{"./_an-object":91,"./_descriptors":112,"./_fails":118,"./_flags":120,"./_redefine":171,"./es6.regexp.flags":299}],305:[function(require,module,exports){ 'use strict'; var strong = require('./_collection-strong'); @@ -50333,7 +50936,7 @@ module.exports = require('./_collection')('Set', function(get){ return strong.def(this, value = value === 0 ? 0 : value, value); } }, strong); -},{"./_collection":105,"./_collection-strong":102}],305:[function(require,module,exports){ +},{"./_collection":106,"./_collection-strong":103}],306:[function(require,module,exports){ 'use strict'; // B.2.3.2 String.prototype.anchor(name) require('./_string-html')('anchor', function(createHTML){ @@ -50341,7 +50944,7 @@ require('./_string-html')('anchor', function(createHTML){ return createHTML(this, 'a', 'name', name); } }); -},{"./_string-html":182}],306:[function(require,module,exports){ +},{"./_string-html":183}],307:[function(require,module,exports){ 'use strict'; // B.2.3.3 String.prototype.big() require('./_string-html')('big', function(createHTML){ @@ -50349,7 +50952,7 @@ require('./_string-html')('big', function(createHTML){ return createHTML(this, 'big', '', ''); } }); -},{"./_string-html":182}],307:[function(require,module,exports){ +},{"./_string-html":183}],308:[function(require,module,exports){ 'use strict'; // B.2.3.4 String.prototype.blink() require('./_string-html')('blink', function(createHTML){ @@ -50357,7 +50960,7 @@ require('./_string-html')('blink', function(createHTML){ return createHTML(this, 'blink', '', ''); } }); -},{"./_string-html":182}],308:[function(require,module,exports){ +},{"./_string-html":183}],309:[function(require,module,exports){ 'use strict'; // B.2.3.5 String.prototype.bold() require('./_string-html')('bold', function(createHTML){ @@ -50365,7 +50968,7 @@ require('./_string-html')('bold', function(createHTML){ return createHTML(this, 'b', '', ''); } }); -},{"./_string-html":182}],309:[function(require,module,exports){ +},{"./_string-html":183}],310:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $at = require('./_string-at')(false); @@ -50375,7 +50978,7 @@ $export($export.P, 'String', { return $at(this, pos); } }); -},{"./_export":115,"./_string-at":180}],310:[function(require,module,exports){ +},{"./_export":116,"./_string-at":181}],311:[function(require,module,exports){ // 21.1.3.6 String.prototype.endsWith(searchString [, endPosition]) 'use strict'; var $export = require('./_export') @@ -50396,7 +50999,7 @@ $export($export.P + $export.F * require('./_fails-is-regexp')(ENDS_WITH), 'Strin : that.slice(end - search.length, end) === search; } }); -},{"./_export":115,"./_fails-is-regexp":116,"./_string-context":181,"./_to-length":191}],311:[function(require,module,exports){ +},{"./_export":116,"./_fails-is-regexp":117,"./_string-context":182,"./_to-length":192}],312:[function(require,module,exports){ 'use strict'; // B.2.3.6 String.prototype.fixed() require('./_string-html')('fixed', function(createHTML){ @@ -50404,7 +51007,7 @@ require('./_string-html')('fixed', function(createHTML){ return createHTML(this, 'tt', '', ''); } }); -},{"./_string-html":182}],312:[function(require,module,exports){ +},{"./_string-html":183}],313:[function(require,module,exports){ 'use strict'; // B.2.3.7 String.prototype.fontcolor(color) require('./_string-html')('fontcolor', function(createHTML){ @@ -50412,7 +51015,7 @@ require('./_string-html')('fontcolor', function(createHTML){ return createHTML(this, 'font', 'color', color); } }); -},{"./_string-html":182}],313:[function(require,module,exports){ +},{"./_string-html":183}],314:[function(require,module,exports){ 'use strict'; // B.2.3.8 String.prototype.fontsize(size) require('./_string-html')('fontsize', function(createHTML){ @@ -50420,7 +51023,7 @@ require('./_string-html')('fontsize', function(createHTML){ return createHTML(this, 'font', 'size', size); } }); -},{"./_string-html":182}],314:[function(require,module,exports){ +},{"./_string-html":183}],315:[function(require,module,exports){ var $export = require('./_export') , toIndex = require('./_to-index') , fromCharCode = String.fromCharCode @@ -50444,7 +51047,7 @@ $export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1) } return res.join(''); } }); -},{"./_export":115,"./_to-index":188}],315:[function(require,module,exports){ +},{"./_export":116,"./_to-index":189}],316:[function(require,module,exports){ // 21.1.3.7 String.prototype.includes(searchString, position = 0) 'use strict'; var $export = require('./_export') @@ -50457,7 +51060,7 @@ $export($export.P + $export.F * require('./_fails-is-regexp')(INCLUDES), 'String .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined); } }); -},{"./_export":115,"./_fails-is-regexp":116,"./_string-context":181}],316:[function(require,module,exports){ +},{"./_export":116,"./_fails-is-regexp":117,"./_string-context":182}],317:[function(require,module,exports){ 'use strict'; // B.2.3.9 String.prototype.italics() require('./_string-html')('italics', function(createHTML){ @@ -50465,7 +51068,7 @@ require('./_string-html')('italics', function(createHTML){ return createHTML(this, 'i', '', ''); } }); -},{"./_string-html":182}],317:[function(require,module,exports){ +},{"./_string-html":183}],318:[function(require,module,exports){ 'use strict'; var $at = require('./_string-at')(true); @@ -50483,7 +51086,7 @@ require('./_iter-define')(String, 'String', function(iterated){ this._i += point.length; return {value: point, done: false}; }); -},{"./_iter-define":136,"./_string-at":180}],318:[function(require,module,exports){ +},{"./_iter-define":137,"./_string-at":181}],319:[function(require,module,exports){ 'use strict'; // B.2.3.10 String.prototype.link(url) require('./_string-html')('link', function(createHTML){ @@ -50491,7 +51094,7 @@ require('./_string-html')('link', function(createHTML){ return createHTML(this, 'a', 'href', url); } }); -},{"./_string-html":182}],319:[function(require,module,exports){ +},{"./_string-html":183}],320:[function(require,module,exports){ var $export = require('./_export') , toIObject = require('./_to-iobject') , toLength = require('./_to-length'); @@ -50510,14 +51113,14 @@ $export($export.S, 'String', { } return res.join(''); } }); -},{"./_export":115,"./_to-iobject":190,"./_to-length":191}],320:[function(require,module,exports){ +},{"./_export":116,"./_to-iobject":191,"./_to-length":192}],321:[function(require,module,exports){ var $export = require('./_export'); $export($export.P, 'String', { // 21.1.3.13 String.prototype.repeat(count) repeat: require('./_string-repeat') }); -},{"./_export":115,"./_string-repeat":184}],321:[function(require,module,exports){ +},{"./_export":116,"./_string-repeat":185}],322:[function(require,module,exports){ 'use strict'; // B.2.3.11 String.prototype.small() require('./_string-html')('small', function(createHTML){ @@ -50525,7 +51128,7 @@ require('./_string-html')('small', function(createHTML){ return createHTML(this, 'small', '', ''); } }); -},{"./_string-html":182}],322:[function(require,module,exports){ +},{"./_string-html":183}],323:[function(require,module,exports){ // 21.1.3.18 String.prototype.startsWith(searchString [, position ]) 'use strict'; var $export = require('./_export') @@ -50544,7 +51147,7 @@ $export($export.P + $export.F * require('./_fails-is-regexp')(STARTS_WITH), 'Str : that.slice(index, index + search.length) === search; } }); -},{"./_export":115,"./_fails-is-regexp":116,"./_string-context":181,"./_to-length":191}],323:[function(require,module,exports){ +},{"./_export":116,"./_fails-is-regexp":117,"./_string-context":182,"./_to-length":192}],324:[function(require,module,exports){ 'use strict'; // B.2.3.12 String.prototype.strike() require('./_string-html')('strike', function(createHTML){ @@ -50552,7 +51155,7 @@ require('./_string-html')('strike', function(createHTML){ return createHTML(this, 'strike', '', ''); } }); -},{"./_string-html":182}],324:[function(require,module,exports){ +},{"./_string-html":183}],325:[function(require,module,exports){ 'use strict'; // B.2.3.13 String.prototype.sub() require('./_string-html')('sub', function(createHTML){ @@ -50560,7 +51163,7 @@ require('./_string-html')('sub', function(createHTML){ return createHTML(this, 'sub', '', ''); } }); -},{"./_string-html":182}],325:[function(require,module,exports){ +},{"./_string-html":183}],326:[function(require,module,exports){ 'use strict'; // B.2.3.14 String.prototype.sup() require('./_string-html')('sup', function(createHTML){ @@ -50568,7 +51171,7 @@ require('./_string-html')('sup', function(createHTML){ return createHTML(this, 'sup', '', ''); } }); -},{"./_string-html":182}],326:[function(require,module,exports){ +},{"./_string-html":183}],327:[function(require,module,exports){ 'use strict'; // 21.1.3.25 String.prototype.trim() require('./_string-trim')('trim', function($trim){ @@ -50576,7 +51179,7 @@ require('./_string-trim')('trim', function($trim){ return $trim(this, 3); }; }); -},{"./_string-trim":185}],327:[function(require,module,exports){ +},{"./_string-trim":186}],328:[function(require,module,exports){ 'use strict'; // ECMAScript 6 symbols shim var global = require('./_global') @@ -50812,7 +51415,7 @@ setToStringTag($Symbol, 'Symbol'); setToStringTag(Math, 'Math', true); // 24.3.3 JSON[@@toStringTag] setToStringTag(global.JSON, 'JSON', true); -},{"./_an-object":90,"./_descriptors":111,"./_enum-keys":114,"./_export":115,"./_fails":117,"./_global":121,"./_has":122,"./_hide":123,"./_is-array":130,"./_keyof":140,"./_library":141,"./_meta":145,"./_object-create":149,"./_object-dp":150,"./_object-gopd":153,"./_object-gopn":155,"./_object-gopn-ext":154,"./_object-gops":156,"./_object-keys":159,"./_object-pie":160,"./_property-desc":168,"./_redefine":170,"./_set-to-string-tag":175,"./_shared":177,"./_to-iobject":190,"./_to-primitive":193,"./_uid":197,"./_wks":200,"./_wks-define":198,"./_wks-ext":199}],328:[function(require,module,exports){ +},{"./_an-object":91,"./_descriptors":112,"./_enum-keys":115,"./_export":116,"./_fails":118,"./_global":122,"./_has":123,"./_hide":124,"./_is-array":131,"./_keyof":141,"./_library":142,"./_meta":146,"./_object-create":150,"./_object-dp":151,"./_object-gopd":154,"./_object-gopn":156,"./_object-gopn-ext":155,"./_object-gops":157,"./_object-keys":160,"./_object-pie":161,"./_property-desc":169,"./_redefine":171,"./_set-to-string-tag":176,"./_shared":178,"./_to-iobject":191,"./_to-primitive":194,"./_uid":198,"./_wks":201,"./_wks-define":199,"./_wks-ext":200}],329:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $typed = require('./_typed') @@ -50860,66 +51463,66 @@ $export($export.P + $export.U + $export.F * require('./_fails')(function(){ }); require('./_set-species')(ARRAY_BUFFER); -},{"./_an-object":90,"./_export":115,"./_fails":117,"./_global":121,"./_is-object":132,"./_set-species":174,"./_species-constructor":178,"./_to-index":188,"./_to-length":191,"./_typed":196,"./_typed-buffer":195,"./_wks":200}],329:[function(require,module,exports){ +},{"./_an-object":91,"./_export":116,"./_fails":118,"./_global":122,"./_is-object":133,"./_set-species":175,"./_species-constructor":179,"./_to-index":189,"./_to-length":192,"./_typed":197,"./_typed-buffer":196,"./_wks":201}],330:[function(require,module,exports){ var $export = require('./_export'); $export($export.G + $export.W + $export.F * !require('./_typed').ABV, { DataView: require('./_typed-buffer').DataView }); -},{"./_export":115,"./_typed":196,"./_typed-buffer":195}],330:[function(require,module,exports){ +},{"./_export":116,"./_typed":197,"./_typed-buffer":196}],331:[function(require,module,exports){ require('./_typed-array')('Float32', 4, function(init){ return function Float32Array(data, byteOffset, length){ return init(this, data, byteOffset, length); }; }); -},{"./_typed-array":194}],331:[function(require,module,exports){ +},{"./_typed-array":195}],332:[function(require,module,exports){ require('./_typed-array')('Float64', 8, function(init){ return function Float64Array(data, byteOffset, length){ return init(this, data, byteOffset, length); }; }); -},{"./_typed-array":194}],332:[function(require,module,exports){ +},{"./_typed-array":195}],333:[function(require,module,exports){ require('./_typed-array')('Int16', 2, function(init){ return function Int16Array(data, byteOffset, length){ return init(this, data, byteOffset, length); }; }); -},{"./_typed-array":194}],333:[function(require,module,exports){ +},{"./_typed-array":195}],334:[function(require,module,exports){ require('./_typed-array')('Int32', 4, function(init){ return function Int32Array(data, byteOffset, length){ return init(this, data, byteOffset, length); }; }); -},{"./_typed-array":194}],334:[function(require,module,exports){ +},{"./_typed-array":195}],335:[function(require,module,exports){ require('./_typed-array')('Int8', 1, function(init){ return function Int8Array(data, byteOffset, length){ return init(this, data, byteOffset, length); }; }); -},{"./_typed-array":194}],335:[function(require,module,exports){ +},{"./_typed-array":195}],336:[function(require,module,exports){ require('./_typed-array')('Uint16', 2, function(init){ return function Uint16Array(data, byteOffset, length){ return init(this, data, byteOffset, length); }; }); -},{"./_typed-array":194}],336:[function(require,module,exports){ +},{"./_typed-array":195}],337:[function(require,module,exports){ require('./_typed-array')('Uint32', 4, function(init){ return function Uint32Array(data, byteOffset, length){ return init(this, data, byteOffset, length); }; }); -},{"./_typed-array":194}],337:[function(require,module,exports){ +},{"./_typed-array":195}],338:[function(require,module,exports){ require('./_typed-array')('Uint8', 1, function(init){ return function Uint8Array(data, byteOffset, length){ return init(this, data, byteOffset, length); }; }); -},{"./_typed-array":194}],338:[function(require,module,exports){ +},{"./_typed-array":195}],339:[function(require,module,exports){ require('./_typed-array')('Uint8', 1, function(init){ return function Uint8ClampedArray(data, byteOffset, length){ return init(this, data, byteOffset, length); }; }, true); -},{"./_typed-array":194}],339:[function(require,module,exports){ +},{"./_typed-array":195}],340:[function(require,module,exports){ 'use strict'; var each = require('./_array-methods')(0) , redefine = require('./_redefine') @@ -50977,7 +51580,7 @@ if(new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7){ }); }); } -},{"./_array-methods":95,"./_collection":105,"./_collection-weak":104,"./_has":122,"./_is-object":132,"./_meta":145,"./_object-assign":148,"./_redefine":170}],340:[function(require,module,exports){ +},{"./_array-methods":96,"./_collection":106,"./_collection-weak":105,"./_has":123,"./_is-object":133,"./_meta":146,"./_object-assign":149,"./_redefine":171}],341:[function(require,module,exports){ 'use strict'; var weak = require('./_collection-weak'); @@ -50990,7 +51593,7 @@ require('./_collection')('WeakSet', function(get){ return weak.def(this, value, true); } }, weak, false, true); -},{"./_collection":105,"./_collection-weak":104}],341:[function(require,module,exports){ +},{"./_collection":106,"./_collection-weak":105}],342:[function(require,module,exports){ 'use strict'; // https://github.com/tc39/Array.prototype.includes var $export = require('./_export') @@ -51003,7 +51606,7 @@ $export($export.P, 'Array', { }); require('./_add-to-unscopables')('includes'); -},{"./_add-to-unscopables":88,"./_array-includes":94,"./_export":115}],342:[function(require,module,exports){ +},{"./_add-to-unscopables":89,"./_array-includes":95,"./_export":116}],343:[function(require,module,exports){ // https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask var $export = require('./_export') , microtask = require('./_microtask')() @@ -51016,7 +51619,7 @@ $export($export.G, { microtask(domain ? domain.bind(fn) : fn); } }); -},{"./_cof":101,"./_export":115,"./_global":121,"./_microtask":147}],343:[function(require,module,exports){ +},{"./_cof":102,"./_export":116,"./_global":122,"./_microtask":148}],344:[function(require,module,exports){ // https://github.com/ljharb/proposal-is-error var $export = require('./_export') , cof = require('./_cof'); @@ -51026,12 +51629,12 @@ $export($export.S, 'Error', { return cof(it) === 'Error'; } }); -},{"./_cof":101,"./_export":115}],344:[function(require,module,exports){ +},{"./_cof":102,"./_export":116}],345:[function(require,module,exports){ // https://github.com/DavidBruant/Map-Set.prototype.toJSON var $export = require('./_export'); $export($export.P + $export.R, 'Map', {toJSON: require('./_collection-to-json')('Map')}); -},{"./_collection-to-json":103,"./_export":115}],345:[function(require,module,exports){ +},{"./_collection-to-json":104,"./_export":116}],346:[function(require,module,exports){ // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 var $export = require('./_export'); @@ -51043,7 +51646,7 @@ $export($export.S, 'Math', { return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0; } }); -},{"./_export":115}],346:[function(require,module,exports){ +},{"./_export":116}],347:[function(require,module,exports){ // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 var $export = require('./_export'); @@ -51060,7 +51663,7 @@ $export($export.S, 'Math', { return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16); } }); -},{"./_export":115}],347:[function(require,module,exports){ +},{"./_export":116}],348:[function(require,module,exports){ // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 var $export = require('./_export'); @@ -51072,7 +51675,7 @@ $export($export.S, 'Math', { return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0; } }); -},{"./_export":115}],348:[function(require,module,exports){ +},{"./_export":116}],349:[function(require,module,exports){ // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 var $export = require('./_export'); @@ -51089,7 +51692,7 @@ $export($export.S, 'Math', { return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16); } }); -},{"./_export":115}],349:[function(require,module,exports){ +},{"./_export":116}],350:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , toObject = require('./_to-object') @@ -51102,7 +51705,7 @@ require('./_descriptors') && $export($export.P + require('./_object-forced-pam') $defineProperty.f(toObject(this), P, {get: aFunction(getter), enumerable: true, configurable: true}); } }); -},{"./_a-function":86,"./_descriptors":111,"./_export":115,"./_object-dp":150,"./_object-forced-pam":152,"./_to-object":192}],350:[function(require,module,exports){ +},{"./_a-function":87,"./_descriptors":112,"./_export":116,"./_object-dp":151,"./_object-forced-pam":153,"./_to-object":193}],351:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , toObject = require('./_to-object') @@ -51115,7 +51718,7 @@ require('./_descriptors') && $export($export.P + require('./_object-forced-pam') $defineProperty.f(toObject(this), P, {set: aFunction(setter), enumerable: true, configurable: true}); } }); -},{"./_a-function":86,"./_descriptors":111,"./_export":115,"./_object-dp":150,"./_object-forced-pam":152,"./_to-object":192}],351:[function(require,module,exports){ +},{"./_a-function":87,"./_descriptors":112,"./_export":116,"./_object-dp":151,"./_object-forced-pam":153,"./_to-object":193}],352:[function(require,module,exports){ // https://github.com/tc39/proposal-object-values-entries var $export = require('./_export') , $entries = require('./_object-to-array')(true); @@ -51125,7 +51728,7 @@ $export($export.S, 'Object', { return $entries(it); } }); -},{"./_export":115,"./_object-to-array":162}],352:[function(require,module,exports){ +},{"./_export":116,"./_object-to-array":163}],353:[function(require,module,exports){ // https://github.com/tc39/proposal-object-getownpropertydescriptors var $export = require('./_export') , ownKeys = require('./_own-keys') @@ -51145,7 +51748,7 @@ $export($export.S, 'Object', { return result; } }); -},{"./_create-property":107,"./_export":115,"./_object-gopd":153,"./_own-keys":163,"./_to-iobject":190}],353:[function(require,module,exports){ +},{"./_create-property":108,"./_export":116,"./_object-gopd":154,"./_own-keys":164,"./_to-iobject":191}],354:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , toObject = require('./_to-object') @@ -51164,7 +51767,7 @@ require('./_descriptors') && $export($export.P + require('./_object-forced-pam') } while(O = getPrototypeOf(O)); } }); -},{"./_descriptors":111,"./_export":115,"./_object-forced-pam":152,"./_object-gopd":153,"./_object-gpo":157,"./_to-object":192,"./_to-primitive":193}],354:[function(require,module,exports){ +},{"./_descriptors":112,"./_export":116,"./_object-forced-pam":153,"./_object-gopd":154,"./_object-gpo":158,"./_to-object":193,"./_to-primitive":194}],355:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , toObject = require('./_to-object') @@ -51183,7 +51786,7 @@ require('./_descriptors') && $export($export.P + require('./_object-forced-pam') } while(O = getPrototypeOf(O)); } }); -},{"./_descriptors":111,"./_export":115,"./_object-forced-pam":152,"./_object-gopd":153,"./_object-gpo":157,"./_to-object":192,"./_to-primitive":193}],355:[function(require,module,exports){ +},{"./_descriptors":112,"./_export":116,"./_object-forced-pam":153,"./_object-gopd":154,"./_object-gpo":158,"./_to-object":193,"./_to-primitive":194}],356:[function(require,module,exports){ // https://github.com/tc39/proposal-object-values-entries var $export = require('./_export') , $values = require('./_object-to-array')(false); @@ -51193,7 +51796,7 @@ $export($export.S, 'Object', { return $values(it); } }); -},{"./_export":115,"./_object-to-array":162}],356:[function(require,module,exports){ +},{"./_export":116,"./_object-to-array":163}],357:[function(require,module,exports){ 'use strict'; // https://github.com/zenparsing/es-observable var $export = require('./_export') @@ -51393,7 +51996,7 @@ hide($Observable.prototype, OBSERVABLE, function(){ return this; }); $export($export.G, {Observable: $Observable}); require('./_set-species')('Observable'); -},{"./_a-function":86,"./_an-instance":89,"./_an-object":90,"./_core":106,"./_export":115,"./_for-of":120,"./_global":121,"./_hide":123,"./_microtask":147,"./_redefine-all":169,"./_set-species":174,"./_wks":200}],357:[function(require,module,exports){ +},{"./_a-function":87,"./_an-instance":90,"./_an-object":91,"./_core":107,"./_export":116,"./_for-of":121,"./_global":122,"./_hide":124,"./_microtask":148,"./_redefine-all":170,"./_set-species":175,"./_wks":201}],358:[function(require,module,exports){ var metadata = require('./_metadata') , anObject = require('./_an-object') , toMetaKey = metadata.key @@ -51402,7 +52005,7 @@ var metadata = require('./_metadata') metadata.exp({defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey){ ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey)); }}); -},{"./_an-object":90,"./_metadata":146}],358:[function(require,module,exports){ +},{"./_an-object":91,"./_metadata":147}],359:[function(require,module,exports){ var metadata = require('./_metadata') , anObject = require('./_an-object') , toMetaKey = metadata.key @@ -51418,7 +52021,7 @@ metadata.exp({deleteMetadata: function deleteMetadata(metadataKey, target /*, ta targetMetadata['delete'](targetKey); return !!targetMetadata.size || store['delete'](target); }}); -},{"./_an-object":90,"./_metadata":146}],359:[function(require,module,exports){ +},{"./_an-object":91,"./_metadata":147}],360:[function(require,module,exports){ var Set = require('./es6.set') , from = require('./_array-from-iterable') , metadata = require('./_metadata') @@ -51438,7 +52041,7 @@ var ordinaryMetadataKeys = function(O, P){ metadata.exp({getMetadataKeys: function getMetadataKeys(target /*, targetKey */){ return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); }}); -},{"./_an-object":90,"./_array-from-iterable":93,"./_metadata":146,"./_object-gpo":157,"./es6.set":304}],360:[function(require,module,exports){ +},{"./_an-object":91,"./_array-from-iterable":94,"./_metadata":147,"./_object-gpo":158,"./es6.set":305}],361:[function(require,module,exports){ var metadata = require('./_metadata') , anObject = require('./_an-object') , getPrototypeOf = require('./_object-gpo') @@ -51456,7 +52059,7 @@ var ordinaryGetMetadata = function(MetadataKey, O, P){ metadata.exp({getMetadata: function getMetadata(metadataKey, target /*, targetKey */){ return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); }}); -},{"./_an-object":90,"./_metadata":146,"./_object-gpo":157}],361:[function(require,module,exports){ +},{"./_an-object":91,"./_metadata":147,"./_object-gpo":158}],362:[function(require,module,exports){ var metadata = require('./_metadata') , anObject = require('./_an-object') , ordinaryOwnMetadataKeys = metadata.keys @@ -51465,7 +52068,7 @@ var metadata = require('./_metadata') metadata.exp({getOwnMetadataKeys: function getOwnMetadataKeys(target /*, targetKey */){ return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); }}); -},{"./_an-object":90,"./_metadata":146}],362:[function(require,module,exports){ +},{"./_an-object":91,"./_metadata":147}],363:[function(require,module,exports){ var metadata = require('./_metadata') , anObject = require('./_an-object') , ordinaryGetOwnMetadata = metadata.get @@ -51475,7 +52078,7 @@ metadata.exp({getOwnMetadata: function getOwnMetadata(metadataKey, target /*, ta return ordinaryGetOwnMetadata(metadataKey, anObject(target) , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); }}); -},{"./_an-object":90,"./_metadata":146}],363:[function(require,module,exports){ +},{"./_an-object":91,"./_metadata":147}],364:[function(require,module,exports){ var metadata = require('./_metadata') , anObject = require('./_an-object') , getPrototypeOf = require('./_object-gpo') @@ -51492,7 +52095,7 @@ var ordinaryHasMetadata = function(MetadataKey, O, P){ metadata.exp({hasMetadata: function hasMetadata(metadataKey, target /*, targetKey */){ return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); }}); -},{"./_an-object":90,"./_metadata":146,"./_object-gpo":157}],364:[function(require,module,exports){ +},{"./_an-object":91,"./_metadata":147,"./_object-gpo":158}],365:[function(require,module,exports){ var metadata = require('./_metadata') , anObject = require('./_an-object') , ordinaryHasOwnMetadata = metadata.has @@ -51502,7 +52105,7 @@ metadata.exp({hasOwnMetadata: function hasOwnMetadata(metadataKey, target /*, ta return ordinaryHasOwnMetadata(metadataKey, anObject(target) , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); }}); -},{"./_an-object":90,"./_metadata":146}],365:[function(require,module,exports){ +},{"./_an-object":91,"./_metadata":147}],366:[function(require,module,exports){ var metadata = require('./_metadata') , anObject = require('./_an-object') , aFunction = require('./_a-function') @@ -51518,12 +52121,12 @@ metadata.exp({metadata: function metadata(metadataKey, metadataValue){ ); }; }}); -},{"./_a-function":86,"./_an-object":90,"./_metadata":146}],366:[function(require,module,exports){ +},{"./_a-function":87,"./_an-object":91,"./_metadata":147}],367:[function(require,module,exports){ // https://github.com/DavidBruant/Map-Set.prototype.toJSON var $export = require('./_export'); $export($export.P + $export.R, 'Set', {toJSON: require('./_collection-to-json')('Set')}); -},{"./_collection-to-json":103,"./_export":115}],367:[function(require,module,exports){ +},{"./_collection-to-json":104,"./_export":116}],368:[function(require,module,exports){ 'use strict'; // https://github.com/mathiasbynens/String.prototype.at var $export = require('./_export') @@ -51534,7 +52137,7 @@ $export($export.P, 'String', { return $at(this, pos); } }); -},{"./_export":115,"./_string-at":180}],368:[function(require,module,exports){ +},{"./_export":116,"./_string-at":181}],369:[function(require,module,exports){ 'use strict'; // https://tc39.github.io/String.prototype.matchAll/ var $export = require('./_export') @@ -51565,7 +52168,7 @@ $export($export.P, 'String', { return new $RegExpStringIterator(rx, S); } }); -},{"./_defined":110,"./_export":115,"./_flags":119,"./_is-regexp":133,"./_iter-create":135,"./_to-length":191}],369:[function(require,module,exports){ +},{"./_defined":111,"./_export":116,"./_flags":120,"./_is-regexp":134,"./_iter-create":136,"./_to-length":192}],370:[function(require,module,exports){ 'use strict'; // https://github.com/tc39/proposal-string-pad-start-end var $export = require('./_export') @@ -51576,7 +52179,7 @@ $export($export.P, 'String', { return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false); } }); -},{"./_export":115,"./_string-pad":183}],370:[function(require,module,exports){ +},{"./_export":116,"./_string-pad":184}],371:[function(require,module,exports){ 'use strict'; // https://github.com/tc39/proposal-string-pad-start-end var $export = require('./_export') @@ -51587,7 +52190,7 @@ $export($export.P, 'String', { return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true); } }); -},{"./_export":115,"./_string-pad":183}],371:[function(require,module,exports){ +},{"./_export":116,"./_string-pad":184}],372:[function(require,module,exports){ 'use strict'; // https://github.com/sebmarkbage/ecmascript-string-left-right-trim require('./_string-trim')('trimLeft', function($trim){ @@ -51595,7 +52198,7 @@ require('./_string-trim')('trimLeft', function($trim){ return $trim(this, 1); }; }, 'trimStart'); -},{"./_string-trim":185}],372:[function(require,module,exports){ +},{"./_string-trim":186}],373:[function(require,module,exports){ 'use strict'; // https://github.com/sebmarkbage/ecmascript-string-left-right-trim require('./_string-trim')('trimRight', function($trim){ @@ -51603,16 +52206,16 @@ require('./_string-trim')('trimRight', function($trim){ return $trim(this, 2); }; }, 'trimEnd'); -},{"./_string-trim":185}],373:[function(require,module,exports){ +},{"./_string-trim":186}],374:[function(require,module,exports){ require('./_wks-define')('asyncIterator'); -},{"./_wks-define":198}],374:[function(require,module,exports){ +},{"./_wks-define":199}],375:[function(require,module,exports){ require('./_wks-define')('observable'); -},{"./_wks-define":198}],375:[function(require,module,exports){ +},{"./_wks-define":199}],376:[function(require,module,exports){ // https://github.com/ljharb/proposal-global var $export = require('./_export'); $export($export.S, 'System', {global: require('./_global')}); -},{"./_export":115,"./_global":121}],376:[function(require,module,exports){ +},{"./_export":116,"./_global":122}],377:[function(require,module,exports){ var $iterators = require('./es6.array.iterator') , redefine = require('./_redefine') , global = require('./_global') @@ -51635,14 +52238,14 @@ for(var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList' for(key in $iterators)if(!proto[key])redefine(proto, key, $iterators[key], true); } } -},{"./_global":121,"./_hide":123,"./_iterators":139,"./_redefine":170,"./_wks":200,"./es6.array.iterator":214}],377:[function(require,module,exports){ +},{"./_global":122,"./_hide":124,"./_iterators":140,"./_redefine":171,"./_wks":201,"./es6.array.iterator":215}],378:[function(require,module,exports){ var $export = require('./_export') , $task = require('./_task'); $export($export.G + $export.B, { setImmediate: $task.set, clearImmediate: $task.clear }); -},{"./_export":115,"./_task":187}],378:[function(require,module,exports){ +},{"./_export":116,"./_task":188}],379:[function(require,module,exports){ // ie9- setTimeout & setInterval additional parameters fix var global = require('./_global') , $export = require('./_export') @@ -51663,7 +52266,7 @@ $export($export.G + $export.B + $export.F * MSIE, { setTimeout: wrap(global.setTimeout), setInterval: wrap(global.setInterval) }); -},{"./_export":115,"./_global":121,"./_invoke":127,"./_partial":166}],379:[function(require,module,exports){ +},{"./_export":116,"./_global":122,"./_invoke":128,"./_partial":167}],380:[function(require,module,exports){ require('./modules/es6.symbol'); require('./modules/es6.object.create'); require('./modules/es6.object.define-property'); @@ -51840,7 +52443,7 @@ require('./modules/web.timers'); require('./modules/web.immediate'); require('./modules/web.dom.iterable'); module.exports = require('./modules/_core'); -},{"./modules/_core":106,"./modules/es6.array.copy-within":204,"./modules/es6.array.every":205,"./modules/es6.array.fill":206,"./modules/es6.array.filter":207,"./modules/es6.array.find":209,"./modules/es6.array.find-index":208,"./modules/es6.array.for-each":210,"./modules/es6.array.from":211,"./modules/es6.array.index-of":212,"./modules/es6.array.is-array":213,"./modules/es6.array.iterator":214,"./modules/es6.array.join":215,"./modules/es6.array.last-index-of":216,"./modules/es6.array.map":217,"./modules/es6.array.of":218,"./modules/es6.array.reduce":220,"./modules/es6.array.reduce-right":219,"./modules/es6.array.slice":221,"./modules/es6.array.some":222,"./modules/es6.array.sort":223,"./modules/es6.array.species":224,"./modules/es6.date.now":225,"./modules/es6.date.to-iso-string":226,"./modules/es6.date.to-json":227,"./modules/es6.date.to-primitive":228,"./modules/es6.date.to-string":229,"./modules/es6.function.bind":230,"./modules/es6.function.has-instance":231,"./modules/es6.function.name":232,"./modules/es6.map":233,"./modules/es6.math.acosh":234,"./modules/es6.math.asinh":235,"./modules/es6.math.atanh":236,"./modules/es6.math.cbrt":237,"./modules/es6.math.clz32":238,"./modules/es6.math.cosh":239,"./modules/es6.math.expm1":240,"./modules/es6.math.fround":241,"./modules/es6.math.hypot":242,"./modules/es6.math.imul":243,"./modules/es6.math.log10":244,"./modules/es6.math.log1p":245,"./modules/es6.math.log2":246,"./modules/es6.math.sign":247,"./modules/es6.math.sinh":248,"./modules/es6.math.tanh":249,"./modules/es6.math.trunc":250,"./modules/es6.number.constructor":251,"./modules/es6.number.epsilon":252,"./modules/es6.number.is-finite":253,"./modules/es6.number.is-integer":254,"./modules/es6.number.is-nan":255,"./modules/es6.number.is-safe-integer":256,"./modules/es6.number.max-safe-integer":257,"./modules/es6.number.min-safe-integer":258,"./modules/es6.number.parse-float":259,"./modules/es6.number.parse-int":260,"./modules/es6.number.to-fixed":261,"./modules/es6.number.to-precision":262,"./modules/es6.object.assign":263,"./modules/es6.object.create":264,"./modules/es6.object.define-properties":265,"./modules/es6.object.define-property":266,"./modules/es6.object.freeze":267,"./modules/es6.object.get-own-property-descriptor":268,"./modules/es6.object.get-own-property-names":269,"./modules/es6.object.get-prototype-of":270,"./modules/es6.object.is":274,"./modules/es6.object.is-extensible":271,"./modules/es6.object.is-frozen":272,"./modules/es6.object.is-sealed":273,"./modules/es6.object.keys":275,"./modules/es6.object.prevent-extensions":276,"./modules/es6.object.seal":277,"./modules/es6.object.set-prototype-of":278,"./modules/es6.object.to-string":279,"./modules/es6.parse-float":280,"./modules/es6.parse-int":281,"./modules/es6.promise":282,"./modules/es6.reflect.apply":283,"./modules/es6.reflect.construct":284,"./modules/es6.reflect.define-property":285,"./modules/es6.reflect.delete-property":286,"./modules/es6.reflect.enumerate":287,"./modules/es6.reflect.get":290,"./modules/es6.reflect.get-own-property-descriptor":288,"./modules/es6.reflect.get-prototype-of":289,"./modules/es6.reflect.has":291,"./modules/es6.reflect.is-extensible":292,"./modules/es6.reflect.own-keys":293,"./modules/es6.reflect.prevent-extensions":294,"./modules/es6.reflect.set":296,"./modules/es6.reflect.set-prototype-of":295,"./modules/es6.regexp.constructor":297,"./modules/es6.regexp.flags":298,"./modules/es6.regexp.match":299,"./modules/es6.regexp.replace":300,"./modules/es6.regexp.search":301,"./modules/es6.regexp.split":302,"./modules/es6.regexp.to-string":303,"./modules/es6.set":304,"./modules/es6.string.anchor":305,"./modules/es6.string.big":306,"./modules/es6.string.blink":307,"./modules/es6.string.bold":308,"./modules/es6.string.code-point-at":309,"./modules/es6.string.ends-with":310,"./modules/es6.string.fixed":311,"./modules/es6.string.fontcolor":312,"./modules/es6.string.fontsize":313,"./modules/es6.string.from-code-point":314,"./modules/es6.string.includes":315,"./modules/es6.string.italics":316,"./modules/es6.string.iterator":317,"./modules/es6.string.link":318,"./modules/es6.string.raw":319,"./modules/es6.string.repeat":320,"./modules/es6.string.small":321,"./modules/es6.string.starts-with":322,"./modules/es6.string.strike":323,"./modules/es6.string.sub":324,"./modules/es6.string.sup":325,"./modules/es6.string.trim":326,"./modules/es6.symbol":327,"./modules/es6.typed.array-buffer":328,"./modules/es6.typed.data-view":329,"./modules/es6.typed.float32-array":330,"./modules/es6.typed.float64-array":331,"./modules/es6.typed.int16-array":332,"./modules/es6.typed.int32-array":333,"./modules/es6.typed.int8-array":334,"./modules/es6.typed.uint16-array":335,"./modules/es6.typed.uint32-array":336,"./modules/es6.typed.uint8-array":337,"./modules/es6.typed.uint8-clamped-array":338,"./modules/es6.weak-map":339,"./modules/es6.weak-set":340,"./modules/es7.array.includes":341,"./modules/es7.asap":342,"./modules/es7.error.is-error":343,"./modules/es7.map.to-json":344,"./modules/es7.math.iaddh":345,"./modules/es7.math.imulh":346,"./modules/es7.math.isubh":347,"./modules/es7.math.umulh":348,"./modules/es7.object.define-getter":349,"./modules/es7.object.define-setter":350,"./modules/es7.object.entries":351,"./modules/es7.object.get-own-property-descriptors":352,"./modules/es7.object.lookup-getter":353,"./modules/es7.object.lookup-setter":354,"./modules/es7.object.values":355,"./modules/es7.observable":356,"./modules/es7.reflect.define-metadata":357,"./modules/es7.reflect.delete-metadata":358,"./modules/es7.reflect.get-metadata":360,"./modules/es7.reflect.get-metadata-keys":359,"./modules/es7.reflect.get-own-metadata":362,"./modules/es7.reflect.get-own-metadata-keys":361,"./modules/es7.reflect.has-metadata":363,"./modules/es7.reflect.has-own-metadata":364,"./modules/es7.reflect.metadata":365,"./modules/es7.set.to-json":366,"./modules/es7.string.at":367,"./modules/es7.string.match-all":368,"./modules/es7.string.pad-end":369,"./modules/es7.string.pad-start":370,"./modules/es7.string.trim-left":371,"./modules/es7.string.trim-right":372,"./modules/es7.symbol.async-iterator":373,"./modules/es7.symbol.observable":374,"./modules/es7.system.global":375,"./modules/web.dom.iterable":376,"./modules/web.immediate":377,"./modules/web.timers":378}],380:[function(require,module,exports){ +},{"./modules/_core":107,"./modules/es6.array.copy-within":205,"./modules/es6.array.every":206,"./modules/es6.array.fill":207,"./modules/es6.array.filter":208,"./modules/es6.array.find":210,"./modules/es6.array.find-index":209,"./modules/es6.array.for-each":211,"./modules/es6.array.from":212,"./modules/es6.array.index-of":213,"./modules/es6.array.is-array":214,"./modules/es6.array.iterator":215,"./modules/es6.array.join":216,"./modules/es6.array.last-index-of":217,"./modules/es6.array.map":218,"./modules/es6.array.of":219,"./modules/es6.array.reduce":221,"./modules/es6.array.reduce-right":220,"./modules/es6.array.slice":222,"./modules/es6.array.some":223,"./modules/es6.array.sort":224,"./modules/es6.array.species":225,"./modules/es6.date.now":226,"./modules/es6.date.to-iso-string":227,"./modules/es6.date.to-json":228,"./modules/es6.date.to-primitive":229,"./modules/es6.date.to-string":230,"./modules/es6.function.bind":231,"./modules/es6.function.has-instance":232,"./modules/es6.function.name":233,"./modules/es6.map":234,"./modules/es6.math.acosh":235,"./modules/es6.math.asinh":236,"./modules/es6.math.atanh":237,"./modules/es6.math.cbrt":238,"./modules/es6.math.clz32":239,"./modules/es6.math.cosh":240,"./modules/es6.math.expm1":241,"./modules/es6.math.fround":242,"./modules/es6.math.hypot":243,"./modules/es6.math.imul":244,"./modules/es6.math.log10":245,"./modules/es6.math.log1p":246,"./modules/es6.math.log2":247,"./modules/es6.math.sign":248,"./modules/es6.math.sinh":249,"./modules/es6.math.tanh":250,"./modules/es6.math.trunc":251,"./modules/es6.number.constructor":252,"./modules/es6.number.epsilon":253,"./modules/es6.number.is-finite":254,"./modules/es6.number.is-integer":255,"./modules/es6.number.is-nan":256,"./modules/es6.number.is-safe-integer":257,"./modules/es6.number.max-safe-integer":258,"./modules/es6.number.min-safe-integer":259,"./modules/es6.number.parse-float":260,"./modules/es6.number.parse-int":261,"./modules/es6.number.to-fixed":262,"./modules/es6.number.to-precision":263,"./modules/es6.object.assign":264,"./modules/es6.object.create":265,"./modules/es6.object.define-properties":266,"./modules/es6.object.define-property":267,"./modules/es6.object.freeze":268,"./modules/es6.object.get-own-property-descriptor":269,"./modules/es6.object.get-own-property-names":270,"./modules/es6.object.get-prototype-of":271,"./modules/es6.object.is":275,"./modules/es6.object.is-extensible":272,"./modules/es6.object.is-frozen":273,"./modules/es6.object.is-sealed":274,"./modules/es6.object.keys":276,"./modules/es6.object.prevent-extensions":277,"./modules/es6.object.seal":278,"./modules/es6.object.set-prototype-of":279,"./modules/es6.object.to-string":280,"./modules/es6.parse-float":281,"./modules/es6.parse-int":282,"./modules/es6.promise":283,"./modules/es6.reflect.apply":284,"./modules/es6.reflect.construct":285,"./modules/es6.reflect.define-property":286,"./modules/es6.reflect.delete-property":287,"./modules/es6.reflect.enumerate":288,"./modules/es6.reflect.get":291,"./modules/es6.reflect.get-own-property-descriptor":289,"./modules/es6.reflect.get-prototype-of":290,"./modules/es6.reflect.has":292,"./modules/es6.reflect.is-extensible":293,"./modules/es6.reflect.own-keys":294,"./modules/es6.reflect.prevent-extensions":295,"./modules/es6.reflect.set":297,"./modules/es6.reflect.set-prototype-of":296,"./modules/es6.regexp.constructor":298,"./modules/es6.regexp.flags":299,"./modules/es6.regexp.match":300,"./modules/es6.regexp.replace":301,"./modules/es6.regexp.search":302,"./modules/es6.regexp.split":303,"./modules/es6.regexp.to-string":304,"./modules/es6.set":305,"./modules/es6.string.anchor":306,"./modules/es6.string.big":307,"./modules/es6.string.blink":308,"./modules/es6.string.bold":309,"./modules/es6.string.code-point-at":310,"./modules/es6.string.ends-with":311,"./modules/es6.string.fixed":312,"./modules/es6.string.fontcolor":313,"./modules/es6.string.fontsize":314,"./modules/es6.string.from-code-point":315,"./modules/es6.string.includes":316,"./modules/es6.string.italics":317,"./modules/es6.string.iterator":318,"./modules/es6.string.link":319,"./modules/es6.string.raw":320,"./modules/es6.string.repeat":321,"./modules/es6.string.small":322,"./modules/es6.string.starts-with":323,"./modules/es6.string.strike":324,"./modules/es6.string.sub":325,"./modules/es6.string.sup":326,"./modules/es6.string.trim":327,"./modules/es6.symbol":328,"./modules/es6.typed.array-buffer":329,"./modules/es6.typed.data-view":330,"./modules/es6.typed.float32-array":331,"./modules/es6.typed.float64-array":332,"./modules/es6.typed.int16-array":333,"./modules/es6.typed.int32-array":334,"./modules/es6.typed.int8-array":335,"./modules/es6.typed.uint16-array":336,"./modules/es6.typed.uint32-array":337,"./modules/es6.typed.uint8-array":338,"./modules/es6.typed.uint8-clamped-array":339,"./modules/es6.weak-map":340,"./modules/es6.weak-set":341,"./modules/es7.array.includes":342,"./modules/es7.asap":343,"./modules/es7.error.is-error":344,"./modules/es7.map.to-json":345,"./modules/es7.math.iaddh":346,"./modules/es7.math.imulh":347,"./modules/es7.math.isubh":348,"./modules/es7.math.umulh":349,"./modules/es7.object.define-getter":350,"./modules/es7.object.define-setter":351,"./modules/es7.object.entries":352,"./modules/es7.object.get-own-property-descriptors":353,"./modules/es7.object.lookup-getter":354,"./modules/es7.object.lookup-setter":355,"./modules/es7.object.values":356,"./modules/es7.observable":357,"./modules/es7.reflect.define-metadata":358,"./modules/es7.reflect.delete-metadata":359,"./modules/es7.reflect.get-metadata":361,"./modules/es7.reflect.get-metadata-keys":360,"./modules/es7.reflect.get-own-metadata":363,"./modules/es7.reflect.get-own-metadata-keys":362,"./modules/es7.reflect.has-metadata":364,"./modules/es7.reflect.has-own-metadata":365,"./modules/es7.reflect.metadata":366,"./modules/es7.set.to-json":367,"./modules/es7.string.at":368,"./modules/es7.string.match-all":369,"./modules/es7.string.pad-end":370,"./modules/es7.string.pad-start":371,"./modules/es7.string.trim-left":372,"./modules/es7.string.trim-right":373,"./modules/es7.symbol.async-iterator":374,"./modules/es7.symbol.observable":375,"./modules/es7.system.global":376,"./modules/web.dom.iterable":377,"./modules/web.immediate":378,"./modules/web.timers":379}],381:[function(require,module,exports){ (function (Buffer){ // Copyright Joyent, Inc. and other Node contributors. // @@ -51951,7 +52554,7 @@ function objectToString(o) { } }).call(this,{"isBuffer":require("../../is-buffer/index.js")}) -},{"../../is-buffer/index.js":429}],381:[function(require,module,exports){ +},{"../../is-buffer/index.js":430}],382:[function(require,module,exports){ (function (Buffer){ var elliptic = require('elliptic'); var BN = require('bn.js'); @@ -52077,7 +52680,7 @@ function formatReturnValue(bn, enc, len) { } }).call(this,require("buffer").Buffer) -},{"bn.js":53,"buffer":83,"elliptic":397}],382:[function(require,module,exports){ +},{"bn.js":54,"buffer":84,"elliptic":398}],383:[function(require,module,exports){ (function (Buffer){ 'use strict'; var inherits = require('inherits') @@ -52133,7 +52736,7 @@ module.exports = function createHash (alg) { } }).call(this,require("buffer").Buffer) -},{"./md5":384,"buffer":83,"cipher-base":84,"inherits":428,"ripemd160":461,"sha.js":470}],383:[function(require,module,exports){ +},{"./md5":385,"buffer":84,"cipher-base":85,"inherits":429,"ripemd160":461,"sha.js":470}],384:[function(require,module,exports){ (function (Buffer){ 'use strict'; var intSize = 4; @@ -52170,7 +52773,7 @@ function hash(buf, fn, hashSize, bigEndian) { } exports.hash = hash; }).call(this,require("buffer").Buffer) -},{"buffer":83}],384:[function(require,module,exports){ +},{"buffer":84}],385:[function(require,module,exports){ 'use strict'; /* * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message @@ -52327,7 +52930,7 @@ function bit_rol(num, cnt) module.exports = function md5(buf) { return helpers.hash(buf, core_md5, 16); }; -},{"./helpers":383}],385:[function(require,module,exports){ +},{"./helpers":384}],386:[function(require,module,exports){ (function (Buffer){ 'use strict'; var createHash = require('create-hash/browser'); @@ -52399,7 +53002,7 @@ module.exports = function createHmac(alg, key) { } }).call(this,require("buffer").Buffer) -},{"buffer":83,"create-hash/browser":382,"inherits":428,"stream":477}],386:[function(require,module,exports){ +},{"buffer":84,"create-hash/browser":383,"inherits":429,"stream":477}],387:[function(require,module,exports){ 'use strict' exports.randomBytes = exports.rng = exports.pseudoRandomBytes = exports.prng = require('randombytes') @@ -52478,7 +53081,7 @@ var publicEncrypt = require('public-encrypt') } }) -},{"browserify-cipher":71,"browserify-sign":77,"browserify-sign/algos":76,"create-ecdh":381,"create-hash":382,"create-hmac":385,"diffie-hellman":393,"pbkdf2":440,"public-encrypt":443,"randombytes":449}],387:[function(require,module,exports){ +},{"browserify-cipher":72,"browserify-sign":78,"browserify-sign/algos":77,"create-ecdh":382,"create-hash":383,"create-hmac":386,"diffie-hellman":394,"pbkdf2":441,"public-encrypt":444,"randombytes":450}],388:[function(require,module,exports){ 'use strict'; exports.utils = require('./des/utils'); @@ -52487,7 +53090,7 @@ exports.DES = require('./des/des'); exports.CBC = require('./des/cbc'); exports.EDE = require('./des/ede'); -},{"./des/cbc":388,"./des/cipher":389,"./des/des":390,"./des/ede":391,"./des/utils":392}],388:[function(require,module,exports){ +},{"./des/cbc":389,"./des/cipher":390,"./des/des":391,"./des/ede":392,"./des/utils":393}],389:[function(require,module,exports){ 'use strict'; var assert = require('minimalistic-assert'); @@ -52554,7 +53157,7 @@ proto._update = function _update(inp, inOff, out, outOff) { } }; -},{"inherits":428,"minimalistic-assert":435}],389:[function(require,module,exports){ +},{"inherits":429,"minimalistic-assert":436}],390:[function(require,module,exports){ 'use strict'; var assert = require('minimalistic-assert'); @@ -52697,7 +53300,7 @@ Cipher.prototype._finalDecrypt = function _finalDecrypt() { return this._unpad(out); }; -},{"minimalistic-assert":435}],390:[function(require,module,exports){ +},{"minimalistic-assert":436}],391:[function(require,module,exports){ 'use strict'; var assert = require('minimalistic-assert'); @@ -52842,7 +53445,7 @@ DES.prototype._decrypt = function _decrypt(state, lStart, rStart, out, off) { utils.rip(l, r, out, off); }; -},{"../des":387,"inherits":428,"minimalistic-assert":435}],391:[function(require,module,exports){ +},{"../des":388,"inherits":429,"minimalistic-assert":436}],392:[function(require,module,exports){ 'use strict'; var assert = require('minimalistic-assert'); @@ -52899,7 +53502,7 @@ EDE.prototype._update = function _update(inp, inOff, out, outOff) { EDE.prototype._pad = DES.prototype._pad; EDE.prototype._unpad = DES.prototype._unpad; -},{"../des":387,"inherits":428,"minimalistic-assert":435}],392:[function(require,module,exports){ +},{"../des":388,"inherits":429,"minimalistic-assert":436}],393:[function(require,module,exports){ 'use strict'; exports.readUInt32BE = function readUInt32BE(bytes, off) { @@ -53157,7 +53760,7 @@ exports.padSplit = function padSplit(num, size, group) { return out.join(' '); }; -},{}],393:[function(require,module,exports){ +},{}],394:[function(require,module,exports){ (function (Buffer){ var generatePrime = require('./lib/generatePrime') var primes = require('./lib/primes.json') @@ -53203,7 +53806,7 @@ exports.DiffieHellmanGroup = exports.createDiffieHellmanGroup = exports.getDiffi exports.createDiffieHellman = exports.DiffieHellman = createDiffieHellman }).call(this,require("buffer").Buffer) -},{"./lib/dh":394,"./lib/generatePrime":395,"./lib/primes.json":396,"buffer":83}],394:[function(require,module,exports){ +},{"./lib/dh":395,"./lib/generatePrime":396,"./lib/primes.json":397,"buffer":84}],395:[function(require,module,exports){ (function (Buffer){ var BN = require('bn.js'); var MillerRabin = require('miller-rabin'); @@ -53371,7 +53974,7 @@ function formatReturnValue(bn, enc) { } }).call(this,require("buffer").Buffer) -},{"./generatePrime":395,"bn.js":53,"buffer":83,"miller-rabin":434,"randombytes":449}],395:[function(require,module,exports){ +},{"./generatePrime":396,"bn.js":54,"buffer":84,"miller-rabin":435,"randombytes":450}],396:[function(require,module,exports){ var randomBytes = require('randombytes'); module.exports = findPrime; findPrime.simpleSieve = simpleSieve; @@ -53478,7 +54081,7 @@ function findPrime(bits, gen) { } -},{"bn.js":53,"miller-rabin":434,"randombytes":449}],396:[function(require,module,exports){ +},{"bn.js":54,"miller-rabin":435,"randombytes":450}],397:[function(require,module,exports){ module.exports={ "modp1": { "gen": "02", @@ -53513,7 +54116,7 @@ module.exports={ "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff" } } -},{}],397:[function(require,module,exports){ +},{}],398:[function(require,module,exports){ 'use strict'; var elliptic = exports; @@ -53529,7 +54132,7 @@ elliptic.curves = require('./elliptic/curves'); elliptic.ec = require('./elliptic/ec'); elliptic.eddsa = require('./elliptic/eddsa'); -},{"../package.json":413,"./elliptic/curve":400,"./elliptic/curves":403,"./elliptic/ec":404,"./elliptic/eddsa":407,"./elliptic/hmac-drbg":410,"./elliptic/utils":412,"brorand":54}],398:[function(require,module,exports){ +},{"../package.json":414,"./elliptic/curve":401,"./elliptic/curves":404,"./elliptic/ec":405,"./elliptic/eddsa":408,"./elliptic/hmac-drbg":411,"./elliptic/utils":413,"brorand":55}],399:[function(require,module,exports){ 'use strict'; var BN = require('bn.js'); @@ -53882,7 +54485,7 @@ BasePoint.prototype.dblp = function dblp(k) { return r; }; -},{"../../elliptic":397,"bn.js":53}],399:[function(require,module,exports){ +},{"../../elliptic":398,"bn.js":54}],400:[function(require,module,exports){ 'use strict'; var curve = require('../curve'); @@ -54294,7 +54897,7 @@ Point.prototype.eq = function eq(other) { Point.prototype.toP = Point.prototype.normalize; Point.prototype.mixedAdd = Point.prototype.add; -},{"../../elliptic":397,"../curve":400,"bn.js":53,"inherits":428}],400:[function(require,module,exports){ +},{"../../elliptic":398,"../curve":401,"bn.js":54,"inherits":429}],401:[function(require,module,exports){ 'use strict'; var curve = exports; @@ -54304,7 +54907,7 @@ curve.short = require('./short'); curve.mont = require('./mont'); curve.edwards = require('./edwards'); -},{"./base":398,"./edwards":399,"./mont":401,"./short":402}],401:[function(require,module,exports){ +},{"./base":399,"./edwards":400,"./mont":402,"./short":403}],402:[function(require,module,exports){ 'use strict'; var curve = require('../curve'); @@ -54482,7 +55085,7 @@ Point.prototype.getX = function getX() { return this.x.fromRed(); }; -},{"../../elliptic":397,"../curve":400,"bn.js":53,"inherits":428}],402:[function(require,module,exports){ +},{"../../elliptic":398,"../curve":401,"bn.js":54,"inherits":429}],403:[function(require,module,exports){ 'use strict'; var curve = require('../curve'); @@ -55393,7 +55996,7 @@ JPoint.prototype.isInfinity = function isInfinity() { return this.z.cmpn(0) === 0; }; -},{"../../elliptic":397,"../curve":400,"bn.js":53,"inherits":428}],403:[function(require,module,exports){ +},{"../../elliptic":398,"../curve":401,"bn.js":54,"inherits":429}],404:[function(require,module,exports){ 'use strict'; var curves = exports; @@ -55600,7 +56203,7 @@ defineCurve('secp256k1', { ] }); -},{"../elliptic":397,"./precomputed/secp256k1":411,"hash.js":420}],404:[function(require,module,exports){ +},{"../elliptic":398,"./precomputed/secp256k1":412,"hash.js":421}],405:[function(require,module,exports){ 'use strict'; var BN = require('bn.js'); @@ -55824,7 +56427,7 @@ EC.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) { throw new Error('Unable to find valid recovery factor'); }; -},{"../../elliptic":397,"./key":405,"./signature":406,"bn.js":53}],405:[function(require,module,exports){ +},{"../../elliptic":398,"./key":406,"./signature":407,"bn.js":54}],406:[function(require,module,exports){ 'use strict'; var BN = require('bn.js'); @@ -55933,7 +56536,7 @@ KeyPair.prototype.inspect = function inspect() { ' pub: ' + (this.pub && this.pub.inspect()) + ' >'; }; -},{"bn.js":53}],406:[function(require,module,exports){ +},{"bn.js":54}],407:[function(require,module,exports){ 'use strict'; var BN = require('bn.js'); @@ -56070,7 +56673,7 @@ Signature.prototype.toDER = function toDER(enc) { return utils.encode(res, enc); }; -},{"../../elliptic":397,"bn.js":53}],407:[function(require,module,exports){ +},{"../../elliptic":398,"bn.js":54}],408:[function(require,module,exports){ 'use strict'; var hash = require('hash.js'); @@ -56190,7 +56793,7 @@ EDDSA.prototype.isPoint = function isPoint(val) { return val instanceof this.pointClass; }; -},{"../../elliptic":397,"./key":408,"./signature":409,"hash.js":420}],408:[function(require,module,exports){ +},{"../../elliptic":398,"./key":409,"./signature":410,"hash.js":421}],409:[function(require,module,exports){ 'use strict'; var elliptic = require('../../elliptic'); @@ -56288,7 +56891,7 @@ KeyPair.prototype.getPublic = function getPublic(enc) { module.exports = KeyPair; -},{"../../elliptic":397}],409:[function(require,module,exports){ +},{"../../elliptic":398}],410:[function(require,module,exports){ 'use strict'; var BN = require('bn.js'); @@ -56356,7 +56959,7 @@ Signature.prototype.toHex = function toHex() { module.exports = Signature; -},{"../../elliptic":397,"bn.js":53}],410:[function(require,module,exports){ +},{"../../elliptic":398,"bn.js":54}],411:[function(require,module,exports){ 'use strict'; var hash = require('hash.js'); @@ -56472,7 +57075,7 @@ HmacDRBG.prototype.generate = function generate(len, enc, add, addEnc) { return utils.encode(res, enc); }; -},{"../elliptic":397,"hash.js":420}],411:[function(require,module,exports){ +},{"../elliptic":398,"hash.js":421}],412:[function(require,module,exports){ module.exports = { doubles: { step: 4, @@ -57254,7 +57857,7 @@ module.exports = { } }; -},{}],412:[function(require,module,exports){ +},{}],413:[function(require,module,exports){ 'use strict'; var utils = exports; @@ -57428,12 +58031,12 @@ function intFromLE(bytes) { utils.intFromLE = intFromLE; -},{"bn.js":53}],413:[function(require,module,exports){ +},{"bn.js":54}],414:[function(require,module,exports){ module.exports={ "_args": [ [ "elliptic@^6.0.0", - "/Volumes/Macintosh HD/Users/TayTay/Documents/Dropbox/local-dev/etherwallet/node_modules/browserify-sign" + "C:\\Users\\Kosala\\Documents\\GitHub\\etherwallet\\node_modules\\browserify-sign" ] ], "_from": "elliptic@>=6.0.0 <7.0.0", @@ -57469,7 +58072,7 @@ module.exports={ "_shasum": "dce82efbf176eefa7495d4be3e8b9f5b5694b295", "_shrinkwrap": null, "_spec": "elliptic@^6.0.0", - "_where": "/Volumes/Macintosh HD/Users/TayTay/Documents/Dropbox/local-dev/etherwallet/node_modules/browserify-sign", + "_where": "C:\\Users\\Kosala\\Documents\\GitHub\\etherwallet\\node_modules\\browserify-sign", "author": { "email": "fedor@indutny.com", "name": "Fedor Indutny" @@ -57541,7 +58144,7 @@ module.exports={ "version": "6.2.7" } -},{}],414:[function(require,module,exports){ +},{}],415:[function(require,module,exports){ module.exports={ "genesisGasLimit": { "v": 5000, @@ -57774,10 +58377,10 @@ module.exports={ } } -},{}],415:[function(require,module,exports){ +},{}],416:[function(require,module,exports){ module.exports = require('./params.json') -},{"./params.json":414}],416:[function(require,module,exports){ +},{"./params.json":415}],417:[function(require,module,exports){ (function (global,Buffer){ const ethUtil = require('ethereumjs-util') const fees = require('ethereum-common/params') @@ -58037,7 +58640,7 @@ Transaction.prototype.validate = function (stringError) { } }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer) -},{"buffer":83,"ethereum-common/params":415,"ethereumjs-util":417}],417:[function(require,module,exports){ +},{"buffer":84,"ethereum-common/params":416,"ethereumjs-util":418}],418:[function(require,module,exports){ (function (Buffer){ const SHA3 = require('keccakjs') const secp256k1 = require('secp256k1') @@ -58706,7 +59309,7 @@ exports.defineProperties = function (self, fields, data) { } }).call(this,require("buffer").Buffer) -},{"assert":48,"bn.js":53,"buffer":83,"create-hash":382,"keccakjs":432,"rlp":462,"secp256k1":464}],418:[function(require,module,exports){ +},{"assert":48,"bn.js":54,"buffer":84,"create-hash":383,"keccakjs":433,"rlp":462,"secp256k1":464}],419:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -59006,7 +59609,7 @@ function isUndefined(arg) { return arg === void 0; } -},{}],419:[function(require,module,exports){ +},{}],420:[function(require,module,exports){ (function (Buffer){ var md5 = require('create-hash/md5') module.exports = EVP_BytesToKey @@ -59078,7 +59681,7 @@ function EVP_BytesToKey (password, salt, keyLen, ivLen) { } }).call(this,require("buffer").Buffer) -},{"buffer":83,"create-hash/md5":384}],420:[function(require,module,exports){ +},{"buffer":84,"create-hash/md5":385}],421:[function(require,module,exports){ var hash = exports; hash.utils = require('./hash/utils'); @@ -59095,7 +59698,7 @@ hash.sha384 = hash.sha.sha384; hash.sha512 = hash.sha.sha512; hash.ripemd160 = hash.ripemd.ripemd160; -},{"./hash/common":421,"./hash/hmac":422,"./hash/ripemd":423,"./hash/sha":424,"./hash/utils":425}],421:[function(require,module,exports){ +},{"./hash/common":422,"./hash/hmac":423,"./hash/ripemd":424,"./hash/sha":425,"./hash/utils":426}],422:[function(require,module,exports){ var hash = require('../hash'); var utils = hash.utils; var assert = utils.assert; @@ -59188,7 +59791,7 @@ BlockHash.prototype._pad = function pad() { return res; }; -},{"../hash":420}],422:[function(require,module,exports){ +},{"../hash":421}],423:[function(require,module,exports){ var hmac = exports; var hash = require('../hash'); @@ -59238,7 +59841,7 @@ Hmac.prototype.digest = function digest(enc) { return this.outer.digest(enc); }; -},{"../hash":420}],423:[function(require,module,exports){ +},{"../hash":421}],424:[function(require,module,exports){ var hash = require('../hash'); var utils = hash.utils; @@ -59384,7 +59987,7 @@ var sh = [ 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 ]; -},{"../hash":420}],424:[function(require,module,exports){ +},{"../hash":421}],425:[function(require,module,exports){ var hash = require('../hash'); var utils = hash.utils; var assert = utils.assert; @@ -59950,7 +60553,7 @@ function g1_512_lo(xh, xl) { return r; } -},{"../hash":420}],425:[function(require,module,exports){ +},{"../hash":421}],426:[function(require,module,exports){ var utils = exports; var inherits = require('inherits'); @@ -60209,7 +60812,7 @@ function shr64_lo(ah, al, num) { }; exports.shr64_lo = shr64_lo; -},{"inherits":428}],426:[function(require,module,exports){ +},{"inherits":429}],427:[function(require,module,exports){ exports.read = function (buffer, offset, isLE, mLen, nBytes) { var e, m var eLen = nBytes * 8 - mLen - 1 @@ -60295,7 +60898,7 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { buffer[offset + i - d] |= s * 128 } -},{}],427:[function(require,module,exports){ +},{}],428:[function(require,module,exports){ var indexOf = [].indexOf; @@ -60306,7 +60909,7 @@ module.exports = function(arr, obj){ } return -1; }; -},{}],428:[function(require,module,exports){ +},{}],429:[function(require,module,exports){ if (typeof Object.create === 'function') { // implementation from standard node.js 'util' module module.exports = function inherits(ctor, superCtor) { @@ -60331,7 +60934,7 @@ if (typeof Object.create === 'function') { } } -},{}],429:[function(require,module,exports){ +},{}],430:[function(require,module,exports){ /** * Determine if an object is Buffer * @@ -60350,14 +60953,14 @@ module.exports = function (obj) { )) } -},{}],430:[function(require,module,exports){ +},{}],431:[function(require,module,exports){ var toString = {}.toString; module.exports = Array.isArray || function (arr) { return toString.call(arr) == '[object Array]'; }; -},{}],431:[function(require,module,exports){ +},{}],432:[function(require,module,exports){ (function (global){ /* * js-sha3 v0.3.1 @@ -60793,10 +61396,10 @@ module.exports = Array.isArray || function (arr) { }(this)); }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],432:[function(require,module,exports){ +},{}],433:[function(require,module,exports){ module.exports = require('browserify-sha3').SHA3Hash -},{"browserify-sha3":75}],433:[function(require,module,exports){ +},{"browserify-sha3":76}],434:[function(require,module,exports){ (function (global){ /** * marked - a markdown parser @@ -62085,7 +62688,7 @@ if (typeof module !== 'undefined' && typeof exports === 'object') { }()); }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],434:[function(require,module,exports){ +},{}],435:[function(require,module,exports){ var bn = require('bn.js'); var brorand = require('brorand'); @@ -62200,7 +62803,7 @@ MillerRabin.prototype.getDivisor = function getDivisor(n, k) { return false; }; -},{"bn.js":53,"brorand":54}],435:[function(require,module,exports){ +},{"bn.js":54,"brorand":55}],436:[function(require,module,exports){ module.exports = assert; function assert(val, msg) { @@ -62213,7 +62816,7 @@ assert.equal = function assertEqual(l, r, msg) { throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r)); }; -},{}],436:[function(require,module,exports){ +},{}],437:[function(require,module,exports){ module.exports={"2.16.840.1.101.3.4.1.1": "aes-128-ecb", "2.16.840.1.101.3.4.1.2": "aes-128-cbc", "2.16.840.1.101.3.4.1.3": "aes-128-ofb", @@ -62227,7 +62830,7 @@ module.exports={"2.16.840.1.101.3.4.1.1": "aes-128-ecb", "2.16.840.1.101.3.4.1.43": "aes-256-ofb", "2.16.840.1.101.3.4.1.44": "aes-256-cfb" } -},{}],437:[function(require,module,exports){ +},{}],438:[function(require,module,exports){ // from https://github.com/indutny/self-signed/blob/gh-pages/lib/asn1.js // Fedor, you are amazing. @@ -62346,7 +62949,7 @@ exports.signature = asn1.define('signature', function () { ) }) -},{"asn1.js":34}],438:[function(require,module,exports){ +},{"asn1.js":34}],439:[function(require,module,exports){ (function (Buffer){ // adapted from https://github.com/apatil/pemstrip var findProc = /Proc-Type: 4,ENCRYPTED\r?\nDEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)\r?\n\r?\n([0-9A-z\n\r\+\/\=]+)\r?\n/m @@ -62380,7 +62983,7 @@ module.exports = function (okey, password) { } }).call(this,require("buffer").Buffer) -},{"browserify-aes":58,"buffer":83,"evp_bytestokey":419}],439:[function(require,module,exports){ +},{"browserify-aes":59,"buffer":84,"evp_bytestokey":420}],440:[function(require,module,exports){ (function (Buffer){ var asn1 = require('./asn1') var aesid = require('./aesid.json') @@ -62485,7 +63088,7 @@ function decrypt (data, password) { } }).call(this,require("buffer").Buffer) -},{"./aesid.json":436,"./asn1":437,"./fixProc":438,"browserify-aes":58,"buffer":83,"pbkdf2":440}],440:[function(require,module,exports){ +},{"./aesid.json":437,"./asn1":438,"./fixProc":439,"browserify-aes":59,"buffer":84,"pbkdf2":441}],441:[function(require,module,exports){ (function (Buffer){ var createHmac = require('create-hmac') var MAX_ALLOC = Math.pow(2, 30) - 1 // default in iojs @@ -62569,7 +63172,7 @@ function pbkdf2Sync (password, salt, iterations, keylen, digest) { } }).call(this,require("buffer").Buffer) -},{"buffer":83,"create-hmac":385}],441:[function(require,module,exports){ +},{"buffer":84,"create-hmac":386}],442:[function(require,module,exports){ (function (process){ 'use strict'; @@ -62616,7 +63219,7 @@ function nextTick(fn, arg1, arg2, arg3) { } }).call(this,require('_process')) -},{"_process":442}],442:[function(require,module,exports){ +},{"_process":443}],443:[function(require,module,exports){ // shim for using process in browser var process = module.exports = {}; @@ -62712,7 +63315,7 @@ process.chdir = function (dir) { }; process.umask = function() { return 0; }; -},{}],443:[function(require,module,exports){ +},{}],444:[function(require,module,exports){ exports.publicEncrypt = require('./publicEncrypt'); exports.privateDecrypt = require('./privateDecrypt'); @@ -62723,7 +63326,7 @@ exports.privateEncrypt = function privateEncrypt(key, buf) { exports.publicDecrypt = function publicDecrypt(key, buf) { return exports.privateDecrypt(key, buf, true); }; -},{"./privateDecrypt":445,"./publicEncrypt":446}],444:[function(require,module,exports){ +},{"./privateDecrypt":446,"./publicEncrypt":447}],445:[function(require,module,exports){ (function (Buffer){ var createHash = require('create-hash'); module.exports = function (seed, len) { @@ -62742,7 +63345,7 @@ function i2ops(c) { return out; } }).call(this,require("buffer").Buffer) -},{"buffer":83,"create-hash":382}],445:[function(require,module,exports){ +},{"buffer":84,"create-hash":383}],446:[function(require,module,exports){ (function (Buffer){ var parseKeys = require('parse-asn1'); var mgf = require('./mgf'); @@ -62853,7 +63456,7 @@ function compare(a, b){ return dif; } }).call(this,require("buffer").Buffer) -},{"./mgf":444,"./withPublic":447,"./xor":448,"bn.js":53,"browserify-rsa":74,"buffer":83,"create-hash":382,"parse-asn1":439}],446:[function(require,module,exports){ +},{"./mgf":445,"./withPublic":448,"./xor":449,"bn.js":54,"browserify-rsa":75,"buffer":84,"create-hash":383,"parse-asn1":440}],447:[function(require,module,exports){ (function (Buffer){ var parseKeys = require('parse-asn1'); var randomBytes = require('randombytes'); @@ -62927,2506 +63530,1834 @@ function pkcs1(key, msg, reverse){ if (reverse) { ps = new Buffer(k - mLen - 3); ps.fill(0xff); - } else { - ps = nonZero(k - mLen - 3); - } - return new bn(Buffer.concat([new Buffer([0, reverse?1:2]), ps, new Buffer([0]), msg], k)); -} -function nonZero(len, crypto) { - var out = new Buffer(len); - var i = 0; - var cache = randomBytes(len*2); - var cur = 0; - var num; - while (i < len) { - if (cur === cache.length) { - cache = randomBytes(len*2); - cur = 0; - } - num = cache[cur++]; - if (num) { - out[i++] = num; - } - } - return out; -} -}).call(this,require("buffer").Buffer) -},{"./mgf":444,"./withPublic":447,"./xor":448,"bn.js":53,"browserify-rsa":74,"buffer":83,"create-hash":382,"parse-asn1":439,"randombytes":449}],447:[function(require,module,exports){ -(function (Buffer){ -var bn = require('bn.js'); -function withPublic(paddedMsg, key) { - return new Buffer(paddedMsg - .toRed(bn.mont(key.modulus)) - .redPow(new bn(key.publicExponent)) - .fromRed() - .toArray()); -} - -module.exports = withPublic; -}).call(this,require("buffer").Buffer) -},{"bn.js":53,"buffer":83}],448:[function(require,module,exports){ -module.exports = function xor(a, b) { - var len = a.length; - var i = -1; - while (++i < len) { - a[i] ^= b[i]; - } - return a -}; -},{}],449:[function(require,module,exports){ -(function (process,global,Buffer){ -'use strict' - -function oldBrowser () { - throw new Error('secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11') -} - -var crypto = global.crypto || global.msCrypto - -if (crypto && crypto.getRandomValues) { - module.exports = randomBytes -} else { - module.exports = oldBrowser -} - -function randomBytes (size, cb) { - // phantomjs needs to throw - if (size > 65536) throw new Error('requested too many random bytes') - // in case browserify isn't using the Uint8Array version - var rawBytes = new global.Uint8Array(size) - - // This will not work in older browsers. - // See https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues - if (size > 0) { // getRandomValues fails on IE if size == 0 - crypto.getRandomValues(rawBytes) - } - // phantomjs doesn't like a buffer being passed here - var bytes = new Buffer(rawBytes.buffer) - - if (typeof cb === 'function') { - return process.nextTick(function () { - cb(null, bytes) - }) - } - - return bytes -} - -}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer) -},{"_process":442,"buffer":83}],450:[function(require,module,exports){ -module.exports = require("./lib/_stream_duplex.js") - -},{"./lib/_stream_duplex.js":451}],451:[function(require,module,exports){ -// a duplex stream is just a stream that is both readable and writable. -// Since JS doesn't have multiple prototypal inheritance, this class -// prototypally inherits from Readable, and then parasitically from -// Writable. - -'use strict'; - -/**/ - -var objectKeys = Object.keys || function (obj) { - var keys = []; - for (var key in obj) { - keys.push(key); - }return keys; -}; -/**/ - -module.exports = Duplex; - -/**/ -var processNextTick = require('process-nextick-args'); -/**/ - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -var Readable = require('./_stream_readable'); -var Writable = require('./_stream_writable'); - -util.inherits(Duplex, Readable); - -var keys = objectKeys(Writable.prototype); -for (var v = 0; v < keys.length; v++) { - var method = keys[v]; - if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; -} - -function Duplex(options) { - if (!(this instanceof Duplex)) return new Duplex(options); - - Readable.call(this, options); - Writable.call(this, options); - - if (options && options.readable === false) this.readable = false; - - if (options && options.writable === false) this.writable = false; - - this.allowHalfOpen = true; - if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; - - this.once('end', onend); -} - -// the no-half-open enforcer -function onend() { - // if we allow half-open state, or if the writable side ended, - // then we're ok. - if (this.allowHalfOpen || this._writableState.ended) return; - - // no more data can be written. - // But allow more writes to happen in this tick. - processNextTick(onEndNT, this); -} - -function onEndNT(self) { - self.end(); -} - -function forEach(xs, f) { - for (var i = 0, l = xs.length; i < l; i++) { - f(xs[i], i); - } -} -},{"./_stream_readable":453,"./_stream_writable":455,"core-util-is":380,"inherits":428,"process-nextick-args":441}],452:[function(require,module,exports){ -// a passthrough stream. -// basically just the most minimal sort of Transform stream. -// Every written chunk gets output as-is. - -'use strict'; - -module.exports = PassThrough; - -var Transform = require('./_stream_transform'); - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -util.inherits(PassThrough, Transform); - -function PassThrough(options) { - if (!(this instanceof PassThrough)) return new PassThrough(options); - - Transform.call(this, options); -} - -PassThrough.prototype._transform = function (chunk, encoding, cb) { - cb(null, chunk); -}; -},{"./_stream_transform":454,"core-util-is":380,"inherits":428}],453:[function(require,module,exports){ -(function (process){ -'use strict'; - -module.exports = Readable; - -/**/ -var processNextTick = require('process-nextick-args'); -/**/ - -/**/ -var isArray = require('isarray'); -/**/ - -Readable.ReadableState = ReadableState; - -/**/ -var EE = require('events').EventEmitter; - -var EElistenerCount = function (emitter, type) { - return emitter.listeners(type).length; -}; -/**/ - -/**/ -var Stream; -(function () { - try { - Stream = require('st' + 'ream'); - } catch (_) {} finally { - if (!Stream) Stream = require('events').EventEmitter; - } -})(); -/**/ - -var Buffer = require('buffer').Buffer; -/**/ -var bufferShim = require('buffer-shims'); -/**/ - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -/**/ -var debugUtil = require('util'); -var debug = void 0; -if (debugUtil && debugUtil.debuglog) { - debug = debugUtil.debuglog('stream'); -} else { - debug = function () {}; -} -/**/ - -var StringDecoder; - -util.inherits(Readable, Stream); - -var hasPrependListener = typeof EE.prototype.prependListener === 'function'; - -function prependListener(emitter, event, fn) { - if (hasPrependListener) return emitter.prependListener(event, fn); - - // This is a brutally ugly hack to make sure that our error handler - // is attached before any userland ones. NEVER DO THIS. This is here - // only because this code needs to continue to work with older versions - // of Node.js that do not include the prependListener() method. The goal - // is to eventually remove this hack. - if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; -} - -var Duplex; -function ReadableState(options, stream) { - Duplex = Duplex || require('./_stream_duplex'); - - options = options || {}; - - // object stream flag. Used to make read(n) ignore n and to - // make all the buffer merging and length checks go away - this.objectMode = !!options.objectMode; - - if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode; - - // the point at which it stops calling _read() to fill the buffer - // Note: 0 is a valid value, means "don't call _read preemptively ever" - var hwm = options.highWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; - - // cast to ints. - this.highWaterMark = ~ ~this.highWaterMark; - - this.buffer = []; - this.length = 0; - this.pipes = null; - this.pipesCount = 0; - this.flowing = null; - this.ended = false; - this.endEmitted = false; - this.reading = false; - - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; - - // whenever we return null, then we set a flag to say - // that we're awaiting a 'readable' event emission. - this.needReadable = false; - this.emittedReadable = false; - this.readableListening = false; - this.resumeScheduled = false; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // when piping, we only care about 'readable' events that happen - // after read()ing all the bytes and not getting any pushback. - this.ranOut = false; - - // the number of writers that are awaiting a drain event in .pipe()s - this.awaitDrain = 0; - - // if true, a maybeReadMore has been scheduled - this.readingMore = false; - - this.decoder = null; - this.encoding = null; - if (options.encoding) { - if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; - this.decoder = new StringDecoder(options.encoding); - this.encoding = options.encoding; - } -} - -var Duplex; -function Readable(options) { - Duplex = Duplex || require('./_stream_duplex'); - - if (!(this instanceof Readable)) return new Readable(options); - - this._readableState = new ReadableState(options, this); - - // legacy - this.readable = true; - - if (options && typeof options.read === 'function') this._read = options.read; - - Stream.call(this); -} - -// Manually shove something into the read() buffer. -// This returns true if the highWaterMark has not been hit yet, -// similar to how Writable.write() returns true if you should -// write() some more. -Readable.prototype.push = function (chunk, encoding) { - var state = this._readableState; - - if (!state.objectMode && typeof chunk === 'string') { - encoding = encoding || state.defaultEncoding; - if (encoding !== state.encoding) { - chunk = bufferShim.from(chunk, encoding); - encoding = ''; - } - } - - return readableAddChunk(this, state, chunk, encoding, false); -}; - -// Unshift should *always* be something directly out of read() -Readable.prototype.unshift = function (chunk) { - var state = this._readableState; - return readableAddChunk(this, state, chunk, '', true); -}; - -Readable.prototype.isPaused = function () { - return this._readableState.flowing === false; -}; - -function readableAddChunk(stream, state, chunk, encoding, addToFront) { - var er = chunkInvalid(state, chunk); - if (er) { - stream.emit('error', er); - } else if (chunk === null) { - state.reading = false; - onEofChunk(stream, state); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (state.ended && !addToFront) { - var e = new Error('stream.push() after EOF'); - stream.emit('error', e); - } else if (state.endEmitted && addToFront) { - var _e = new Error('stream.unshift() after end event'); - stream.emit('error', _e); - } else { - var skipAdd; - if (state.decoder && !addToFront && !encoding) { - chunk = state.decoder.write(chunk); - skipAdd = !state.objectMode && chunk.length === 0; - } - - if (!addToFront) state.reading = false; - - // Don't add to the buffer if we've decoded to an empty string chunk and - // we're not in object mode - if (!skipAdd) { - // if we want the data now, just emit it. - if (state.flowing && state.length === 0 && !state.sync) { - stream.emit('data', chunk); - stream.read(0); - } else { - // update the buffer info. - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); - - if (state.needReadable) emitReadable(stream); - } - } - - maybeReadMore(stream, state); - } - } else if (!addToFront) { - state.reading = false; - } - - return needMoreData(state); -} - -// if it's past the high water mark, we can push in some more. -// Also, if we have no data yet, we can stand some -// more bytes. This is to work around cases where hwm=0, -// such as the repl. Also, if the push() triggered a -// readable event, and the user called read(largeNumber) such that -// needReadable was set, then we ought to push more, so that another -// 'readable' event will be triggered. -function needMoreData(state) { - return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); -} - -// backwards compatibility. -Readable.prototype.setEncoding = function (enc) { - if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; - this._readableState.decoder = new StringDecoder(enc); - this._readableState.encoding = enc; - return this; -}; - -// Don't raise the hwm > 8MB -var MAX_HWM = 0x800000; -function computeNewHighWaterMark(n) { - if (n >= MAX_HWM) { - n = MAX_HWM; - } else { - // Get the next highest power of 2 - n--; - n |= n >>> 1; - n |= n >>> 2; - n |= n >>> 4; - n |= n >>> 8; - n |= n >>> 16; - n++; + } else { + ps = nonZero(k - mLen - 3); } - return n; + return new bn(Buffer.concat([new Buffer([0, reverse?1:2]), ps, new Buffer([0]), msg], k)); } - -function howMuchToRead(n, state) { - if (state.length === 0 && state.ended) return 0; - - if (state.objectMode) return n === 0 ? 0 : 1; - - if (n === null || isNaN(n)) { - // only flow one buffer at a time - if (state.flowing && state.buffer.length) return state.buffer[0].length;else return state.length; +function nonZero(len, crypto) { + var out = new Buffer(len); + var i = 0; + var cache = randomBytes(len*2); + var cur = 0; + var num; + while (i < len) { + if (cur === cache.length) { + cache = randomBytes(len*2); + cur = 0; + } + num = cache[cur++]; + if (num) { + out[i++] = num; + } } + return out; +} +}).call(this,require("buffer").Buffer) +},{"./mgf":445,"./withPublic":448,"./xor":449,"bn.js":54,"browserify-rsa":75,"buffer":84,"create-hash":383,"parse-asn1":440,"randombytes":450}],448:[function(require,module,exports){ +(function (Buffer){ +var bn = require('bn.js'); +function withPublic(paddedMsg, key) { + return new Buffer(paddedMsg + .toRed(bn.mont(key.modulus)) + .redPow(new bn(key.publicExponent)) + .fromRed() + .toArray()); +} - if (n <= 0) return 0; +module.exports = withPublic; +}).call(this,require("buffer").Buffer) +},{"bn.js":54,"buffer":84}],449:[function(require,module,exports){ +module.exports = function xor(a, b) { + var len = a.length; + var i = -1; + while (++i < len) { + a[i] ^= b[i]; + } + return a +}; +},{}],450:[function(require,module,exports){ +(function (process,global,Buffer){ +'use strict' - // If we're asking for more than the target buffer level, - // then raise the water mark. Bump up to the next highest - // power of 2, to prevent increasing it excessively in tiny - // amounts. - if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); +function oldBrowser () { + throw new Error('secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11') +} - // don't have that much. return null, unless we've ended. - if (n > state.length) { - if (!state.ended) { - state.needReadable = true; - return 0; - } else { - return state.length; - } - } +var crypto = global.crypto || global.msCrypto - return n; +if (crypto && crypto.getRandomValues) { + module.exports = randomBytes +} else { + module.exports = oldBrowser } -// you can override either this method, or the async _read(n) below. -Readable.prototype.read = function (n) { - debug('read', n); - var state = this._readableState; - var nOrig = n; +function randomBytes (size, cb) { + // phantomjs needs to throw + if (size > 65536) throw new Error('requested too many random bytes') + // in case browserify isn't using the Uint8Array version + var rawBytes = new global.Uint8Array(size) - if (typeof n !== 'number' || n > 0) state.emittedReadable = false; + // This will not work in older browsers. + // See https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues + if (size > 0) { // getRandomValues fails on IE if size == 0 + crypto.getRandomValues(rawBytes) + } + // phantomjs doesn't like a buffer being passed here + var bytes = new Buffer(rawBytes.buffer) - // if we're doing read(0) to trigger a readable event, but we - // already have a bunch of data in the buffer, then just trigger - // the 'readable' event and move on. - if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { - debug('read: emitReadable', state.length, state.ended); - if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); - return null; + if (typeof cb === 'function') { + return process.nextTick(function () { + cb(null, bytes) + }) } - n = howMuchToRead(n, state); + return bytes +} - // if we've ended, and we're now clear, then finish it up. - if (n === 0 && state.ended) { - if (state.length === 0) endReadable(this); - return null; - } +}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer) +},{"_process":443,"buffer":84}],451:[function(require,module,exports){ +module.exports = require("./lib/_stream_duplex.js") - // All the actual chunk generation logic needs to be - // *below* the call to _read. The reason is that in certain - // synthetic stream cases, such as passthrough streams, _read - // may be a completely synchronous operation which may change - // the state of the read buffer, providing enough data when - // before there was *not* enough. - // - // So, the steps are: - // 1. Figure out what the state of things will be after we do - // a read from the buffer. - // - // 2. If that resulting state will trigger a _read, then call _read. - // Note that this may be asynchronous, or synchronous. Yes, it is - // deeply ugly to write APIs this way, but that still doesn't mean - // that the Readable class should behave improperly, as streams are - // designed to be sync/async agnostic. - // Take note if the _read call is sync or async (ie, if the read call - // has returned yet), so that we know whether or not it's safe to emit - // 'readable' etc. - // - // 3. Actually pull the requested chunks out of the buffer and return. +},{"./lib/_stream_duplex.js":452}],452:[function(require,module,exports){ +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. - // if we need a readable event, then we need to do some reading. - var doRead = state.needReadable; - debug('need readable', doRead); +'use strict'; - // if we currently have less than the highWaterMark, then also read some - if (state.length === 0 || state.length - n < state.highWaterMark) { - doRead = true; - debug('length less than watermark', doRead); - } +/**/ - // however, if we've ended, then there's no point, and if we're already - // reading, then it's unnecessary. - if (state.ended || state.reading) { - doRead = false; - debug('reading or ended', doRead); - } +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) { + keys.push(key); + }return keys; +}; +/**/ - if (doRead) { - debug('do read'); - state.reading = true; - state.sync = true; - // if the length is currently zero, then we *need* a readable event. - if (state.length === 0) state.needReadable = true; - // call internal read method - this._read(state.highWaterMark); - state.sync = false; - } +module.exports = Duplex; - // If _read pushed data synchronously, then `reading` will be false, - // and we need to re-evaluate how much data we can return to the user. - if (doRead && !state.reading) n = howMuchToRead(nOrig, state); +/**/ +var processNextTick = require('process-nextick-args'); +/**/ - var ret; - if (n > 0) ret = fromList(n, state);else ret = null; +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ - if (ret === null) { - state.needReadable = true; - n = 0; - } +var Readable = require('./_stream_readable'); +var Writable = require('./_stream_writable'); - state.length -= n; +util.inherits(Duplex, Readable); - // If we have nothing in the buffer, then we want to know - // as soon as we *do* get something into the buffer. - if (state.length === 0 && !state.ended) state.needReadable = true; +var keys = objectKeys(Writable.prototype); +for (var v = 0; v < keys.length; v++) { + var method = keys[v]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; +} - // If we tried to read() past the EOF, then emit end on the next tick. - if (nOrig !== n && state.ended && state.length === 0) endReadable(this); +function Duplex(options) { + if (!(this instanceof Duplex)) return new Duplex(options); - if (ret !== null) this.emit('data', ret); + Readable.call(this, options); + Writable.call(this, options); - return ret; -}; + if (options && options.readable === false) this.readable = false; -function chunkInvalid(state, chunk) { - var er = null; - if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - return er; -} + if (options && options.writable === false) this.writable = false; -function onEofChunk(stream, state) { - if (state.ended) return; - if (state.decoder) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; - } - } - state.ended = true; + this.allowHalfOpen = true; + if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; - // emit 'readable' now to make sure it gets picked up. - emitReadable(stream); + this.once('end', onend); } -// Don't emit readable right away in sync mode, because this can trigger -// another read() call => stack overflow. This way, it might trigger -// a nextTick recursion warning, but that's not so bad. -function emitReadable(stream) { - var state = stream._readableState; - state.needReadable = false; - if (!state.emittedReadable) { - debug('emitReadable', state.flowing); - state.emittedReadable = true; - if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream); - } -} +// the no-half-open enforcer +function onend() { + // if we allow half-open state, or if the writable side ended, + // then we're ok. + if (this.allowHalfOpen || this._writableState.ended) return; -function emitReadable_(stream) { - debug('emit readable'); - stream.emit('readable'); - flow(stream); + // no more data can be written. + // But allow more writes to happen in this tick. + processNextTick(onEndNT, this); } -// at this point, the user has presumably seen the 'readable' event, -// and called read() to consume some data. that may have triggered -// in turn another _read(n) call, in which case reading = true if -// it's in progress. -// However, if we're not ended, or reading, and the length < hwm, -// then go ahead and try to read some more preemptively. -function maybeReadMore(stream, state) { - if (!state.readingMore) { - state.readingMore = true; - processNextTick(maybeReadMore_, stream, state); - } +function onEndNT(self) { + self.end(); } -function maybeReadMore_(stream, state) { - var len = state.length; - while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { - debug('maybeReadMore read 0'); - stream.read(0); - if (len === state.length) - // didn't get any data, stop spinning. - break;else len = state.length; +function forEach(xs, f) { + for (var i = 0, l = xs.length; i < l; i++) { + f(xs[i], i); } - state.readingMore = false; } +},{"./_stream_readable":454,"./_stream_writable":456,"core-util-is":381,"inherits":429,"process-nextick-args":442}],453:[function(require,module,exports){ +// a passthrough stream. +// basically just the most minimal sort of Transform stream. +// Every written chunk gets output as-is. -// abstract method. to be overridden in specific implementation classes. -// call cb(er, data) where data is <= n in length. -// for virtual (non-string, non-buffer) streams, "length" is somewhat -// arbitrary, and perhaps not very meaningful. -Readable.prototype._read = function (n) { - this.emit('error', new Error('not implemented')); -}; - -Readable.prototype.pipe = function (dest, pipeOpts) { - var src = this; - var state = this._readableState; +'use strict'; - switch (state.pipesCount) { - case 0: - state.pipes = dest; - break; - case 1: - state.pipes = [state.pipes, dest]; - break; - default: - state.pipes.push(dest); - break; - } - state.pipesCount += 1; - debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); +module.exports = PassThrough; - var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; +var Transform = require('./_stream_transform'); - var endFn = doEnd ? onend : cleanup; - if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn); +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ - dest.on('unpipe', onunpipe); - function onunpipe(readable) { - debug('onunpipe'); - if (readable === src) { - cleanup(); - } - } +util.inherits(PassThrough, Transform); - function onend() { - debug('onend'); - dest.end(); - } +function PassThrough(options) { + if (!(this instanceof PassThrough)) return new PassThrough(options); - // when the dest drains, it reduces the awaitDrain counter - // on the source. This would be more elegant with a .once() - // handler in flow(), but adding and removing repeatedly is - // too slow. - var ondrain = pipeOnDrain(src); - dest.on('drain', ondrain); + Transform.call(this, options); +} - var cleanedUp = false; - function cleanup() { - debug('cleanup'); - // cleanup event handlers once the pipe is broken - dest.removeListener('close', onclose); - dest.removeListener('finish', onfinish); - dest.removeListener('drain', ondrain); - dest.removeListener('error', onerror); - dest.removeListener('unpipe', onunpipe); - src.removeListener('end', onend); - src.removeListener('end', cleanup); - src.removeListener('data', ondata); +PassThrough.prototype._transform = function (chunk, encoding, cb) { + cb(null, chunk); +}; +},{"./_stream_transform":455,"core-util-is":381,"inherits":429}],454:[function(require,module,exports){ +(function (process){ +'use strict'; - cleanedUp = true; +module.exports = Readable; - // if the reader is waiting for a drain event from this - // specific writer, then it would cause it to never start - // flowing again. - // So, if this is awaiting a drain, then we just call it now. - // If we don't know, then assume that we are waiting for one. - if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); - } +/**/ +var processNextTick = require('process-nextick-args'); +/**/ - src.on('data', ondata); - function ondata(chunk) { - debug('ondata'); - var ret = dest.write(chunk); - if (false === ret) { - // If the user unpiped during `dest.write()`, it is possible - // to get stuck in a permanently paused state if that write - // also returned false. - // => Check whether `dest` is still a piping destination. - if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { - debug('false write response, pause', src._readableState.awaitDrain); - src._readableState.awaitDrain++; - } - src.pause(); - } - } +/**/ +var isArray = require('isarray'); +/**/ - // if the dest has an error, then stop piping into it. - // however, don't suppress the throwing behavior for this. - function onerror(er) { - debug('onerror', er); - unpipe(); - dest.removeListener('error', onerror); - if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); - } +Readable.ReadableState = ReadableState; - // Make sure our error handler is attached before userland ones. - prependListener(dest, 'error', onerror); +/**/ +var EE = require('events').EventEmitter; - // Both close and finish should trigger unpipe, but only once. - function onclose() { - dest.removeListener('finish', onfinish); - unpipe(); - } - dest.once('close', onclose); - function onfinish() { - debug('onfinish'); - dest.removeListener('close', onclose); - unpipe(); - } - dest.once('finish', onfinish); +var EElistenerCount = function (emitter, type) { + return emitter.listeners(type).length; +}; +/**/ - function unpipe() { - debug('unpipe'); - src.unpipe(dest); +/**/ +var Stream; +(function () { + try { + Stream = require('st' + 'ream'); + } catch (_) {} finally { + if (!Stream) Stream = require('events').EventEmitter; } +})(); +/**/ - // tell the dest that it's being piped to - dest.emit('pipe', src); - - // start the flow if it hasn't been started already. - if (!state.flowing) { - debug('pipe resume'); - src.resume(); - } +var Buffer = require('buffer').Buffer; +/**/ +var bufferShim = require('buffer-shims'); +/**/ - return dest; -}; +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ -function pipeOnDrain(src) { - return function () { - var state = src._readableState; - debug('pipeOnDrain', state.awaitDrain); - if (state.awaitDrain) state.awaitDrain--; - if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { - state.flowing = true; - flow(src); - } - }; +/**/ +var debugUtil = require('util'); +var debug = void 0; +if (debugUtil && debugUtil.debuglog) { + debug = debugUtil.debuglog('stream'); +} else { + debug = function () {}; } +/**/ -Readable.prototype.unpipe = function (dest) { - var state = this._readableState; - - // if we're not piping anywhere, then do nothing. - if (state.pipesCount === 0) return this; - - // just one destination. most common case. - if (state.pipesCount === 1) { - // passed in one, but it's not the right one. - if (dest && dest !== state.pipes) return this; - - if (!dest) dest = state.pipes; - - // got a match. - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - if (dest) dest.emit('unpipe', this); - return this; - } +var StringDecoder; - // slow case. multiple pipe destinations. +util.inherits(Readable, Stream); - if (!dest) { - // remove all. - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; +var hasPrependListener = typeof EE.prototype.prependListener === 'function'; - for (var _i = 0; _i < len; _i++) { - dests[_i].emit('unpipe', this); - }return this; - } +function prependListener(emitter, event, fn) { + if (hasPrependListener) return emitter.prependListener(event, fn); - // try to find the right one. - var i = indexOf(state.pipes, dest); - if (i === -1) return this; + // This is a brutally ugly hack to make sure that our error handler + // is attached before any userland ones. NEVER DO THIS. This is here + // only because this code needs to continue to work with older versions + // of Node.js that do not include the prependListener() method. The goal + // is to eventually remove this hack. + if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; +} - state.pipes.splice(i, 1); - state.pipesCount -= 1; - if (state.pipesCount === 1) state.pipes = state.pipes[0]; +var Duplex; +function ReadableState(options, stream) { + Duplex = Duplex || require('./_stream_duplex'); - dest.emit('unpipe', this); + options = options || {}; - return this; -}; + // object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away + this.objectMode = !!options.objectMode; -// set up data events if they are asked for -// Ensure readable listeners eventually get something -Readable.prototype.on = function (ev, fn) { - var res = Stream.prototype.on.call(this, ev, fn); + if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode; - // If listening to data, and it has not explicitly been paused, - // then call resume to start the flow of data on the next tick. - if (ev === 'data' && false !== this._readableState.flowing) { - this.resume(); - } + // the point at which it stops calling _read() to fill the buffer + // Note: 0 is a valid value, means "don't call _read preemptively ever" + var hwm = options.highWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; - if (ev === 'readable' && !this._readableState.endEmitted) { - var state = this._readableState; - if (!state.readableListening) { - state.readableListening = true; - state.emittedReadable = false; - state.needReadable = true; - if (!state.reading) { - processNextTick(nReadingNextTick, this); - } else if (state.length) { - emitReadable(this, state); - } - } - } + // cast to ints. + this.highWaterMark = ~ ~this.highWaterMark; - return res; -}; -Readable.prototype.addListener = Readable.prototype.on; + this.buffer = []; + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; + this.ended = false; + this.endEmitted = false; + this.reading = false; -function nReadingNextTick(self) { - debug('readable nexttick read 0'); - self.read(0); -} + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; -// pause() and resume() are remnants of the legacy readable stream API -// If the user uses them, then switch into old mode. -Readable.prototype.resume = function () { - var state = this._readableState; - if (!state.flowing) { - debug('resume'); - state.flowing = true; - resume(this, state); - } - return this; -}; + // whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + this.resumeScheduled = false; -function resume(stream, state) { - if (!state.resumeScheduled) { - state.resumeScheduled = true; - processNextTick(resume_, stream, state); - } -} + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; -function resume_(stream, state) { - if (!state.reading) { - debug('resume read 0'); - stream.read(0); - } + // when piping, we only care about 'readable' events that happen + // after read()ing all the bytes and not getting any pushback. + this.ranOut = false; - state.resumeScheduled = false; - stream.emit('resume'); - flow(stream); - if (state.flowing && !state.reading) stream.read(0); -} + // the number of writers that are awaiting a drain event in .pipe()s + this.awaitDrain = 0; -Readable.prototype.pause = function () { - debug('call pause flowing=%j', this._readableState.flowing); - if (false !== this._readableState.flowing) { - debug('pause'); - this._readableState.flowing = false; - this.emit('pause'); - } - return this; -}; + // if true, a maybeReadMore has been scheduled + this.readingMore = false; -function flow(stream) { - var state = stream._readableState; - debug('flow', state.flowing); - if (state.flowing) { - do { - var chunk = stream.read(); - } while (null !== chunk && state.flowing); + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; } } -// wrap an old-style stream as the async data source. -// This is *not* part of the readable stream interface. -// It is an ugly unfortunate mess of history. -Readable.prototype.wrap = function (stream) { - var state = this._readableState; - var paused = false; - - var self = this; - stream.on('end', function () { - debug('wrapped end'); - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) self.push(chunk); - } +var Duplex; +function Readable(options) { + Duplex = Duplex || require('./_stream_duplex'); - self.push(null); - }); + if (!(this instanceof Readable)) return new Readable(options); - stream.on('data', function (chunk) { - debug('wrapped data'); - if (state.decoder) chunk = state.decoder.write(chunk); + this._readableState = new ReadableState(options, this); - // don't skip over falsy values in objectMode - if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; + // legacy + this.readable = true; - var ret = self.push(chunk); - if (!ret) { - paused = true; - stream.pause(); - } - }); + if (options && typeof options.read === 'function') this._read = options.read; - // proxy all the other methods. - // important when wrapping filters and duplexes. - for (var i in stream) { - if (this[i] === undefined && typeof stream[i] === 'function') { - this[i] = function (method) { - return function () { - return stream[method].apply(stream, arguments); - }; - }(i); - } - } + Stream.call(this); +} - // proxy certain important events. - var events = ['error', 'close', 'destroy', 'pause', 'resume']; - forEach(events, function (ev) { - stream.on(ev, self.emit.bind(self, ev)); - }); +// Manually shove something into the read() buffer. +// This returns true if the highWaterMark has not been hit yet, +// similar to how Writable.write() returns true if you should +// write() some more. +Readable.prototype.push = function (chunk, encoding) { + var state = this._readableState; - // when we try to consume some more bytes, simply unpause the - // underlying stream. - self._read = function (n) { - debug('wrapped _read', n); - if (paused) { - paused = false; - stream.resume(); + if (!state.objectMode && typeof chunk === 'string') { + encoding = encoding || state.defaultEncoding; + if (encoding !== state.encoding) { + chunk = bufferShim.from(chunk, encoding); + encoding = ''; } - }; + } - return self; + return readableAddChunk(this, state, chunk, encoding, false); }; -// exposed for testing purposes only. -Readable._fromList = fromList; - -// Pluck off n bytes from an array of buffers. -// Length is the combined lengths of all the buffers in the list. -function fromList(n, state) { - var list = state.buffer; - var length = state.length; - var stringMode = !!state.decoder; - var objectMode = !!state.objectMode; - var ret; +// Unshift should *always* be something directly out of read() +Readable.prototype.unshift = function (chunk) { + var state = this._readableState; + return readableAddChunk(this, state, chunk, '', true); +}; - // nothing in the list, definitely empty. - if (list.length === 0) return null; +Readable.prototype.isPaused = function () { + return this._readableState.flowing === false; +}; - if (length === 0) ret = null;else if (objectMode) ret = list.shift();else if (!n || n >= length) { - // read it all, truncate the array. - if (stringMode) ret = list.join('');else if (list.length === 1) ret = list[0];else ret = Buffer.concat(list, length); - list.length = 0; - } else { - // read just some of it. - if (n < list[0].length) { - // just take a part of the first list item. - // slice is the same for buffers and strings. - var buf = list[0]; - ret = buf.slice(0, n); - list[0] = buf.slice(n); - } else if (n === list[0].length) { - // first list is a perfect match - ret = list.shift(); +function readableAddChunk(stream, state, chunk, encoding, addToFront) { + var er = chunkInvalid(state, chunk); + if (er) { + stream.emit('error', er); + } else if (chunk === null) { + state.reading = false; + onEofChunk(stream, state); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (state.ended && !addToFront) { + var e = new Error('stream.push() after EOF'); + stream.emit('error', e); + } else if (state.endEmitted && addToFront) { + var _e = new Error('stream.unshift() after end event'); + stream.emit('error', _e); } else { - // complex case. - // we have enough to cover it, but it spans past the first buffer. - if (stringMode) ret = '';else ret = bufferShim.allocUnsafe(n); - - var c = 0; - for (var i = 0, l = list.length; i < l && c < n; i++) { - var _buf = list[0]; - var cpy = Math.min(n - c, _buf.length); + var skipAdd; + if (state.decoder && !addToFront && !encoding) { + chunk = state.decoder.write(chunk); + skipAdd = !state.objectMode && chunk.length === 0; + } - if (stringMode) ret += _buf.slice(0, cpy);else _buf.copy(ret, c, 0, cpy); + if (!addToFront) state.reading = false; - if (cpy < _buf.length) list[0] = _buf.slice(cpy);else list.shift(); + // Don't add to the buffer if we've decoded to an empty string chunk and + // we're not in object mode + if (!skipAdd) { + // if we want the data now, just emit it. + if (state.flowing && state.length === 0 && !state.sync) { + stream.emit('data', chunk); + stream.read(0); + } else { + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); - c += cpy; + if (state.needReadable) emitReadable(stream); + } } + + maybeReadMore(stream, state); } + } else if (!addToFront) { + state.reading = false; } - return ret; -} - -function endReadable(stream) { - var state = stream._readableState; - - // If we get here before consuming all the bytes, then that is a - // bug in node. Should never happen. - if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); - - if (!state.endEmitted) { - state.ended = true; - processNextTick(endReadableNT, state, stream); - } + return needMoreData(state); } -function endReadableNT(state, stream) { - // Check that we didn't get one last unshift. - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit('end'); - } +// if it's past the high water mark, we can push in some more. +// Also, if we have no data yet, we can stand some +// more bytes. This is to work around cases where hwm=0, +// such as the repl. Also, if the push() triggered a +// readable event, and the user called read(largeNumber) such that +// needReadable was set, then we ought to push more, so that another +// 'readable' event will be triggered. +function needMoreData(state) { + return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); } -function forEach(xs, f) { - for (var i = 0, l = xs.length; i < l; i++) { - f(xs[i], i); - } -} +// backwards compatibility. +Readable.prototype.setEncoding = function (enc) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this._readableState.decoder = new StringDecoder(enc); + this._readableState.encoding = enc; + return this; +}; -function indexOf(xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) return i; +// Don't raise the hwm > 8MB +var MAX_HWM = 0x800000; +function computeNewHighWaterMark(n) { + if (n >= MAX_HWM) { + n = MAX_HWM; + } else { + // Get the next highest power of 2 + n--; + n |= n >>> 1; + n |= n >>> 2; + n |= n >>> 4; + n |= n >>> 8; + n |= n >>> 16; + n++; } - return -1; + return n; } -}).call(this,require('_process')) -},{"./_stream_duplex":451,"_process":442,"buffer":83,"buffer-shims":81,"core-util-is":380,"events":418,"inherits":428,"isarray":430,"process-nextick-args":441,"string_decoder/":478,"util":55}],454:[function(require,module,exports){ -// a transform stream is a readable/writable stream where you do -// something with the data. Sometimes it's called a "filter", -// but that's not a great name for it, since that implies a thing where -// some bits pass through, and others are simply ignored. (That would -// be a valid example of a transform, of course.) -// -// While the output is causally related to the input, it's not a -// necessarily symmetric or synchronous transformation. For example, -// a zlib stream might take multiple plain-text writes(), and then -// emit a single compressed chunk some time in the future. -// -// Here's how this works: -// -// The Transform stream has all the aspects of the readable and writable -// stream classes. When you write(chunk), that calls _write(chunk,cb) -// internally, and returns false if there's a lot of pending writes -// buffered up. When you call read(), that calls _read(n) until -// there's enough pending readable data buffered up. -// -// In a transform stream, the written data is placed in a buffer. When -// _read(n) is called, it transforms the queued up data, calling the -// buffered _write cb's as it consumes chunks. If consuming a single -// written chunk would result in multiple output chunks, then the first -// outputted bit calls the readcb, and subsequent chunks just go into -// the read buffer, and will cause it to emit 'readable' if necessary. -// -// This way, back-pressure is actually determined by the reading side, -// since _read has to be called to start processing a new chunk. However, -// a pathological inflate type of transform can cause excessive buffering -// here. For example, imagine a stream where every byte of input is -// interpreted as an integer from 0-255, and then results in that many -// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in -// 1kb of data being output. In this case, you could write a very small -// amount of input, and end up with a very large amount of output. In -// such a pathological inflating mechanism, there'd be no way to tell -// the system to stop doing the transform. A single 4MB write could -// cause the system to run out of memory. -// -// However, even in such a pathological case, only a single written chunk -// would be consumed, and then the rest would wait (un-transformed) until -// the results of the previous transformed chunk were consumed. -'use strict'; +function howMuchToRead(n, state) { + if (state.length === 0 && state.ended) return 0; -module.exports = Transform; + if (state.objectMode) return n === 0 ? 0 : 1; -var Duplex = require('./_stream_duplex'); + if (n === null || isNaN(n)) { + // only flow one buffer at a time + if (state.flowing && state.buffer.length) return state.buffer[0].length;else return state.length; + } -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ + if (n <= 0) return 0; -util.inherits(Transform, Duplex); + // If we're asking for more than the target buffer level, + // then raise the water mark. Bump up to the next highest + // power of 2, to prevent increasing it excessively in tiny + // amounts. + if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); -function TransformState(stream) { - this.afterTransform = function (er, data) { - return afterTransform(stream, er, data); - }; + // don't have that much. return null, unless we've ended. + if (n > state.length) { + if (!state.ended) { + state.needReadable = true; + return 0; + } else { + return state.length; + } + } - this.needTransform = false; - this.transforming = false; - this.writecb = null; - this.writechunk = null; - this.writeencoding = null; + return n; } -function afterTransform(stream, er, data) { - var ts = stream._transformState; - ts.transforming = false; - - var cb = ts.writecb; - - if (!cb) return stream.emit('error', new Error('no writecb in Transform class')); - - ts.writechunk = null; - ts.writecb = null; - - if (data !== null && data !== undefined) stream.push(data); +// you can override either this method, or the async _read(n) below. +Readable.prototype.read = function (n) { + debug('read', n); + var state = this._readableState; + var nOrig = n; - cb(er); + if (typeof n !== 'number' || n > 0) state.emittedReadable = false; - var rs = stream._readableState; - rs.reading = false; - if (rs.needReadable || rs.length < rs.highWaterMark) { - stream._read(rs.highWaterMark); + // if we're doing read(0) to trigger a readable event, but we + // already have a bunch of data in the buffer, then just trigger + // the 'readable' event and move on. + if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { + debug('read: emitReadable', state.length, state.ended); + if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); + return null; } -} - -function Transform(options) { - if (!(this instanceof Transform)) return new Transform(options); - - Duplex.call(this, options); - this._transformState = new TransformState(this); + n = howMuchToRead(n, state); - // when the writable side finishes, then flush out anything remaining. - var stream = this; + // if we've ended, and we're now clear, then finish it up. + if (n === 0 && state.ended) { + if (state.length === 0) endReadable(this); + return null; + } - // start out asking for a readable event once data is transformed. - this._readableState.needReadable = true; + // All the actual chunk generation logic needs to be + // *below* the call to _read. The reason is that in certain + // synthetic stream cases, such as passthrough streams, _read + // may be a completely synchronous operation which may change + // the state of the read buffer, providing enough data when + // before there was *not* enough. + // + // So, the steps are: + // 1. Figure out what the state of things will be after we do + // a read from the buffer. + // + // 2. If that resulting state will trigger a _read, then call _read. + // Note that this may be asynchronous, or synchronous. Yes, it is + // deeply ugly to write APIs this way, but that still doesn't mean + // that the Readable class should behave improperly, as streams are + // designed to be sync/async agnostic. + // Take note if the _read call is sync or async (ie, if the read call + // has returned yet), so that we know whether or not it's safe to emit + // 'readable' etc. + // + // 3. Actually pull the requested chunks out of the buffer and return. - // we have implemented the _read method, and done the other things - // that Readable wants before the first _read call, so unset the - // sync guard flag. - this._readableState.sync = false; + // if we need a readable event, then we need to do some reading. + var doRead = state.needReadable; + debug('need readable', doRead); - if (options) { - if (typeof options.transform === 'function') this._transform = options.transform; + // if we currently have less than the highWaterMark, then also read some + if (state.length === 0 || state.length - n < state.highWaterMark) { + doRead = true; + debug('length less than watermark', doRead); + } - if (typeof options.flush === 'function') this._flush = options.flush; + // however, if we've ended, then there's no point, and if we're already + // reading, then it's unnecessary. + if (state.ended || state.reading) { + doRead = false; + debug('reading or ended', doRead); } - this.once('prefinish', function () { - if (typeof this._flush === 'function') this._flush(function (er) { - done(stream, er); - });else done(stream); - }); -} + if (doRead) { + debug('do read'); + state.reading = true; + state.sync = true; + // if the length is currently zero, then we *need* a readable event. + if (state.length === 0) state.needReadable = true; + // call internal read method + this._read(state.highWaterMark); + state.sync = false; + } -Transform.prototype.push = function (chunk, encoding) { - this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk, encoding); -}; + // If _read pushed data synchronously, then `reading` will be false, + // and we need to re-evaluate how much data we can return to the user. + if (doRead && !state.reading) n = howMuchToRead(nOrig, state); -// This is the part where you do stuff! -// override this function in implementation classes. -// 'chunk' is an input chunk. -// -// Call `push(newChunk)` to pass along transformed output -// to the readable side. You may call 'push' zero or more times. -// -// Call `cb(err)` when you are done with this chunk. If you pass -// an error, then that'll put the hurt on the whole operation. If you -// never call cb(), then you'll never get another chunk. -Transform.prototype._transform = function (chunk, encoding, cb) { - throw new Error('Not implemented'); -}; + var ret; + if (n > 0) ret = fromList(n, state);else ret = null; -Transform.prototype._write = function (chunk, encoding, cb) { - var ts = this._transformState; - ts.writecb = cb; - ts.writechunk = chunk; - ts.writeencoding = encoding; - if (!ts.transforming) { - var rs = this._readableState; - if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); + if (ret === null) { + state.needReadable = true; + n = 0; } -}; - -// Doesn't matter what the args are here. -// _transform does all the work. -// That we got here means that the readable side wants more data. -Transform.prototype._read = function (n) { - var ts = this._transformState; - if (ts.writechunk !== null && ts.writecb && !ts.transforming) { - ts.transforming = true; - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); - } else { - // mark that we need a transform, so that any data that comes in - // will get processed, now that we've asked for it. - ts.needTransform = true; - } -}; + state.length -= n; -function done(stream, er) { - if (er) return stream.emit('error', er); + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (state.length === 0 && !state.ended) state.needReadable = true; - // if there's nothing in the write buffer, then that means - // that nothing more will ever be provided - var ws = stream._writableState; - var ts = stream._transformState; + // If we tried to read() past the EOF, then emit end on the next tick. + if (nOrig !== n && state.ended && state.length === 0) endReadable(this); - if (ws.length) throw new Error('Calling transform done when ws.length != 0'); + if (ret !== null) this.emit('data', ret); - if (ts.transforming) throw new Error('Calling transform done when still transforming'); + return ret; +}; - return stream.push(null); +function chunkInvalid(state, chunk) { + var er = null; + if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + return er; } -},{"./_stream_duplex":451,"core-util-is":380,"inherits":428}],455:[function(require,module,exports){ -(function (process){ -// A bit simpler than readable streams. -// Implement an async ._write(chunk, encoding, cb), and it'll handle all -// the drain event emission and buffering. -'use strict'; +function onEofChunk(stream, state) { + if (state.ended) return; + if (state.decoder) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) { + state.buffer.push(chunk); + state.length += state.objectMode ? 1 : chunk.length; + } + } + state.ended = true; -module.exports = Writable; + // emit 'readable' now to make sure it gets picked up. + emitReadable(stream); +} -/**/ -var processNextTick = require('process-nextick-args'); -/**/ +// Don't emit readable right away in sync mode, because this can trigger +// another read() call => stack overflow. This way, it might trigger +// a nextTick recursion warning, but that's not so bad. +function emitReadable(stream) { + var state = stream._readableState; + state.needReadable = false; + if (!state.emittedReadable) { + debug('emitReadable', state.flowing); + state.emittedReadable = true; + if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream); + } +} -/**/ -var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick; -/**/ +function emitReadable_(stream) { + debug('emit readable'); + stream.emit('readable'); + flow(stream); +} -Writable.WritableState = WritableState; +// at this point, the user has presumably seen the 'readable' event, +// and called read() to consume some data. that may have triggered +// in turn another _read(n) call, in which case reading = true if +// it's in progress. +// However, if we're not ended, or reading, and the length < hwm, +// then go ahead and try to read some more preemptively. +function maybeReadMore(stream, state) { + if (!state.readingMore) { + state.readingMore = true; + processNextTick(maybeReadMore_, stream, state); + } +} -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ +function maybeReadMore_(stream, state) { + var len = state.length; + while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { + debug('maybeReadMore read 0'); + stream.read(0); + if (len === state.length) + // didn't get any data, stop spinning. + break;else len = state.length; + } + state.readingMore = false; +} -/**/ -var internalUtil = { - deprecate: require('util-deprecate') +// abstract method. to be overridden in specific implementation classes. +// call cb(er, data) where data is <= n in length. +// for virtual (non-string, non-buffer) streams, "length" is somewhat +// arbitrary, and perhaps not very meaningful. +Readable.prototype._read = function (n) { + this.emit('error', new Error('not implemented')); }; -/**/ - -/**/ -var Stream; -(function () { - try { - Stream = require('st' + 'ream'); - } catch (_) {} finally { - if (!Stream) Stream = require('events').EventEmitter; - } -})(); -/**/ -var Buffer = require('buffer').Buffer; -/**/ -var bufferShim = require('buffer-shims'); -/**/ +Readable.prototype.pipe = function (dest, pipeOpts) { + var src = this; + var state = this._readableState; -util.inherits(Writable, Stream); + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + case 1: + state.pipes = [state.pipes, dest]; + break; + default: + state.pipes.push(dest); + break; + } + state.pipesCount += 1; + debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); -function nop() {} + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; -function WriteReq(chunk, encoding, cb) { - this.chunk = chunk; - this.encoding = encoding; - this.callback = cb; - this.next = null; -} + var endFn = doEnd ? onend : cleanup; + if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn); -var Duplex; -function WritableState(options, stream) { - Duplex = Duplex || require('./_stream_duplex'); + dest.on('unpipe', onunpipe); + function onunpipe(readable) { + debug('onunpipe'); + if (readable === src) { + cleanup(); + } + } - options = options || {}; + function onend() { + debug('onend'); + dest.end(); + } - // object stream flag to indicate whether or not this stream - // contains buffers or objects. - this.objectMode = !!options.objectMode; + // when the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. + var ondrain = pipeOnDrain(src); + dest.on('drain', ondrain); - if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode; + var cleanedUp = false; + function cleanup() { + debug('cleanup'); + // cleanup event handlers once the pipe is broken + dest.removeListener('close', onclose); + dest.removeListener('finish', onfinish); + dest.removeListener('drain', ondrain); + dest.removeListener('error', onerror); + dest.removeListener('unpipe', onunpipe); + src.removeListener('end', onend); + src.removeListener('end', cleanup); + src.removeListener('data', ondata); - // the point at which write() starts returning false - // Note: 0 is a valid value, means that we always return false if - // the entire buffer is not flushed immediately on write() - var hwm = options.highWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; + cleanedUp = true; - // cast to ints. - this.highWaterMark = ~ ~this.highWaterMark; + // if the reader is waiting for a drain event from this + // specific writer, then it would cause it to never start + // flowing again. + // So, if this is awaiting a drain, then we just call it now. + // If we don't know, then assume that we are waiting for one. + if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); + } - this.needDrain = false; - // at the start of calling end() - this.ending = false; - // when end() has been called, and returned - this.ended = false; - // when 'finish' is emitted - this.finished = false; + src.on('data', ondata); + function ondata(chunk) { + debug('ondata'); + var ret = dest.write(chunk); + if (false === ret) { + // If the user unpiped during `dest.write()`, it is possible + // to get stuck in a permanently paused state if that write + // also returned false. + // => Check whether `dest` is still a piping destination. + if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { + debug('false write response, pause', src._readableState.awaitDrain); + src._readableState.awaitDrain++; + } + src.pause(); + } + } - // should we decode strings into buffers before passing to _write? - // this is here so that some node-core streams can optimize string - // handling at a lower level. - var noDecode = options.decodeStrings === false; - this.decodeStrings = !noDecode; + // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. + function onerror(er) { + debug('onerror', er); + unpipe(); + dest.removeListener('error', onerror); + if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); + } - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; + // Make sure our error handler is attached before userland ones. + prependListener(dest, 'error', onerror); - // not an actual buffer we keep track of, but a measurement - // of how much we're waiting to get pushed to some underlying - // socket or file. - this.length = 0; + // Both close and finish should trigger unpipe, but only once. + function onclose() { + dest.removeListener('finish', onfinish); + unpipe(); + } + dest.once('close', onclose); + function onfinish() { + debug('onfinish'); + dest.removeListener('close', onclose); + unpipe(); + } + dest.once('finish', onfinish); - // a flag to see when we're in the middle of a write. - this.writing = false; + function unpipe() { + debug('unpipe'); + src.unpipe(dest); + } - // when true all writes will be buffered until .uncork() call - this.corked = 0; + // tell the dest that it's being piped to + dest.emit('pipe', src); - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; + // start the flow if it hasn't been started already. + if (!state.flowing) { + debug('pipe resume'); + src.resume(); + } - // a flag to know if we're processing previously buffered items, which - // may call the _write() callback in the same tick, so that we don't - // end up in an overlapped onwrite situation. - this.bufferProcessing = false; + return dest; +}; - // the callback that's passed to _write(chunk,cb) - this.onwrite = function (er) { - onwrite(stream, er); +function pipeOnDrain(src) { + return function () { + var state = src._readableState; + debug('pipeOnDrain', state.awaitDrain); + if (state.awaitDrain) state.awaitDrain--; + if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { + state.flowing = true; + flow(src); + } }; +} - // the callback that the user supplies to write(chunk,encoding,cb) - this.writecb = null; - - // the amount that is being written when _write is called. - this.writelen = 0; +Readable.prototype.unpipe = function (dest) { + var state = this._readableState; - this.bufferedRequest = null; - this.lastBufferedRequest = null; + // if we're not piping anywhere, then do nothing. + if (state.pipesCount === 0) return this; - // number of pending user-supplied write callbacks - // this must be 0 before 'finish' can be emitted - this.pendingcb = 0; + // just one destination. most common case. + if (state.pipesCount === 1) { + // passed in one, but it's not the right one. + if (dest && dest !== state.pipes) return this; - // emit prefinish if the only thing we're waiting for is _write cbs - // This is relevant for synchronous Transform streams - this.prefinished = false; + if (!dest) dest = state.pipes; - // True if the error was already emitted and should not be thrown again - this.errorEmitted = false; + // got a match. + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) dest.emit('unpipe', this); + return this; + } - // count buffered requests - this.bufferedRequestCount = 0; + // slow case. multiple pipe destinations. - // allocate the first CorkedRequest, there is always - // one allocated and free to use, and we maintain at most two - this.corkedRequestsFree = new CorkedRequest(this); -} + if (!dest) { + // remove all. + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; -WritableState.prototype.getBuffer = function writableStateGetBuffer() { - var current = this.bufferedRequest; - var out = []; - while (current) { - out.push(current); - current = current.next; + for (var _i = 0; _i < len; _i++) { + dests[_i].emit('unpipe', this); + }return this; } - return out; -}; - -(function () { - try { - Object.defineProperty(WritableState.prototype, 'buffer', { - get: internalUtil.deprecate(function () { - return this.getBuffer(); - }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.') - }); - } catch (_) {} -})(); -var Duplex; -function Writable(options) { - Duplex = Duplex || require('./_stream_duplex'); + // try to find the right one. + var i = indexOf(state.pipes, dest); + if (i === -1) return this; - // Writable ctor is applied to Duplexes, though they're not - // instanceof Writable, they're instanceof Readable. - if (!(this instanceof Writable) && !(this instanceof Duplex)) return new Writable(options); + state.pipes.splice(i, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) state.pipes = state.pipes[0]; - this._writableState = new WritableState(options, this); + dest.emit('unpipe', this); - // legacy. - this.writable = true; + return this; +}; - if (options) { - if (typeof options.write === 'function') this._write = options.write; +// set up data events if they are asked for +// Ensure readable listeners eventually get something +Readable.prototype.on = function (ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); - if (typeof options.writev === 'function') this._writev = options.writev; + // If listening to data, and it has not explicitly been paused, + // then call resume to start the flow of data on the next tick. + if (ev === 'data' && false !== this._readableState.flowing) { + this.resume(); } - Stream.call(this); -} + if (ev === 'readable' && !this._readableState.endEmitted) { + var state = this._readableState; + if (!state.readableListening) { + state.readableListening = true; + state.emittedReadable = false; + state.needReadable = true; + if (!state.reading) { + processNextTick(nReadingNextTick, this); + } else if (state.length) { + emitReadable(this, state); + } + } + } -// Otherwise people can pipe Writable streams, which is just wrong. -Writable.prototype.pipe = function () { - this.emit('error', new Error('Cannot pipe, not readable')); + return res; }; +Readable.prototype.addListener = Readable.prototype.on; -function writeAfterEnd(stream, cb) { - var er = new Error('write after end'); - // TODO: defer error events consistently everywhere, not just the cb - stream.emit('error', er); - processNextTick(cb, er); -} - -// If we get something that is not a buffer, string, null, or undefined, -// and we're not in objectMode, then that's an error. -// Otherwise stream chunks are all considered to be of length=1, and the -// watermarks determine how many objects to keep in the buffer, rather than -// how many bytes or characters. -function validChunk(stream, state, chunk, cb) { - var valid = true; - var er = false; - // Always throw error if a null is written - // if we are not in object mode then throw - // if it is not a buffer, string, or undefined. - if (chunk === null) { - er = new TypeError('May not write null values to stream'); - } else if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); +function nReadingNextTick(self) { + debug('readable nexttick read 0'); + self.read(0); +} + +// pause() and resume() are remnants of the legacy readable stream API +// If the user uses them, then switch into old mode. +Readable.prototype.resume = function () { + var state = this._readableState; + if (!state.flowing) { + debug('resume'); + state.flowing = true; + resume(this, state); } - if (er) { - stream.emit('error', er); - processNextTick(cb, er); - valid = false; + return this; +}; + +function resume(stream, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + processNextTick(resume_, stream, state); } - return valid; } -Writable.prototype.write = function (chunk, encoding, cb) { - var state = this._writableState; - var ret = false; - - if (typeof encoding === 'function') { - cb = encoding; - encoding = null; +function resume_(stream, state) { + if (!state.reading) { + debug('resume read 0'); + stream.read(0); } - if (Buffer.isBuffer(chunk)) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; + state.resumeScheduled = false; + stream.emit('resume'); + flow(stream); + if (state.flowing && !state.reading) stream.read(0); +} - if (typeof cb !== 'function') cb = nop; +Readable.prototype.pause = function () { + debug('call pause flowing=%j', this._readableState.flowing); + if (false !== this._readableState.flowing) { + debug('pause'); + this._readableState.flowing = false; + this.emit('pause'); + } + return this; +}; - if (state.ended) writeAfterEnd(this, cb);else if (validChunk(this, state, chunk, cb)) { - state.pendingcb++; - ret = writeOrBuffer(this, state, chunk, encoding, cb); +function flow(stream) { + var state = stream._readableState; + debug('flow', state.flowing); + if (state.flowing) { + do { + var chunk = stream.read(); + } while (null !== chunk && state.flowing); } +} - return ret; -}; +// wrap an old-style stream as the async data source. +// This is *not* part of the readable stream interface. +// It is an ugly unfortunate mess of history. +Readable.prototype.wrap = function (stream) { + var state = this._readableState; + var paused = false; -Writable.prototype.cork = function () { - var state = this._writableState; + var self = this; + stream.on('end', function () { + debug('wrapped end'); + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) self.push(chunk); + } - state.corked++; -}; + self.push(null); + }); -Writable.prototype.uncork = function () { - var state = this._writableState; + stream.on('data', function (chunk) { + debug('wrapped data'); + if (state.decoder) chunk = state.decoder.write(chunk); - if (state.corked) { - state.corked--; + // don't skip over falsy values in objectMode + if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; - if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); + var ret = self.push(chunk); + if (!ret) { + paused = true; + stream.pause(); + } + }); + + // proxy all the other methods. + // important when wrapping filters and duplexes. + for (var i in stream) { + if (this[i] === undefined && typeof stream[i] === 'function') { + this[i] = function (method) { + return function () { + return stream[method].apply(stream, arguments); + }; + }(i); + } } -}; -Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { - // node::ParseEncoding() requires lower case. - if (typeof encoding === 'string') encoding = encoding.toLowerCase(); - if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); - this._writableState.defaultEncoding = encoding; - return this; -}; + // proxy certain important events. + var events = ['error', 'close', 'destroy', 'pause', 'resume']; + forEach(events, function (ev) { + stream.on(ev, self.emit.bind(self, ev)); + }); -function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { - chunk = bufferShim.from(chunk, encoding); - } - return chunk; -} + // when we try to consume some more bytes, simply unpause the + // underlying stream. + self._read = function (n) { + debug('wrapped _read', n); + if (paused) { + paused = false; + stream.resume(); + } + }; -// if we're already writing something, then just put this -// in the queue, and wait our turn. Otherwise, call _write -// If we return false, then we need a drain event, so set that flag. -function writeOrBuffer(stream, state, chunk, encoding, cb) { - chunk = decodeChunk(state, chunk, encoding); + return self; +}; - if (Buffer.isBuffer(chunk)) encoding = 'buffer'; - var len = state.objectMode ? 1 : chunk.length; +// exposed for testing purposes only. +Readable._fromList = fromList; - state.length += len; +// Pluck off n bytes from an array of buffers. +// Length is the combined lengths of all the buffers in the list. +function fromList(n, state) { + var list = state.buffer; + var length = state.length; + var stringMode = !!state.decoder; + var objectMode = !!state.objectMode; + var ret; - var ret = state.length < state.highWaterMark; - // we must ensure that previous needDrain will not be reset to false. - if (!ret) state.needDrain = true; + // nothing in the list, definitely empty. + if (list.length === 0) return null; - if (state.writing || state.corked) { - var last = state.lastBufferedRequest; - state.lastBufferedRequest = new WriteReq(chunk, encoding, cb); - if (last) { - last.next = state.lastBufferedRequest; + if (length === 0) ret = null;else if (objectMode) ret = list.shift();else if (!n || n >= length) { + // read it all, truncate the array. + if (stringMode) ret = list.join('');else if (list.length === 1) ret = list[0];else ret = Buffer.concat(list, length); + list.length = 0; + } else { + // read just some of it. + if (n < list[0].length) { + // just take a part of the first list item. + // slice is the same for buffers and strings. + var buf = list[0]; + ret = buf.slice(0, n); + list[0] = buf.slice(n); + } else if (n === list[0].length) { + // first list is a perfect match + ret = list.shift(); } else { - state.bufferedRequest = state.lastBufferedRequest; + // complex case. + // we have enough to cover it, but it spans past the first buffer. + if (stringMode) ret = '';else ret = bufferShim.allocUnsafe(n); + + var c = 0; + for (var i = 0, l = list.length; i < l && c < n; i++) { + var _buf = list[0]; + var cpy = Math.min(n - c, _buf.length); + + if (stringMode) ret += _buf.slice(0, cpy);else _buf.copy(ret, c, 0, cpy); + + if (cpy < _buf.length) list[0] = _buf.slice(cpy);else list.shift(); + + c += cpy; + } } - state.bufferedRequestCount += 1; - } else { - doWrite(stream, state, false, len, chunk, encoding, cb); } return ret; } -function doWrite(stream, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); - state.sync = false; +function endReadable(stream) { + var state = stream._readableState; + + // If we get here before consuming all the bytes, then that is a + // bug in node. Should never happen. + if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); + + if (!state.endEmitted) { + state.ended = true; + processNextTick(endReadableNT, state, stream); + } } -function onwriteError(stream, state, sync, er, cb) { - --state.pendingcb; - if (sync) processNextTick(cb, er);else cb(er); +function endReadableNT(state, stream) { + // Check that we didn't get one last unshift. + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); + } +} - stream._writableState.errorEmitted = true; - stream.emit('error', er); +function forEach(xs, f) { + for (var i = 0, l = xs.length; i < l; i++) { + f(xs[i], i); + } } -function onwriteStateUpdate(state) { - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; +function indexOf(xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; } +}).call(this,require('_process')) +},{"./_stream_duplex":452,"_process":443,"buffer":84,"buffer-shims":82,"core-util-is":381,"events":419,"inherits":429,"isarray":431,"process-nextick-args":442,"string_decoder/":478,"util":56}],455:[function(require,module,exports){ +// a transform stream is a readable/writable stream where you do +// something with the data. Sometimes it's called a "filter", +// but that's not a great name for it, since that implies a thing where +// some bits pass through, and others are simply ignored. (That would +// be a valid example of a transform, of course.) +// +// While the output is causally related to the input, it's not a +// necessarily symmetric or synchronous transformation. For example, +// a zlib stream might take multiple plain-text writes(), and then +// emit a single compressed chunk some time in the future. +// +// Here's how this works: +// +// The Transform stream has all the aspects of the readable and writable +// stream classes. When you write(chunk), that calls _write(chunk,cb) +// internally, and returns false if there's a lot of pending writes +// buffered up. When you call read(), that calls _read(n) until +// there's enough pending readable data buffered up. +// +// In a transform stream, the written data is placed in a buffer. When +// _read(n) is called, it transforms the queued up data, calling the +// buffered _write cb's as it consumes chunks. If consuming a single +// written chunk would result in multiple output chunks, then the first +// outputted bit calls the readcb, and subsequent chunks just go into +// the read buffer, and will cause it to emit 'readable' if necessary. +// +// This way, back-pressure is actually determined by the reading side, +// since _read has to be called to start processing a new chunk. However, +// a pathological inflate type of transform can cause excessive buffering +// here. For example, imagine a stream where every byte of input is +// interpreted as an integer from 0-255, and then results in that many +// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in +// 1kb of data being output. In this case, you could write a very small +// amount of input, and end up with a very large amount of output. In +// such a pathological inflating mechanism, there'd be no way to tell +// the system to stop doing the transform. A single 4MB write could +// cause the system to run out of memory. +// +// However, even in such a pathological case, only a single written chunk +// would be consumed, and then the rest would wait (un-transformed) until +// the results of the previous transformed chunk were consumed. -function onwrite(stream, er) { - var state = stream._writableState; - var sync = state.sync; - var cb = state.writecb; +'use strict'; - onwriteStateUpdate(state); +module.exports = Transform; - if (er) onwriteError(stream, state, sync, er, cb);else { - // Check if we're actually ready to finish, but don't emit yet - var finished = needFinish(state); +var Duplex = require('./_stream_duplex'); - if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { - clearBuffer(stream, state); - } +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ - if (sync) { - /**/ - asyncWrite(afterWrite, stream, state, finished, cb); - /**/ - } else { - afterWrite(stream, state, finished, cb); - } - } -} +util.inherits(Transform, Duplex); -function afterWrite(stream, state, finished, cb) { - if (!finished) onwriteDrain(stream, state); - state.pendingcb--; - cb(); - finishMaybe(stream, state); -} +function TransformState(stream) { + this.afterTransform = function (er, data) { + return afterTransform(stream, er, data); + }; -// Must force callback to be called on nextTick, so that we don't -// emit 'drain' before the write() consumer gets the 'false' return -// value, and has a chance to attach a 'drain' listener. -function onwriteDrain(stream, state) { - if (state.length === 0 && state.needDrain) { - state.needDrain = false; - stream.emit('drain'); - } + this.needTransform = false; + this.transforming = false; + this.writecb = null; + this.writechunk = null; + this.writeencoding = null; } -// if there's something in the buffer waiting, then process it -function clearBuffer(stream, state) { - state.bufferProcessing = true; - var entry = state.bufferedRequest; +function afterTransform(stream, er, data) { + var ts = stream._transformState; + ts.transforming = false; - if (stream._writev && entry && entry.next) { - // Fast case, write everything using _writev() - var l = state.bufferedRequestCount; - var buffer = new Array(l); - var holder = state.corkedRequestsFree; - holder.entry = entry; + var cb = ts.writecb; - var count = 0; - while (entry) { - buffer[count] = entry; - entry = entry.next; - count += 1; - } + if (!cb) return stream.emit('error', new Error('no writecb in Transform class')); - doWrite(stream, state, true, state.length, buffer, '', holder.finish); + ts.writechunk = null; + ts.writecb = null; - // doWrite is almost always async, defer these to save a bit of time - // as the hot path ends with doWrite - state.pendingcb++; - state.lastBufferedRequest = null; - if (holder.next) { - state.corkedRequestsFree = holder.next; - holder.next = null; - } else { - state.corkedRequestsFree = new CorkedRequest(state); - } - } else { - // Slow case, write chunks one-by-one - while (entry) { - var chunk = entry.chunk; - var encoding = entry.encoding; - var cb = entry.callback; - var len = state.objectMode ? 1 : chunk.length; + if (data !== null && data !== undefined) stream.push(data); - doWrite(stream, state, false, len, chunk, encoding, cb); - entry = entry.next; - // if we didn't call the onwrite immediately, then - // it means that we need to wait until it does. - // also, that means that the chunk and cb are currently - // being processed, so move the buffer counter past them. - if (state.writing) { - break; - } - } + cb(er); - if (entry === null) state.lastBufferedRequest = null; + var rs = stream._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + stream._read(rs.highWaterMark); } - - state.bufferedRequestCount = 0; - state.bufferedRequest = entry; - state.bufferProcessing = false; } -Writable.prototype._write = function (chunk, encoding, cb) { - cb(new Error('not implemented')); -}; +function Transform(options) { + if (!(this instanceof Transform)) return new Transform(options); -Writable.prototype._writev = null; + Duplex.call(this, options); -Writable.prototype.end = function (chunk, encoding, cb) { - var state = this._writableState; + this._transformState = new TransformState(this); - if (typeof chunk === 'function') { - cb = chunk; - chunk = null; - encoding = null; - } else if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } + // when the writable side finishes, then flush out anything remaining. + var stream = this; - if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); + // start out asking for a readable event once data is transformed. + this._readableState.needReadable = true; - // .end() fully uncorks - if (state.corked) { - state.corked = 1; - this.uncork(); + // we have implemented the _read method, and done the other things + // that Readable wants before the first _read call, so unset the + // sync guard flag. + this._readableState.sync = false; + + if (options) { + if (typeof options.transform === 'function') this._transform = options.transform; + + if (typeof options.flush === 'function') this._flush = options.flush; } - // ignore unnecessary end() calls. - if (!state.ending && !state.finished) endWritable(this, state, cb); + this.once('prefinish', function () { + if (typeof this._flush === 'function') this._flush(function (er) { + done(stream, er); + });else done(stream); + }); +} + +Transform.prototype.push = function (chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); }; -function needFinish(state) { - return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; -} +// This is the part where you do stuff! +// override this function in implementation classes. +// 'chunk' is an input chunk. +// +// Call `push(newChunk)` to pass along transformed output +// to the readable side. You may call 'push' zero or more times. +// +// Call `cb(err)` when you are done with this chunk. If you pass +// an error, then that'll put the hurt on the whole operation. If you +// never call cb(), then you'll never get another chunk. +Transform.prototype._transform = function (chunk, encoding, cb) { + throw new Error('Not implemented'); +}; -function prefinish(stream, state) { - if (!state.prefinished) { - state.prefinished = true; - stream.emit('prefinish'); +Transform.prototype._write = function (chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); } -} +}; -function finishMaybe(stream, state) { - var need = needFinish(state); - if (need) { - if (state.pendingcb === 0) { - prefinish(stream, state); - state.finished = true; - stream.emit('finish'); - } else { - prefinish(stream, state); - } - } - return need; -} +// Doesn't matter what the args are here. +// _transform does all the work. +// That we got here means that the readable side wants more data. +Transform.prototype._read = function (n) { + var ts = this._transformState; -function endWritable(stream, state, cb) { - state.ending = true; - finishMaybe(stream, state); - if (cb) { - if (state.finished) processNextTick(cb);else stream.once('finish', cb); + if (ts.writechunk !== null && ts.writecb && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + // mark that we need a transform, so that any data that comes in + // will get processed, now that we've asked for it. + ts.needTransform = true; } - state.ended = true; - stream.writable = false; -} +}; -// It seems a linked list but it is not -// there will be only 2 of these for each stream -function CorkedRequest(state) { - var _this = this; +function done(stream, er) { + if (er) return stream.emit('error', er); - this.next = null; - this.entry = null; + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided + var ws = stream._writableState; + var ts = stream._transformState; - this.finish = function (err) { - var entry = _this.entry; - _this.entry = null; - while (entry) { - var cb = entry.callback; - state.pendingcb--; - cb(err); - entry = entry.next; - } - if (state.corkedRequestsFree) { - state.corkedRequestsFree.next = _this; - } else { - state.corkedRequestsFree = _this; - } - }; -} -}).call(this,require('_process')) -},{"./_stream_duplex":451,"_process":442,"buffer":83,"buffer-shims":81,"core-util-is":380,"events":418,"inherits":428,"process-nextick-args":441,"util-deprecate":479}],456:[function(require,module,exports){ -module.exports = require("./lib/_stream_passthrough.js") + if (ws.length) throw new Error('Calling transform done when ws.length != 0'); -},{"./lib/_stream_passthrough.js":452}],457:[function(require,module,exports){ -(function (process){ -var Stream = (function (){ - try { - return require('st' + 'ream'); // hack to fix a circular dependency issue when used with browserify - } catch(_){} -}()); -exports = module.exports = require('./lib/_stream_readable.js'); -exports.Stream = Stream || exports; -exports.Readable = exports; -exports.Writable = require('./lib/_stream_writable.js'); -exports.Duplex = require('./lib/_stream_duplex.js'); -exports.Transform = require('./lib/_stream_transform.js'); -exports.PassThrough = require('./lib/_stream_passthrough.js'); + if (ts.transforming) throw new Error('Calling transform done when still transforming'); -if (!process.browser && process.env.READABLE_STREAM === 'disable' && Stream) { - module.exports = Stream; + return stream.push(null); } +},{"./_stream_duplex":452,"core-util-is":381,"inherits":429}],456:[function(require,module,exports){ +(function (process){ +// A bit simpler than readable streams. +// Implement an async ._write(chunk, encoding, cb), and it'll handle all +// the drain event emission and buffering. -}).call(this,require('_process')) -},{"./lib/_stream_duplex.js":451,"./lib/_stream_passthrough.js":452,"./lib/_stream_readable.js":453,"./lib/_stream_transform.js":454,"./lib/_stream_writable.js":455,"_process":442}],458:[function(require,module,exports){ -module.exports = require("./lib/_stream_transform.js") - -},{"./lib/_stream_transform.js":454}],459:[function(require,module,exports){ -module.exports = require("./lib/_stream_writable.js") - -},{"./lib/_stream_writable.js":455}],460:[function(require,module,exports){ -(function (process,global){ -/** - * Copyright (c) 2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * https://raw.github.com/facebook/regenerator/master/LICENSE file. An - * additional grant of patent rights can be found in the PATENTS file in - * the same directory. - */ - -!(function(global) { - "use strict"; +'use strict'; - var hasOwn = Object.prototype.hasOwnProperty; - var undefined; // More compressible than void 0. - var $Symbol = typeof Symbol === "function" ? Symbol : {}; - var iteratorSymbol = $Symbol.iterator || "@@iterator"; - var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; +module.exports = Writable; - var inModule = typeof module === "object"; - var runtime = global.regeneratorRuntime; - if (runtime) { - if (inModule) { - // If regeneratorRuntime is defined globally and we're in a module, - // make the exports object identical to regeneratorRuntime. - module.exports = runtime; - } - // Don't bother evaluating the rest of this file if the runtime was - // already defined globally. - return; - } +/**/ +var processNextTick = require('process-nextick-args'); +/**/ - // Define the runtime globally (as expected by generated code) as either - // module.exports (if we're in a module) or a new, empty object. - runtime = global.regeneratorRuntime = inModule ? module.exports : {}; +/**/ +var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick; +/**/ - function wrap(innerFn, outerFn, self, tryLocsList) { - // If outerFn provided, then outerFn.prototype instanceof Generator. - var generator = Object.create((outerFn || Generator).prototype); - var context = new Context(tryLocsList || []); +Writable.WritableState = WritableState; - // The ._invoke method unifies the implementations of the .next, - // .throw, and .return methods. - generator._invoke = makeInvokeMethod(innerFn, self, context); +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ - return generator; - } - runtime.wrap = wrap; +/**/ +var internalUtil = { + deprecate: require('util-deprecate') +}; +/**/ - // Try/catch helper to minimize deoptimizations. Returns a completion - // record like context.tryEntries[i].completion. This interface could - // have been (and was previously) designed to take a closure to be - // invoked without arguments, but in all the cases we care about we - // already have an existing method we want to call, so there's no need - // to create a new function object. We can even get away with assuming - // the method takes exactly one argument, since that happens to be true - // in every case, so we don't have to touch the arguments object. The - // only additional allocation required is the completion record, which - // has a stable shape and so hopefully should be cheap to allocate. - function tryCatch(fn, obj, arg) { - try { - return { type: "normal", arg: fn.call(obj, arg) }; - } catch (err) { - return { type: "throw", arg: err }; - } +/**/ +var Stream; +(function () { + try { + Stream = require('st' + 'ream'); + } catch (_) {} finally { + if (!Stream) Stream = require('events').EventEmitter; } +})(); +/**/ - var GenStateSuspendedStart = "suspendedStart"; - var GenStateSuspendedYield = "suspendedYield"; - var GenStateExecuting = "executing"; - var GenStateCompleted = "completed"; +var Buffer = require('buffer').Buffer; +/**/ +var bufferShim = require('buffer-shims'); +/**/ - // Returning this object from the innerFn has the same effect as - // breaking out of the dispatch switch statement. - var ContinueSentinel = {}; +util.inherits(Writable, Stream); - // Dummy constructor functions that we use as the .constructor and - // .constructor.prototype properties for functions that return Generator - // objects. For full spec compliance, you may wish to configure your - // minifier not to mangle the names of these two functions. - function Generator() {} - function GeneratorFunction() {} - function GeneratorFunctionPrototype() {} +function nop() {} - var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype; - GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; - GeneratorFunctionPrototype.constructor = GeneratorFunction; - GeneratorFunctionPrototype[toStringTagSymbol] = GeneratorFunction.displayName = "GeneratorFunction"; +function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; + this.next = null; +} - // Helper for defining the .next, .throw, and .return methods of the - // Iterator interface in terms of a single ._invoke method. - function defineIteratorMethods(prototype) { - ["next", "throw", "return"].forEach(function(method) { - prototype[method] = function(arg) { - return this._invoke(method, arg); - }; - }); - } +var Duplex; +function WritableState(options, stream) { + Duplex = Duplex || require('./_stream_duplex'); - runtime.isGeneratorFunction = function(genFun) { - var ctor = typeof genFun === "function" && genFun.constructor; - return ctor - ? ctor === GeneratorFunction || - // For the native GeneratorFunction constructor, the best we can - // do is to check its .name property. - (ctor.displayName || ctor.name) === "GeneratorFunction" - : false; - }; + options = options || {}; - runtime.mark = function(genFun) { - if (Object.setPrototypeOf) { - Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); - } else { - genFun.__proto__ = GeneratorFunctionPrototype; - if (!(toStringTagSymbol in genFun)) { - genFun[toStringTagSymbol] = "GeneratorFunction"; - } - } - genFun.prototype = Object.create(Gp); - return genFun; - }; + // object stream flag to indicate whether or not this stream + // contains buffers or objects. + this.objectMode = !!options.objectMode; - // Within the body of any async function, `await x` is transformed to - // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test - // `value instanceof AwaitArgument` to determine if the yielded value is - // meant to be awaited. Some may consider the name of this method too - // cutesy, but they are curmudgeons. - runtime.awrap = function(arg) { - return new AwaitArgument(arg); - }; + if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode; - function AwaitArgument(arg) { - this.arg = arg; - } + // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() + var hwm = options.highWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; - function AsyncIterator(generator) { - function invoke(method, arg, resolve, reject) { - var record = tryCatch(generator[method], generator, arg); - if (record.type === "throw") { - reject(record.arg); - } else { - var result = record.arg; - var value = result.value; - if (value instanceof AwaitArgument) { - return Promise.resolve(value.arg).then(function(value) { - invoke("next", value, resolve, reject); - }, function(err) { - invoke("throw", err, resolve, reject); - }); - } + // cast to ints. + this.highWaterMark = ~ ~this.highWaterMark; - return Promise.resolve(value).then(function(unwrapped) { - // When a yielded Promise is resolved, its final value becomes - // the .value of the Promise<{value,done}> result for the - // current iteration. If the Promise is rejected, however, the - // result for this iteration will be rejected with the same - // reason. Note that rejections of yielded Promises are not - // thrown back into the generator function, as is the case - // when an awaited Promise is rejected. This difference in - // behavior between yield and await is important, because it - // allows the consumer to decide what to do with the yielded - // rejection (swallow it and continue, manually .throw it back - // into the generator, abandon iteration, whatever). With - // await, by contrast, there is no opportunity to examine the - // rejection reason outside the generator function, so the - // only option is to throw it from the await expression, and - // let the generator function handle the exception. - result.value = unwrapped; - resolve(result); - }, reject); - } - } + this.needDrain = false; + // at the start of calling end() + this.ending = false; + // when end() has been called, and returned + this.ended = false; + // when 'finish' is emitted + this.finished = false; - if (typeof process === "object" && process.domain) { - invoke = process.domain.bind(invoke); - } + // should we decode strings into buffers before passing to _write? + // this is here so that some node-core streams can optimize string + // handling at a lower level. + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; - var previousPromise; + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; - function enqueue(method, arg) { - function callInvokeWithMethodAndArg() { - return new Promise(function(resolve, reject) { - invoke(method, arg, resolve, reject); - }); - } + // not an actual buffer we keep track of, but a measurement + // of how much we're waiting to get pushed to some underlying + // socket or file. + this.length = 0; - return previousPromise = - // If enqueue has been called before, then we want to wait until - // all previous Promises have been resolved before calling invoke, - // so that results are always delivered in the correct order. If - // enqueue has not been called before, then it is important to - // call invoke immediately, without waiting on a callback to fire, - // so that the async generator function has the opportunity to do - // any necessary setup in a predictable way. This predictability - // is why the Promise constructor synchronously invokes its - // executor callback, and why async functions synchronously - // execute code before the first await. Since we implement simple - // async functions in terms of async generators, it is especially - // important to get this right, even though it requires care. - previousPromise ? previousPromise.then( - callInvokeWithMethodAndArg, - // Avoid propagating failures to Promises returned by later - // invocations of the iterator. - callInvokeWithMethodAndArg - ) : callInvokeWithMethodAndArg(); - } + // a flag to see when we're in the middle of a write. + this.writing = false; - // Define the unified helper method that is used to implement .next, - // .throw, and .return (see defineIteratorMethods). - this._invoke = enqueue; - } + // when true all writes will be buffered until .uncork() call + this.corked = 0; - defineIteratorMethods(AsyncIterator.prototype); + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; - // Note that simple async functions are implemented on top of - // AsyncIterator objects; they just return a Promise for the value of - // the final result produced by the iterator. - runtime.async = function(innerFn, outerFn, self, tryLocsList) { - var iter = new AsyncIterator( - wrap(innerFn, outerFn, self, tryLocsList) - ); + // a flag to know if we're processing previously buffered items, which + // may call the _write() callback in the same tick, so that we don't + // end up in an overlapped onwrite situation. + this.bufferProcessing = false; - return runtime.isGeneratorFunction(outerFn) - ? iter // If outerFn is a generator, return the full iterator. - : iter.next().then(function(result) { - return result.done ? result.value : iter.next(); - }); + // the callback that's passed to _write(chunk,cb) + this.onwrite = function (er) { + onwrite(stream, er); }; - function makeInvokeMethod(innerFn, self, context) { - var state = GenStateSuspendedStart; - - return function invoke(method, arg) { - if (state === GenStateExecuting) { - throw new Error("Generator is already running"); - } - - if (state === GenStateCompleted) { - if (method === "throw") { - throw arg; - } + // the callback that the user supplies to write(chunk,encoding,cb) + this.writecb = null; - // Be forgiving, per 25.3.3.3.3 of the spec: - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume - return doneResult(); - } + // the amount that is being written when _write is called. + this.writelen = 0; - while (true) { - var delegate = context.delegate; - if (delegate) { - if (method === "return" || - (method === "throw" && delegate.iterator[method] === undefined)) { - // A return or throw (when the delegate iterator has no throw - // method) always terminates the yield* loop. - context.delegate = null; + this.bufferedRequest = null; + this.lastBufferedRequest = null; - // If the delegate iterator has a return method, give it a - // chance to clean up. - var returnMethod = delegate.iterator["return"]; - if (returnMethod) { - var record = tryCatch(returnMethod, delegate.iterator, arg); - if (record.type === "throw") { - // If the return method threw an exception, let that - // exception prevail over the original return or throw. - method = "throw"; - arg = record.arg; - continue; - } - } + // number of pending user-supplied write callbacks + // this must be 0 before 'finish' can be emitted + this.pendingcb = 0; - if (method === "return") { - // Continue with the outer return, now that the delegate - // iterator has been terminated. - continue; - } - } + // emit prefinish if the only thing we're waiting for is _write cbs + // This is relevant for synchronous Transform streams + this.prefinished = false; - var record = tryCatch( - delegate.iterator[method], - delegate.iterator, - arg - ); + // True if the error was already emitted and should not be thrown again + this.errorEmitted = false; - if (record.type === "throw") { - context.delegate = null; + // count buffered requests + this.bufferedRequestCount = 0; - // Like returning generator.throw(uncaught), but without the - // overhead of an extra function call. - method = "throw"; - arg = record.arg; - continue; - } + // allocate the first CorkedRequest, there is always + // one allocated and free to use, and we maintain at most two + this.corkedRequestsFree = new CorkedRequest(this); +} - // Delegate generator ran and handled its own exceptions so - // regardless of what the method was, we continue as if it is - // "next" with an undefined arg. - method = "next"; - arg = undefined; +WritableState.prototype.getBuffer = function writableStateGetBuffer() { + var current = this.bufferedRequest; + var out = []; + while (current) { + out.push(current); + current = current.next; + } + return out; +}; - var info = record.arg; - if (info.done) { - context[delegate.resultName] = info.value; - context.next = delegate.nextLoc; - } else { - state = GenStateSuspendedYield; - return info; - } +(function () { + try { + Object.defineProperty(WritableState.prototype, 'buffer', { + get: internalUtil.deprecate(function () { + return this.getBuffer(); + }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.') + }); + } catch (_) {} +})(); - context.delegate = null; - } +var Duplex; +function Writable(options) { + Duplex = Duplex || require('./_stream_duplex'); - if (method === "next") { - // Setting context._sent for legacy support of Babel's - // function.sent implementation. - context.sent = context._sent = arg; + // Writable ctor is applied to Duplexes, though they're not + // instanceof Writable, they're instanceof Readable. + if (!(this instanceof Writable) && !(this instanceof Duplex)) return new Writable(options); - } else if (method === "throw") { - if (state === GenStateSuspendedStart) { - state = GenStateCompleted; - throw arg; - } + this._writableState = new WritableState(options, this); - if (context.dispatchException(arg)) { - // If the dispatched exception was caught by a catch block, - // then let that catch block handle the exception normally. - method = "next"; - arg = undefined; - } + // legacy. + this.writable = true; - } else if (method === "return") { - context.abrupt("return", arg); - } + if (options) { + if (typeof options.write === 'function') this._write = options.write; - state = GenStateExecuting; + if (typeof options.writev === 'function') this._writev = options.writev; + } - var record = tryCatch(innerFn, self, context); - if (record.type === "normal") { - // If an exception is thrown from innerFn, we leave state === - // GenStateExecuting and loop back for another invocation. - state = context.done - ? GenStateCompleted - : GenStateSuspendedYield; + Stream.call(this); +} - var info = { - value: record.arg, - done: context.done - }; +// Otherwise people can pipe Writable streams, which is just wrong. +Writable.prototype.pipe = function () { + this.emit('error', new Error('Cannot pipe, not readable')); +}; - if (record.arg === ContinueSentinel) { - if (context.delegate && method === "next") { - // Deliberately forget the last sent value so that we don't - // accidentally pass it on to the delegate. - arg = undefined; - } - } else { - return info; - } +function writeAfterEnd(stream, cb) { + var er = new Error('write after end'); + // TODO: defer error events consistently everywhere, not just the cb + stream.emit('error', er); + processNextTick(cb, er); +} - } else if (record.type === "throw") { - state = GenStateCompleted; - // Dispatch the exception by looping back around to the - // context.dispatchException(arg) call above. - method = "throw"; - arg = record.arg; - } - } - }; +// If we get something that is not a buffer, string, null, or undefined, +// and we're not in objectMode, then that's an error. +// Otherwise stream chunks are all considered to be of length=1, and the +// watermarks determine how many objects to keep in the buffer, rather than +// how many bytes or characters. +function validChunk(stream, state, chunk, cb) { + var valid = true; + var er = false; + // Always throw error if a null is written + // if we are not in object mode then throw + // if it is not a buffer, string, or undefined. + if (chunk === null) { + er = new TypeError('May not write null values to stream'); + } else if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + if (er) { + stream.emit('error', er); + processNextTick(cb, er); + valid = false; + } + return valid; +} + +Writable.prototype.write = function (chunk, encoding, cb) { + var state = this._writableState; + var ret = false; + + if (typeof encoding === 'function') { + cb = encoding; + encoding = null; } - // Define Generator.prototype.{next,throw,return} in terms of the - // unified ._invoke helper method. - defineIteratorMethods(Gp); + if (Buffer.isBuffer(chunk)) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; - Gp[iteratorSymbol] = function() { - return this; - }; + if (typeof cb !== 'function') cb = nop; - Gp[toStringTagSymbol] = "Generator"; + if (state.ended) writeAfterEnd(this, cb);else if (validChunk(this, state, chunk, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, chunk, encoding, cb); + } - Gp.toString = function() { - return "[object Generator]"; - }; + return ret; +}; - function pushTryEntry(locs) { - var entry = { tryLoc: locs[0] }; +Writable.prototype.cork = function () { + var state = this._writableState; - if (1 in locs) { - entry.catchLoc = locs[1]; - } + state.corked++; +}; - if (2 in locs) { - entry.finallyLoc = locs[2]; - entry.afterLoc = locs[3]; - } +Writable.prototype.uncork = function () { + var state = this._writableState; - this.tryEntries.push(entry); - } + if (state.corked) { + state.corked--; - function resetTryEntry(entry) { - var record = entry.completion || {}; - record.type = "normal"; - delete record.arg; - entry.completion = record; + if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); } +}; - function Context(tryLocsList) { - // The root entry object (effectively a try statement without a catch - // or a finally block) gives us a place to store values thrown from - // locations where there is no enclosing try statement. - this.tryEntries = [{ tryLoc: "root" }]; - tryLocsList.forEach(pushTryEntry, this); - this.reset(true); +Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + // node::ParseEncoding() requires lower case. + if (typeof encoding === 'string') encoding = encoding.toLowerCase(); + if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); + this._writableState.defaultEncoding = encoding; + return this; +}; + +function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { + chunk = bufferShim.from(chunk, encoding); } + return chunk; +} - runtime.keys = function(object) { - var keys = []; - for (var key in object) { - keys.push(key); - } - keys.reverse(); +// if we're already writing something, then just put this +// in the queue, and wait our turn. Otherwise, call _write +// If we return false, then we need a drain event, so set that flag. +function writeOrBuffer(stream, state, chunk, encoding, cb) { + chunk = decodeChunk(state, chunk, encoding); - // Rather than returning an object with a next method, we keep - // things simple and return the next function itself. - return function next() { - while (keys.length) { - var key = keys.pop(); - if (key in object) { - next.value = key; - next.done = false; - return next; - } - } + if (Buffer.isBuffer(chunk)) encoding = 'buffer'; + var len = state.objectMode ? 1 : chunk.length; - // To avoid creating an additional object, we just hang the .value - // and .done properties off the next function object itself. This - // also ensures that the minifier will not anonymize the function. - next.done = true; - return next; - }; - }; + state.length += len; - function values(iterable) { - if (iterable) { - var iteratorMethod = iterable[iteratorSymbol]; - if (iteratorMethod) { - return iteratorMethod.call(iterable); - } + var ret = state.length < state.highWaterMark; + // we must ensure that previous needDrain will not be reset to false. + if (!ret) state.needDrain = true; - if (typeof iterable.next === "function") { - return iterable; - } + if (state.writing || state.corked) { + var last = state.lastBufferedRequest; + state.lastBufferedRequest = new WriteReq(chunk, encoding, cb); + if (last) { + last.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; + } + state.bufferedRequestCount += 1; + } else { + doWrite(stream, state, false, len, chunk, encoding, cb); + } - if (!isNaN(iterable.length)) { - var i = -1, next = function next() { - while (++i < iterable.length) { - if (hasOwn.call(iterable, i)) { - next.value = iterable[i]; - next.done = false; - return next; - } - } + return ret; +} - next.value = undefined; - next.done = true; +function doWrite(stream, state, writev, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); + state.sync = false; +} - return next; - }; +function onwriteError(stream, state, sync, er, cb) { + --state.pendingcb; + if (sync) processNextTick(cb, er);else cb(er); - return next.next = next; - } - } + stream._writableState.errorEmitted = true; + stream.emit('error', er); +} - // Return an iterator with no values. - return { next: doneResult }; - } - runtime.values = values; +function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; +} - function doneResult() { - return { value: undefined, done: true }; - } +function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; - Context.prototype = { - constructor: Context, + onwriteStateUpdate(state); - reset: function(skipTempReset) { - this.prev = 0; - this.next = 0; - // Resetting context._sent for legacy support of Babel's - // function.sent implementation. - this.sent = this._sent = undefined; - this.done = false; - this.delegate = null; + if (er) onwriteError(stream, state, sync, er, cb);else { + // Check if we're actually ready to finish, but don't emit yet + var finished = needFinish(state); - this.tryEntries.forEach(resetTryEntry); + if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { + clearBuffer(stream, state); + } - if (!skipTempReset) { - for (var name in this) { - // Not sure about the optimal order of these conditions: - if (name.charAt(0) === "t" && - hasOwn.call(this, name) && - !isNaN(+name.slice(1))) { - this[name] = undefined; - } - } + if (sync) { + /**/ + asyncWrite(afterWrite, stream, state, finished, cb); + /**/ + } else { + afterWrite(stream, state, finished, cb); } - }, + } +} - stop: function() { - this.done = true; +function afterWrite(stream, state, finished, cb) { + if (!finished) onwriteDrain(stream, state); + state.pendingcb--; + cb(); + finishMaybe(stream, state); +} - var rootEntry = this.tryEntries[0]; - var rootRecord = rootEntry.completion; - if (rootRecord.type === "throw") { - throw rootRecord.arg; - } +// Must force callback to be called on nextTick, so that we don't +// emit 'drain' before the write() consumer gets the 'false' return +// value, and has a chance to attach a 'drain' listener. +function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit('drain'); + } +} - return this.rval; - }, +// if there's something in the buffer waiting, then process it +function clearBuffer(stream, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; - dispatchException: function(exception) { - if (this.done) { - throw exception; - } + if (stream._writev && entry && entry.next) { + // Fast case, write everything using _writev() + var l = state.bufferedRequestCount; + var buffer = new Array(l); + var holder = state.corkedRequestsFree; + holder.entry = entry; - var context = this; - function handle(loc, caught) { - record.type = "throw"; - record.arg = exception; - context.next = loc; - return !!caught; - } + var count = 0; + while (entry) { + buffer[count] = entry; + entry = entry.next; + count += 1; + } - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - var record = entry.completion; + doWrite(stream, state, true, state.length, buffer, '', holder.finish); - if (entry.tryLoc === "root") { - // Exception thrown outside of any try block that could handle - // it, so set the completion value of the entire function to - // throw the exception. - return handle("end"); - } + // doWrite is almost always async, defer these to save a bit of time + // as the hot path ends with doWrite + state.pendingcb++; + state.lastBufferedRequest = null; + if (holder.next) { + state.corkedRequestsFree = holder.next; + holder.next = null; + } else { + state.corkedRequestsFree = new CorkedRequest(state); + } + } else { + // Slow case, write chunks one-by-one + while (entry) { + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; - if (entry.tryLoc <= this.prev) { - var hasCatch = hasOwn.call(entry, "catchLoc"); - var hasFinally = hasOwn.call(entry, "finallyLoc"); + doWrite(stream, state, false, len, chunk, encoding, cb); + entry = entry.next; + // if we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + if (state.writing) { + break; + } + } - if (hasCatch && hasFinally) { - if (this.prev < entry.catchLoc) { - return handle(entry.catchLoc, true); - } else if (this.prev < entry.finallyLoc) { - return handle(entry.finallyLoc); - } + if (entry === null) state.lastBufferedRequest = null; + } - } else if (hasCatch) { - if (this.prev < entry.catchLoc) { - return handle(entry.catchLoc, true); - } + state.bufferedRequestCount = 0; + state.bufferedRequest = entry; + state.bufferProcessing = false; +} - } else if (hasFinally) { - if (this.prev < entry.finallyLoc) { - return handle(entry.finallyLoc); - } +Writable.prototype._write = function (chunk, encoding, cb) { + cb(new Error('not implemented')); +}; - } else { - throw new Error("try statement without catch or finally"); - } - } - } - }, +Writable.prototype._writev = null; - abrupt: function(type, arg) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.tryLoc <= this.prev && - hasOwn.call(entry, "finallyLoc") && - this.prev < entry.finallyLoc) { - var finallyEntry = entry; - break; - } - } +Writable.prototype.end = function (chunk, encoding, cb) { + var state = this._writableState; - if (finallyEntry && - (type === "break" || - type === "continue") && - finallyEntry.tryLoc <= arg && - arg <= finallyEntry.finallyLoc) { - // Ignore the finally entry if control is not jumping to a - // location outside the try/catch block. - finallyEntry = null; - } + if (typeof chunk === 'function') { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } - var record = finallyEntry ? finallyEntry.completion : {}; - record.type = type; - record.arg = arg; + if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); - if (finallyEntry) { - this.next = finallyEntry.finallyLoc; - } else { - this.complete(record); - } + // .end() fully uncorks + if (state.corked) { + state.corked = 1; + this.uncork(); + } - return ContinueSentinel; - }, + // ignore unnecessary end() calls. + if (!state.ending && !state.finished) endWritable(this, state, cb); +}; - complete: function(record, afterLoc) { - if (record.type === "throw") { - throw record.arg; - } +function needFinish(state) { + return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; +} - if (record.type === "break" || - record.type === "continue") { - this.next = record.arg; - } else if (record.type === "return") { - this.rval = record.arg; - this.next = "end"; - } else if (record.type === "normal" && afterLoc) { - this.next = afterLoc; - } - }, +function prefinish(stream, state) { + if (!state.prefinished) { + state.prefinished = true; + stream.emit('prefinish'); + } +} - finish: function(finallyLoc) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.finallyLoc === finallyLoc) { - this.complete(entry.completion, entry.afterLoc); - resetTryEntry(entry); - return ContinueSentinel; - } - } - }, +function finishMaybe(stream, state) { + var need = needFinish(state); + if (need) { + if (state.pendingcb === 0) { + prefinish(stream, state); + state.finished = true; + stream.emit('finish'); + } else { + prefinish(stream, state); + } + } + return need; +} - "catch": function(tryLoc) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.tryLoc === tryLoc) { - var record = entry.completion; - if (record.type === "throw") { - var thrown = record.arg; - resetTryEntry(entry); - } - return thrown; - } - } +function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); + if (cb) { + if (state.finished) processNextTick(cb);else stream.once('finish', cb); + } + state.ended = true; + stream.writable = false; +} - // The context.catch method must only be called with a location - // argument that corresponds to a known catch block. - throw new Error("illegal catch attempt"); - }, +// It seems a linked list but it is not +// there will be only 2 of these for each stream +function CorkedRequest(state) { + var _this = this; - delegateYield: function(iterable, resultName, nextLoc) { - this.delegate = { - iterator: values(iterable), - resultName: resultName, - nextLoc: nextLoc - }; + this.next = null; + this.entry = null; - return ContinueSentinel; + this.finish = function (err) { + var entry = _this.entry; + _this.entry = null; + while (entry) { + var cb = entry.callback; + state.pendingcb--; + cb(err); + entry = entry.next; + } + if (state.corkedRequestsFree) { + state.corkedRequestsFree.next = _this; + } else { + state.corkedRequestsFree = _this; } }; -})( - // Among the various tricks for obtaining a reference to the global - // object, this seems to be the most reliable technique that does not - // use indirect eval (which violates Content Security Policy). - typeof global === "object" ? global : - typeof window === "object" ? window : - typeof self === "object" ? self : this -); +} +}).call(this,require('_process')) +},{"./_stream_duplex":452,"_process":443,"buffer":84,"buffer-shims":82,"core-util-is":381,"events":419,"inherits":429,"process-nextick-args":442,"util-deprecate":479}],457:[function(require,module,exports){ +module.exports = require("./lib/_stream_passthrough.js") -}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"_process":442}],461:[function(require,module,exports){ +},{"./lib/_stream_passthrough.js":453}],458:[function(require,module,exports){ +(function (process){ +var Stream = (function (){ + try { + return require('st' + 'ream'); // hack to fix a circular dependency issue when used with browserify + } catch(_){} +}()); +exports = module.exports = require('./lib/_stream_readable.js'); +exports.Stream = Stream || exports; +exports.Readable = exports; +exports.Writable = require('./lib/_stream_writable.js'); +exports.Duplex = require('./lib/_stream_duplex.js'); +exports.Transform = require('./lib/_stream_transform.js'); +exports.PassThrough = require('./lib/_stream_passthrough.js'); + +if (!process.browser && process.env.READABLE_STREAM === 'disable' && Stream) { + module.exports = Stream; +} + +}).call(this,require('_process')) +},{"./lib/_stream_duplex.js":452,"./lib/_stream_passthrough.js":453,"./lib/_stream_readable.js":454,"./lib/_stream_transform.js":455,"./lib/_stream_writable.js":456,"_process":443}],459:[function(require,module,exports){ +module.exports = require("./lib/_stream_transform.js") + +},{"./lib/_stream_transform.js":455}],460:[function(require,module,exports){ +module.exports = require("./lib/_stream_writable.js") + +},{"./lib/_stream_writable.js":456}],461:[function(require,module,exports){ (function (Buffer){ /* CryptoJS v3.1.2 @@ -65640,7 +65571,7 @@ function ripemd160 (message) { module.exports = ripemd160 }).call(this,require("buffer").Buffer) -},{"buffer":83}],462:[function(require,module,exports){ +},{"buffer":84}],462:[function(require,module,exports){ (function (Buffer){ const assert = require('assert') /** @@ -65873,7 +65804,7 @@ function toBuffer (v) { } }).call(this,require("buffer").Buffer) -},{"assert":48,"buffer":83}],463:[function(require,module,exports){ +},{"assert":48,"buffer":84}],463:[function(require,module,exports){ (function (Buffer){ var pbkdf2Sync = require('pbkdf2').pbkdf2Sync @@ -66056,7 +65987,7 @@ function arraycopy (src, srcPos, dest, destPos, length) { module.exports = scrypt }).call(this,require("buffer").Buffer) -},{"buffer":83,"pbkdf2":440}],464:[function(require,module,exports){ +},{"buffer":84,"pbkdf2":441}],464:[function(require,module,exports){ 'use strict' module.exports = require('./lib')(require('./lib/elliptic')) @@ -66108,7 +66039,7 @@ exports.isNumberInInterval = function (number, x, y, message) { } }).call(this,{"isBuffer":require("../../is-buffer/index.js")}) -},{"../../is-buffer/index.js":429}],466:[function(require,module,exports){ +},{"../../is-buffer/index.js":430}],466:[function(require,module,exports){ (function (Buffer){ 'use strict' var createHash = require('create-hash') @@ -66359,7 +66290,7 @@ exports.ecdhUnsafe = function (publicKey, privateKey, compressed) { } }).call(this,require("buffer").Buffer) -},{"../messages.json":468,"bn.js":53,"buffer":83,"create-hash":382,"elliptic":397}],467:[function(require,module,exports){ +},{"../messages.json":468,"bn.js":54,"buffer":84,"create-hash":383,"elliptic":398}],467:[function(require,module,exports){ (function (Buffer){ 'use strict' var bip66 = require('bip66') @@ -66679,7 +66610,7 @@ module.exports = function (secp256k1) { } }).call(this,require("buffer").Buffer) -},{"./assert":465,"./messages.json":468,"bip66":52,"buffer":83}],468:[function(require,module,exports){ +},{"./assert":465,"./messages.json":468,"bip66":53,"buffer":84}],468:[function(require,module,exports){ module.exports={ "COMPRESSED_TYPE_INVALID": "compressed should be a boolean", "EC_PRIVATE_KEY_TYPE_INVALID": "private key should be a Buffer", @@ -66790,7 +66721,7 @@ Hash.prototype._update = function () { module.exports = Hash }).call(this,require("buffer").Buffer) -},{"buffer":83}],470:[function(require,module,exports){ +},{"buffer":84}],470:[function(require,module,exports){ var exports = module.exports = function SHA (algorithm) { algorithm = algorithm.toLowerCase() @@ -66904,7 +66835,7 @@ Sha.prototype._hash = function () { module.exports = Sha }).call(this,require("buffer").Buffer) -},{"./hash":469,"buffer":83,"inherits":428}],472:[function(require,module,exports){ +},{"./hash":469,"buffer":84,"inherits":429}],472:[function(require,module,exports){ (function (Buffer){ /* * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined @@ -67006,7 +66937,7 @@ Sha1.prototype._hash = function () { module.exports = Sha1 }).call(this,require("buffer").Buffer) -},{"./hash":469,"buffer":83,"inherits":428}],473:[function(require,module,exports){ +},{"./hash":469,"buffer":84,"inherits":429}],473:[function(require,module,exports){ (function (Buffer){ /** * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined @@ -67062,7 +66993,7 @@ Sha224.prototype._hash = function () { module.exports = Sha224 }).call(this,require("buffer").Buffer) -},{"./hash":469,"./sha256":474,"buffer":83,"inherits":428}],474:[function(require,module,exports){ +},{"./hash":469,"./sha256":474,"buffer":84,"inherits":429}],474:[function(require,module,exports){ (function (Buffer){ /** * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined @@ -67200,7 +67131,7 @@ Sha256.prototype._hash = function () { module.exports = Sha256 }).call(this,require("buffer").Buffer) -},{"./hash":469,"buffer":83,"inherits":428}],475:[function(require,module,exports){ +},{"./hash":469,"buffer":84,"inherits":429}],475:[function(require,module,exports){ (function (Buffer){ var inherits = require('inherits') var SHA512 = require('./sha512') @@ -67260,7 +67191,7 @@ Sha384.prototype._hash = function () { module.exports = Sha384 }).call(this,require("buffer").Buffer) -},{"./hash":469,"./sha512":476,"buffer":83,"inherits":428}],476:[function(require,module,exports){ +},{"./hash":469,"./sha512":476,"buffer":84,"inherits":429}],476:[function(require,module,exports){ (function (Buffer){ var inherits = require('inherits') var Hash = require('./hash') @@ -67523,7 +67454,7 @@ Sha512.prototype._hash = function () { module.exports = Sha512 }).call(this,require("buffer").Buffer) -},{"./hash":469,"buffer":83,"inherits":428}],477:[function(require,module,exports){ +},{"./hash":469,"buffer":84,"inherits":429}],477:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -67652,7 +67583,7 @@ Stream.prototype.pipe = function(dest, options) { return dest; }; -},{"events":418,"inherits":428,"readable-stream/duplex.js":450,"readable-stream/passthrough.js":456,"readable-stream/readable.js":457,"readable-stream/transform.js":458,"readable-stream/writable.js":459}],478:[function(require,module,exports){ +},{"events":419,"inherits":429,"readable-stream/duplex.js":451,"readable-stream/passthrough.js":457,"readable-stream/readable.js":458,"readable-stream/transform.js":459,"readable-stream/writable.js":460}],478:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -67875,7 +67806,7 @@ function base64DetectIncompleteChar(buffer) { this.charLength = this.charReceived ? 3 : 0; } -},{"buffer":83}],479:[function(require,module,exports){ +},{"buffer":84}],479:[function(require,module,exports){ (function (global){ /** @@ -68543,7 +68474,7 @@ function hasOwnProperty(obj, prop) { } }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./support/isBuffer":480,"_process":442,"inherits":428}],482:[function(require,module,exports){ +},{"./support/isBuffer":480,"_process":443,"inherits":429}],482:[function(require,module,exports){ (function (global){ var rng; @@ -68903,4 +68834,4 @@ exports.createContext = Script.createContext = function (context) { return copy; }; -},{"indexof":427}]},{},[27]); +},{"indexof":428}]},{},[27]); diff --git a/dist/js/etherwallet-master-min.js b/dist/js/etherwallet-master-min.js index 2a3341a1f5..6272e000ba 100644 --- a/dist/js/etherwallet-master-min.js +++ b/dist/js/etherwallet-master-min.js @@ -1,2532 +1,2474 @@ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o0) - ajaxReq.queuePost(); - }); -} -ajaxReq.post = function(data, callback) { - this.pendingPosts.push({ - data: data, - callback: callback - }); - if(this.pendingPosts.length==1) - this.queuePost(); -} -ajaxReq.getETHvalue = function(callback) { - var prefix = "eth"; - this.http.get(this.COINMARKETCAPAPI + prefix).then(function(data) { - data = data['data']['price']; - var priceObj = { - usd: data['usd'].toFixed(6), - eur: data['eur'].toFixed(6), - btc: data['btc'].toFixed(6) - }; - callback(priceObj); - }); -} -ajaxReq.getDAOProposals = function(callback) { - this.http.get(this.DAOPROPOSALSURL).then(function(data) { - callback(data.data); - }); -} +'use strict'; +var http; +var ajaxReq = function() {} +ajaxReq.http = null; +ajaxReq.postSerializer = null; +ajaxReq.SERVERURL = "https://rpc.myetherwallet.com/api.php"; +ajaxReq.DAOPROPOSALSURL = "https://rpc.myetherwallet.com/TheDAO/getDAOProposals.php"; +ajaxReq.COINMARKETCAPAPI = "https://coinmarketcap-nexuist.rhcloud.com/api/"; +ajaxReq.pendingPosts = []; +ajaxReq.config = { + headers: { + 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' + } +}; +ajaxReq.getBalance = function(addr, callback) { + this.post({ + balance: addr + }, callback); +} +ajaxReq.getTransactionData = function(addr, callback) { + this.post({ + txdata: addr + }, callback); +} +ajaxReq.sendRawTx = function(rawTx, callback) { + this.post({ + rawtx: rawTx + }, callback); +} +ajaxReq.getEstimatedGas = function(txobj, callback) { + this.post({ + estimatedGas: txobj + }, callback); +} +ajaxReq.getEthCall = function(txobj, callback) { + this.post({ + ethCall: txobj + }, callback); +} +ajaxReq.queuePost = function() { + var data = this.pendingPosts[0].data; + var callback = this.pendingPosts[0].callback; + this.http.post(this.SERVERURL, this.postSerializer(data), this.config).then(function(data) { + callback(data.data); + ajaxReq.pendingPosts.splice(0, 1); + if(ajaxReq.pendingPosts.length>0) + ajaxReq.queuePost(); + }); +} +ajaxReq.post = function(data, callback) { + this.pendingPosts.push({ + data: data, + callback: callback + }); + if(this.pendingPosts.length==1) + this.queuePost(); +} +ajaxReq.getETHvalue = function(callback) { + var prefix = "eth"; + this.http.get(this.COINMARKETCAPAPI + prefix).then(function(data) { + data = data['data']['price']; + var priceObj = { + usd: data['usd'].toFixed(6), + eur: data['eur'].toFixed(6), + btc: data['btc'].toFixed(6) + }; + callback(priceObj); + }); +} +ajaxReq.getDAOProposals = function(callback) { + this.http.get(this.DAOPROPOSALSURL).then(function(data) { + callback(data.data); + }); +} module.exports = ajaxReq; },{}],2:[function(require,module,exports){ -'use strict'; -var addWalletCtrl = function($scope, $sce) { - $scope.showBtnGen = $scope.showBtnUnlock = $scope.showBtnAdd = $scope.showBtnAddWallet = $scope.showAddWallet = $scope.requireFPass = $scope.requirePPass = $scope.showPassTxt = false; - $scope.nickNames = []; - $scope.filePassword = $scope.fileContent = ""; - $scope.wallet = null; - $scope.addAccount = { - address: "", - nickName: "", - encStr: "", - password: "" - }; - $scope.onPrivKeyChange = function() { - $scope.addWalletStats = ""; - $scope.requirePPass = $scope.manualprivkey.length == 128 || $scope.manualprivkey.length == 132; - $scope.showBtnUnlock = $scope.manualprivkey.length == 64; - }; - $scope.onPrivKeyPassChange = function() { - $scope.showBtnUnlock = $scope.privPassword.length > 6; - }; - $scope.showContent = function($fileContent) { - $scope.fileStatus = $sce.trustAsHtml(globalFuncs.getSuccessText("File Selected: " + document.getElementById('fselector').files[0].name)); - try { - $scope.requireFPass = Wallet.walletRequirePass($fileContent); - $scope.showBtnUnlock = !$scope.requireFPass; - $scope.fileContent = $fileContent; - } catch (e) { - $scope.fileStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - }; - $scope.openFileDialog = function($fileContent) { - $scope.addWalletStats = ""; - document.getElementById('fselector').click(); - }; - $scope.onFilePassChange = function() { - $scope.showBtnUnlock = $scope.filePassword.length > 6; - }; - $scope.decryptWallet = function() { - $scope.wallet = null; - $scope.addWalletStats = ""; - try { - if ($scope.walletType == "pasteprivkey" && $scope.requirePPass) { - $scope.wallet = Wallet.fromMyEtherWalletKey($scope.manualprivkey, $scope.privPassword); - $scope.addAccount.password = $scope.privPassword; - } else if ($scope.walletType == "pasteprivkey" && !$scope.requirePPass) { - $scope.wallet = new Wallet($scope.manualprivkey); - $scope.addAccount.password = ''; - } else if ($scope.walletType == "fileupload") { - $scope.wallet = Wallet.getWalletFromPrivKeyFile($scope.fileContent, $scope.filePassword); - $scope.addAccount.password = $scope.filePassword; - } - $scope.addAccount.address = $scope.wallet.getAddressString(); - } catch (e) { - $scope.addWalletStats = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[6] + e)); - } - if ($scope.wallet != null) { - $scope.addWalletStats = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[1])); - $scope.showAddWallet = true; - $scope.showPassTxt = $scope.addAccount.password == ''; - $scope.setBalance(); - } - }; - $scope.setNickNames = function() { - cxFuncs.getAllNickNames(function(nicks) { - $scope.nickNames = nicks; - }); - }; - $scope.setNickNames(); - $scope.newWalletChange = function(varStatus, shwbtn) { - if ($scope.addAccount.nickName != "" && $scope.nickNames.indexOf($scope.addAccount.nickName) == -1 && $scope.addAccount.password.length > 8) $scope[shwbtn] = true; - else $scope[shwbtn] = false; - if ($scope.nickNames.indexOf($scope.addAccount.nickName) !== -1) $scope[varStatus] = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[13])); - else $scope[varStatus] = ""; - } - $scope.watchOnlyChange = function() { - if ($scope.addAccount.address != "" && $scope.addAccount.nickName != "" && $scope.nickNames.indexOf($scope.addAccount.nickName) == -1 && ethFuncs.validateEtherAddress($scope.addAccount.address)) $scope.showBtnAdd = true; - else $scope.showBtnAdd = false; - if ($scope.addAccount.address != "" && !ethFuncs.validateEtherAddress($scope.addAccount.address)) $scope.watchOnlyStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[5])); - else if ($scope.nickNames.indexOf($scope.addAccount.nickName) !== -1) $scope.watchOnlyStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[13])); - else $scope.watchOnlyStatus = ""; - } - $scope.addWatchOnly = function() { - if ($scope.nickNames.indexOf($scope.addAccount.nickName) !== -1) { - $scope.addWalletStats = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[13])); - return; - } - cxFuncs.addWatchOnlyAddress($scope.addAccount.address, $scope.addAccount.nickName, function() { - if (chrome.runtime.lastError) { - $scope.addWalletStats = $sce.trustAsHtml(globalFuncs.getDangerText(chrome.runtime.lastError.message)); - } else { - $scope.addWalletStats = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[3] + $scope.addAccount.address)); - $scope.setNickNames(); - } - $scope.$apply(); - }); - } - $scope.isStrongPass = function(pass) { - return globalFuncs.isStrongPass(pass); - } - $scope.$watch('walletType', function() { - $scope.showBtnGen = $scope.showBtnUnlock = $scope.showBtnAdd = $scope.showAddWallet = false; - $scope.addNewNick = $scope.addNewPass = ""; - $scope.addWalletStats = ""; - }); - $scope.addWalletToStorage = function(status) { - if ($scope.nickNames.indexOf($scope.addAccount.nickName) !== -1) { - $scope[status] = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[13])); - return; - } else if($scope.nickNames.indexOf(ethUtil.toChecksumAddress($scope.addAccount.address)) !== -1){ - $scope[status] = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[16])); - return; - } - cxFuncs.addWalletToStorage($scope.addAccount.address, $scope.addAccount.encStr, $scope.addAccount.nickName, function() { - if (chrome.runtime.lastError) { - $scope[status] = $sce.trustAsHtml(globalFuncs.getDangerText(chrome.runtime.lastError.message)); - } else { - $scope[status] = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[3] + $scope.addAccount.address)); - $scope.setNickNames(); - } - $scope.$apply(); - }); - } - $scope.importWalletToStorage = function() { - var wStr = $scope.wallet.toV3($scope.addAccount.password, { - kdf: globalFuncs.kdf, - n: globalFuncs.scrypt.n - }); - $scope.addAccount.encStr = JSON.stringify(wStr); - $scope.addWalletToStorage('addStatus'); - } - $scope.generateWallet = function() { - var wallet = Wallet.generate(false); - var wStr = wallet.toV3($scope.addAccount.password, { - kdf: globalFuncs.kdf, - n: globalFuncs.scrypt.n - }); - $scope.addAccount.encStr = JSON.stringify(wStr); - $scope.addAccount.address = wallet.getAddressString(); - $scope.addWalletToStorage('addWalletStats'); - } - $scope.setBalance = function() { - ajaxReq.getBalance($scope.wallet.getAddressString(), function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.etherBalance = etherUnits.toEther(data.data.balance, 'wei'); - ajaxReq.getETHvalue(function(data) { - $scope.usdBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.usd); - $scope.eurBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.eur); - $scope.btcBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.btc); - }); - } - }); - } -}; -module.exports = addWalletCtrl; +'use strict'; +var addWalletCtrl = function($scope, $sce) { + $scope.showBtnGen = $scope.showBtnUnlock = $scope.showBtnAdd = $scope.showBtnAddWallet = $scope.showAddWallet = $scope.requireFPass = $scope.requirePPass = $scope.showPassTxt = false; + $scope.nickNames = []; + $scope.filePassword = $scope.fileContent = ""; + $scope.wallet = null; + $scope.addAccount = { + address: "", + nickName: "", + encStr: "", + password: "" + }; + $scope.onPrivKeyChange = function() { + $scope.addWalletStats = ""; + $scope.requirePPass = $scope.manualprivkey.length == 128 || $scope.manualprivkey.length == 132; + $scope.showBtnUnlock = $scope.manualprivkey.length == 64; + }; + $scope.onPrivKeyPassChange = function() { + $scope.showBtnUnlock = $scope.privPassword.length > 6; + }; + $scope.showContent = function($fileContent) { + $scope.fileStatus = $sce.trustAsHtml(globalFuncs.getSuccessText("File Selected: " + document.getElementById('fselector').files[0].name)); + try { + $scope.requireFPass = Wallet.walletRequirePass($fileContent); + $scope.showBtnUnlock = !$scope.requireFPass; + $scope.fileContent = $fileContent; + } catch (e) { + $scope.fileStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + }; + $scope.openFileDialog = function($fileContent) { + $scope.addWalletStats = ""; + document.getElementById('fselector').click(); + }; + $scope.onFilePassChange = function() { + $scope.showBtnUnlock = $scope.filePassword.length > 6; + }; + $scope.decryptWallet = function() { + $scope.wallet = null; + $scope.addWalletStats = ""; + try { + if ($scope.walletType == "pasteprivkey" && $scope.requirePPass) { + $scope.wallet = Wallet.fromMyEtherWalletKey($scope.manualprivkey, $scope.privPassword); + $scope.addAccount.password = $scope.privPassword; + } else if ($scope.walletType == "pasteprivkey" && !$scope.requirePPass) { + $scope.wallet = new Wallet($scope.manualprivkey); + $scope.addAccount.password = ''; + } else if ($scope.walletType == "fileupload") { + $scope.wallet = Wallet.getWalletFromPrivKeyFile($scope.fileContent, $scope.filePassword); + $scope.addAccount.password = $scope.filePassword; + } + $scope.addAccount.address = $scope.wallet.getAddressString(); + } catch (e) { + $scope.addWalletStats = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[6] + e)); + } + if ($scope.wallet != null) { + $scope.addWalletStats = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[1])); + $scope.showAddWallet = true; + $scope.showPassTxt = $scope.addAccount.password == ''; + $scope.setBalance(); + } + }; + $scope.setNickNames = function() { + cxFuncs.getAllNickNames(function(nicks) { + $scope.nickNames = nicks; + }); + }; + $scope.setNickNames(); + $scope.newWalletChange = function(varStatus, shwbtn) { + if ($scope.addAccount.nickName != "" && $scope.nickNames.indexOf($scope.addAccount.nickName) == -1 && $scope.addAccount.password.length > 8) $scope[shwbtn] = true; + else $scope[shwbtn] = false; + if ($scope.nickNames.indexOf($scope.addAccount.nickName) !== -1) $scope[varStatus] = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[13])); + else $scope[varStatus] = ""; + } + $scope.watchOnlyChange = function() { + if ($scope.addAccount.address != "" && $scope.addAccount.nickName != "" && $scope.nickNames.indexOf($scope.addAccount.nickName) == -1 && ethFuncs.validateEtherAddress($scope.addAccount.address)) $scope.showBtnAdd = true; + else $scope.showBtnAdd = false; + if ($scope.addAccount.address != "" && !ethFuncs.validateEtherAddress($scope.addAccount.address)) $scope.watchOnlyStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[5])); + else if ($scope.nickNames.indexOf($scope.addAccount.nickName) !== -1) $scope.watchOnlyStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[13])); + else $scope.watchOnlyStatus = ""; + } + $scope.addWatchOnly = function() { + if ($scope.nickNames.indexOf($scope.addAccount.nickName) !== -1) { + $scope.addWalletStats = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[13])); + return; + } + cxFuncs.addWatchOnlyAddress($scope.addAccount.address, $scope.addAccount.nickName, function() { + if (chrome.runtime.lastError) { + $scope.addWalletStats = $sce.trustAsHtml(globalFuncs.getDangerText(chrome.runtime.lastError.message)); + } else { + $scope.addWalletStats = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[3] + $scope.addAccount.address)); + $scope.setNickNames(); + } + $scope.$apply(); + }); + } + $scope.isStrongPass = function(pass) { + return globalFuncs.isStrongPass(pass); + } + $scope.$watch('walletType', function() { + $scope.showBtnGen = $scope.showBtnUnlock = $scope.showBtnAdd = $scope.showAddWallet = false; + $scope.addNewNick = $scope.addNewPass = ""; + $scope.addWalletStats = ""; + }); + $scope.addWalletToStorage = function(status) { + if ($scope.nickNames.indexOf($scope.addAccount.nickName) !== -1) { + $scope[status] = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[13])); + return; + } else if($scope.nickNames.indexOf(ethUtil.toChecksumAddress($scope.addAccount.address)) !== -1){ + $scope[status] = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[16])); + return; + } + cxFuncs.addWalletToStorage($scope.addAccount.address, $scope.addAccount.encStr, $scope.addAccount.nickName, function() { + if (chrome.runtime.lastError) { + $scope[status] = $sce.trustAsHtml(globalFuncs.getDangerText(chrome.runtime.lastError.message)); + } else { + $scope[status] = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[3] + $scope.addAccount.address)); + $scope.setNickNames(); + } + $scope.$apply(); + }); + } + $scope.importWalletToStorage = function() { + var wStr = $scope.wallet.toV3($scope.addAccount.password, { + kdf: globalFuncs.kdf, + n: globalFuncs.scrypt.n + }); + $scope.addAccount.encStr = JSON.stringify(wStr); + $scope.addWalletToStorage('addStatus'); + } + $scope.generateWallet = function() { + var wallet = Wallet.generate(false); + var wStr = wallet.toV3($scope.addAccount.password, { + kdf: globalFuncs.kdf, + n: globalFuncs.scrypt.n + }); + $scope.addAccount.encStr = JSON.stringify(wStr); + $scope.addAccount.address = wallet.getAddressString(); + $scope.addWalletToStorage('addWalletStats'); + } + $scope.setBalance = function() { + ajaxReq.getBalance($scope.wallet.getAddressString(), function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.etherBalance = etherUnits.toEther(data.data.balance, 'wei'); + ajaxReq.getETHvalue(function(data) { + $scope.usdBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.usd); + $scope.eurBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.eur); + $scope.btcBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.btc); + }); + } + }); + } +}; +module.exports = addWalletCtrl; },{}],3:[function(require,module,exports){ -'use strict'; -var cxDecryptWalletCtrl = function($scope, $sce, walletService) { - $scope.allWallets = []; - $scope.selectedWallet = $scope.password = ""; - $scope.setAllWallets = function() { - cxFuncs.getWalletsArr(function(wlts) { - $scope.allWallets = wlts; - $scope.updateBalance(); - $scope.$apply(); - }); - }; - $scope.updateBalance = function() { - for (var i = 0; i < $scope.allWallets.length; i++) { - $scope.setBalance($scope.allWallets[i].addr,i); - } - }; - $scope.setBalance = function(address,id) { - ajaxReq.getBalance(address, function(data) { - if (data.error) { - $scope.allWallets[id].balance = data.msg; - } else { - $scope.allWallets[id].balance = etherUnits.toEther(data.data.balance, 'wei'); - } - }); - }; - $scope.setAllWallets(); - $scope.getPrivFromAdd = function(){ - if ($scope.selectedWallet=="") throw globalFuncs.errorMsgs[5]; - for (var i = 0; i < $scope.allWallets.length; i++) { - if( $scope.allWallets[i].addr==$scope.selectedWallet) - return $scope.allWallets[i].priv; - } - throw globalFuncs.errorMsgs[14]; - } - $scope.decryptWallet = function() { - $scope.wallet=null; - $scope.decryptStatus=""; - try { - var priv = $scope.getPrivFromAdd(); - if (priv.length==132) - $scope.wallet = Wallet.fromMyEtherWalletKey(priv, $scope.password); - else - $scope.wallet = Wallet.getWalletFromPrivKeyFile(priv, $scope.password); - walletService.password = $scope.password; - walletService.wallet = $scope.wallet; - } catch (e) { - $scope.decryptStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[6] + ":" + e)); - } - if($scope.wallet!=null) $scope.decryptStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[1])); - }; -}; +'use strict'; +var cxDecryptWalletCtrl = function($scope, $sce, walletService) { + $scope.allWallets = []; + $scope.selectedWallet = $scope.password = ""; + $scope.setAllWallets = function() { + cxFuncs.getWalletsArr(function(wlts) { + $scope.allWallets = wlts; + $scope.updateBalance(); + $scope.$apply(); + }); + }; + $scope.updateBalance = function() { + for (var i = 0; i < $scope.allWallets.length; i++) { + $scope.setBalance($scope.allWallets[i].addr,i); + } + }; + $scope.setBalance = function(address,id) { + ajaxReq.getBalance(address, function(data) { + if (data.error) { + $scope.allWallets[id].balance = data.msg; + } else { + $scope.allWallets[id].balance = etherUnits.toEther(data.data.balance, 'wei'); + } + }); + }; + $scope.setAllWallets(); + $scope.getPrivFromAdd = function(){ + if ($scope.selectedWallet=="") throw globalFuncs.errorMsgs[5]; + for (var i = 0; i < $scope.allWallets.length; i++) { + if( $scope.allWallets[i].addr==$scope.selectedWallet) + return $scope.allWallets[i].priv; + } + throw globalFuncs.errorMsgs[14]; + } + $scope.decryptWallet = function() { + $scope.wallet=null; + $scope.decryptStatus=""; + try { + var priv = $scope.getPrivFromAdd(); + if (priv.length==132) + $scope.wallet = Wallet.fromMyEtherWalletKey(priv, $scope.password); + else + $scope.wallet = Wallet.getWalletFromPrivKeyFile(priv, $scope.password); + walletService.password = $scope.password; + walletService.wallet = $scope.wallet; + } catch (e) { + $scope.decryptStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[6] + ":" + e)); + } + if($scope.wallet!=null) $scope.decryptStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[1])); + }; +}; module.exports = cxDecryptWalletCtrl; },{}],4:[function(require,module,exports){ -'use strict'; -var mainPopCtrl = function($scope, $sce) { - $scope.allWallets = []; - $scope.allWatchOnly = []; - $scope.setAllWallets = function() { - cxFuncs.getWalletsArr(function(wlts) { - $scope.allWallets = wlts; - $scope.updateBalance('allWallets'); - }); - cxFuncs.getWatchOnlyArr(function(wlts) { - $scope.allWatchOnly = wlts; - $scope.updateBalance('allWatchOnly'); - $scope.$apply(); - }); - }; - $scope.updateBalance = function(varWal) { - for (var i = 0; i < $scope[varWal].length; i++) { - $scope.setBalance($scope[varWal][i].addr, i, varWal); - } - }; - $scope.setBalance = function(address, id, varWal) { - ajaxReq.getBalance(address, function(data) { - if (data.error) { - $scope[varWal][id].balance = data.msg; - } else { - $scope[varWal][id].balance = etherUnits.toEther(data.data.balance, 'wei'); - $scope[varWal][id].balanceR = new BigNumber($scope[varWal][id].balance).toPrecision(5); - } - }); - }; - $scope.setAllWallets(); -}; -module.exports = mainPopCtrl; +'use strict'; +var mainPopCtrl = function($scope, $sce) { + $scope.allWallets = []; + $scope.allWatchOnly = []; + $scope.setAllWallets = function() { + cxFuncs.getWalletsArr(function(wlts) { + $scope.allWallets = wlts; + $scope.updateBalance('allWallets'); + }); + cxFuncs.getWatchOnlyArr(function(wlts) { + $scope.allWatchOnly = wlts; + $scope.updateBalance('allWatchOnly'); + $scope.$apply(); + }); + }; + $scope.updateBalance = function(varWal) { + for (var i = 0; i < $scope[varWal].length; i++) { + $scope.setBalance($scope[varWal][i].addr, i, varWal); + } + }; + $scope.setBalance = function(address, id, varWal) { + ajaxReq.getBalance(address, function(data) { + if (data.error) { + $scope[varWal][id].balance = data.msg; + } else { + $scope[varWal][id].balance = etherUnits.toEther(data.data.balance, 'wei'); + $scope[varWal][id].balanceR = new BigNumber($scope[varWal][id].balance).toPrecision(5); + } + }); + }; + $scope.setAllWallets(); +}; +module.exports = mainPopCtrl; },{}],5:[function(require,module,exports){ -'use strict'; -var myWalletsCtrl = function($scope, $sce) { - $scope.editModal = new Modal(document.getElementById('editWallet')); - $scope.viewModal = new Modal(document.getElementById('viewWalletDetails')); - $scope.removeModal = new Modal(document.getElementById('removeWallet')); - $scope.allWallets = []; - $scope.allWatchOnly = []; - $scope.nickNames = []; - $scope.fiatVal = { - usd: 0, - eur: 0, - btc: 0 - }; - $scope.viewWallet = {}; - $scope.setNickNames = function() { - cxFuncs.getAllNickNames(function(nicks) { - $scope.nickNames = nicks; - }); - }; - $scope.setAllWallets = function() { - cxFuncs.getWalletsArr(function(wlts) { - $scope.allWallets = wlts; - $scope.updateBalance('allWallets'); - }); - cxFuncs.getWatchOnlyArr(function(wlts) { - $scope.allWatchOnly = wlts; - $scope.updateBalance('allWatchOnly'); - $scope.$apply(); - }); - }; - $scope.updateBalance = function(varWal) { - for (var i = 0; i < $scope[varWal].length; i++) { - $scope.setBalance($scope[varWal][i].addr, i, varWal); - } - }; - $scope.setBalance = function(address, id, varWal) { - ajaxReq.getBalance(address, function(data) { - if (data.error) { - $scope[varWal][id].balance = data.msg; - } else { - $scope[varWal][id].balance = etherUnits.toEther(data.data.balance, 'wei'); - $scope[varWal][id].balanceR = new BigNumber($scope[varWal][id].balance).toPrecision(5); - $scope[varWal][id].usd = etherUnits.toFiat($scope[varWal][id].balance, 'ether', $scope.fiatVal.usd); - $scope[varWal][id].eur = etherUnits.toFiat($scope[varWal][id].balance, 'ether', $scope.fiatVal.eur); - $scope[varWal][id].btc = etherUnits.toFiat($scope[varWal][id].balance, 'ether', $scope.fiatVal.btc); - } - }); - }; - $scope.setViewWalletObj = function(val, type) { - var vtype = 'allWallets'; - if (type == 'watchOnly') vtype = 'allWatchOnly' - $scope.viewWallet = { - nick: $scope[vtype][val].nick, - addr: $scope[vtype][val].addr, - id: val, - type: type - } - } - $scope.editMWallet = function(val, type) { - $scope.setViewWalletObj(val, type); - $scope.editModal.open(); - } - $scope.editSave = function() { - if ($scope.nickNames.indexOf($scope.viewWallet.nick) !== -1) { - $scope.editStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[13])); - return; - } else { - cxFuncs.editNickName($scope.viewWallet.addr, $scope.viewWallet.nick, function() { - if (chrome.runtime.lastError) $scope.editStatus = $sce.trustAsHtml(globalFuncs.getDangerText(chrome.runtime.lastError.message)); - else { - $scope.setAllWallets(); - $scope.setNickNames(); - $scope.editModal.close(); - } - }); - } - } - $scope.viewMWallet = function(val, type) { - $scope.setViewWalletObj(val, type); - $scope.viewModal.open(); - } - $scope.decryptWallet = function() { - $scope.wallet = null; - $scope.viewStatus = ""; - try { - var priv = $scope.allWallets[$scope.viewWallet.id].priv; - if (priv.length==132) - $scope.wallet = Wallet.fromMyEtherWalletKey(priv, $scope.password); - else - $scope.wallet = Wallet.getWalletFromPrivKeyFile(priv, $scope.password); - $scope.viewModal.close(); - $scope.setWalletInfo(); - $scope.password = ""; - } catch (e) { - $scope.viewStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[6] + ":" + e)); - } - }; - $scope.printQRCode = function() { - globalFuncs.printPaperWallets(JSON.stringify([{ - address: $scope.wallet.getAddressString(), - private: $scope.wallet.getPrivateKeyString() - }])); - } - $scope.resetWallet = function() { - $scope.wallet = null; - $scope.blob = $scope.blobEnc = $scope.password = ""; - } - $scope.setWalletInfo = function() { - $scope.blob = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toJSON()); - if ($scope.password != '') { - $scope.blobEnc = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toV3($scope.password, { - kdf: globalFuncs.kdf, - n: globalFuncs.scrypt.n - })); - $scope.encFileName = $scope.wallet.getV3Filename(); - } - ajaxReq.getBalance($scope.wallet.getAddressString(), function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.etherBalance = etherUnits.toEther(data.data.balance, 'wei'); - ajaxReq.getETHvalue(function(data) { - $scope.usdBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.usd); - $scope.eurBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.eur); - $scope.btcBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.btc); - }); - } - }); - } - $scope.deleteWalletMsg = function(val, type) { - $scope.setViewWalletObj(val, type); - $scope.removeModal.open(); - } - $scope.deleteWallet = function() { - cxFuncs.deleteAccount($scope.viewWallet.addr, function() { - $scope.setAllWallets(); - $scope.setNickNames(); - $scope.removeModal.close(); - }); - } - ajaxReq.getETHvalue(function(data) { - $scope.fiatVal.usd = data.usd; - $scope.fiatVal.eur = data.eur; - $scope.fiatVal.btc = data.btc; - $scope.setAllWallets(); - }); - $scope.setNickNames(); -}; +'use strict'; +var myWalletsCtrl = function($scope, $sce) { + $scope.editModal = new Modal(document.getElementById('editWallet')); + $scope.viewModal = new Modal(document.getElementById('viewWalletDetails')); + $scope.removeModal = new Modal(document.getElementById('removeWallet')); + $scope.allWallets = []; + $scope.allWatchOnly = []; + $scope.nickNames = []; + $scope.fiatVal = { + usd: 0, + eur: 0, + btc: 0 + }; + $scope.viewWallet = {}; + $scope.setNickNames = function() { + cxFuncs.getAllNickNames(function(nicks) { + $scope.nickNames = nicks; + }); + }; + $scope.setAllWallets = function() { + cxFuncs.getWalletsArr(function(wlts) { + $scope.allWallets = wlts; + $scope.updateBalance('allWallets'); + }); + cxFuncs.getWatchOnlyArr(function(wlts) { + $scope.allWatchOnly = wlts; + $scope.updateBalance('allWatchOnly'); + $scope.$apply(); + }); + }; + $scope.updateBalance = function(varWal) { + for (var i = 0; i < $scope[varWal].length; i++) { + $scope.setBalance($scope[varWal][i].addr, i, varWal); + } + }; + $scope.setBalance = function(address, id, varWal) { + ajaxReq.getBalance(address, function(data) { + if (data.error) { + $scope[varWal][id].balance = data.msg; + } else { + $scope[varWal][id].balance = etherUnits.toEther(data.data.balance, 'wei'); + $scope[varWal][id].balanceR = new BigNumber($scope[varWal][id].balance).toPrecision(5); + $scope[varWal][id].usd = etherUnits.toFiat($scope[varWal][id].balance, 'ether', $scope.fiatVal.usd); + $scope[varWal][id].eur = etherUnits.toFiat($scope[varWal][id].balance, 'ether', $scope.fiatVal.eur); + $scope[varWal][id].btc = etherUnits.toFiat($scope[varWal][id].balance, 'ether', $scope.fiatVal.btc); + } + }); + }; + $scope.setViewWalletObj = function(val, type) { + var vtype = 'allWallets'; + if (type == 'watchOnly') vtype = 'allWatchOnly' + $scope.viewWallet = { + nick: $scope[vtype][val].nick, + addr: $scope[vtype][val].addr, + id: val, + type: type + } + } + $scope.editMWallet = function(val, type) { + $scope.setViewWalletObj(val, type); + $scope.editModal.open(); + } + $scope.editSave = function() { + if ($scope.nickNames.indexOf($scope.viewWallet.nick) !== -1) { + $scope.editStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[13])); + return; + } else { + cxFuncs.editNickName($scope.viewWallet.addr, $scope.viewWallet.nick, function() { + if (chrome.runtime.lastError) $scope.editStatus = $sce.trustAsHtml(globalFuncs.getDangerText(chrome.runtime.lastError.message)); + else { + $scope.setAllWallets(); + $scope.setNickNames(); + $scope.editModal.close(); + } + }); + } + } + $scope.viewMWallet = function(val, type) { + $scope.setViewWalletObj(val, type); + $scope.viewModal.open(); + } + $scope.decryptWallet = function() { + $scope.wallet = null; + $scope.viewStatus = ""; + try { + var priv = $scope.allWallets[$scope.viewWallet.id].priv; + if (priv.length==132) + $scope.wallet = Wallet.fromMyEtherWalletKey(priv, $scope.password); + else + $scope.wallet = Wallet.getWalletFromPrivKeyFile(priv, $scope.password); + $scope.viewModal.close(); + $scope.setWalletInfo(); + $scope.password = ""; + } catch (e) { + $scope.viewStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[6] + ":" + e)); + } + }; + $scope.printQRCode = function() { + globalFuncs.printPaperWallets(JSON.stringify([{ + address: $scope.wallet.getAddressString(), + private: $scope.wallet.getPrivateKeyString() + }])); + } + $scope.resetWallet = function() { + $scope.wallet = null; + $scope.blob = $scope.blobEnc = $scope.password = ""; + } + $scope.setWalletInfo = function() { + $scope.blob = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toJSON()); + if ($scope.password != '') { + $scope.blobEnc = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toV3($scope.password, { + kdf: globalFuncs.kdf, + n: globalFuncs.scrypt.n + })); + $scope.encFileName = $scope.wallet.getV3Filename(); + } + ajaxReq.getBalance($scope.wallet.getAddressString(), function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.etherBalance = etherUnits.toEther(data.data.balance, 'wei'); + ajaxReq.getETHvalue(function(data) { + $scope.usdBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.usd); + $scope.eurBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.eur); + $scope.btcBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.btc); + }); + } + }); + } + $scope.deleteWalletMsg = function(val, type) { + $scope.setViewWalletObj(val, type); + $scope.removeModal.open(); + } + $scope.deleteWallet = function() { + cxFuncs.deleteAccount($scope.viewWallet.addr, function() { + $scope.setAllWallets(); + $scope.setNickNames(); + $scope.removeModal.close(); + }); + } + ajaxReq.getETHvalue(function(data) { + $scope.fiatVal.usd = data.usd; + $scope.fiatVal.eur = data.eur; + $scope.fiatVal.btc = data.btc; + $scope.setAllWallets(); + }); + $scope.setNickNames(); +}; module.exports = myWalletsCtrl; },{}],6:[function(require,module,exports){ -'use strict'; -var quickSendCtrl = function($scope, $sce) { - $scope.allWallets = []; - $scope.selectedWallet = ""; - $scope.showConfirm = false; - $scope.tx = { - gasLimit: globalFuncs.defaultTxGasLimit, - data: "", - to: "", - unit: "ether", - value: "", - nonce: null, - gasPrice: null, - donate: false - } - $scope.setAllWallets = function() { - cxFuncs.getWalletsArr(function(wlts) { - $scope.allWallets = wlts; - $scope.updateBalance('allWallets'); - }); - }; - $scope.updateBalance = function(varWal) { - for (var i = 0; i < $scope[varWal].length; i++) { - $scope.setBalance($scope[varWal][i].addr, i, varWal); - } - }; - $scope.setBalance = function(address, id, varWal) { - ajaxReq.getBalance(address, function(data) { - if (data.error) { - $scope[varWal][id].balance = data.msg; - } else { - $scope[varWal][id].balance = etherUnits.toEther(data.data.balance, 'wei'); - $scope[varWal][id].balanceR = new BigNumber($scope[varWal][id].balance).toPrecision(5); - } - }); - }; - $scope.validateAddress = function() { - if (ethFuncs.validateEtherAddress($scope.tx.to)) { - $scope.validateAddressStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[0])); - } else { - $scope.validateAddressStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[5])); - } - } - $scope.transferAllBalance = function() { - $scope.wallet = {}; - $scope.wallet.getAddressString = function() { - return $scope.allWallets[$scope.selectedWallet].addr; - } - uiFuncs.transferAllBalance($scope, $sce); - } - $scope.prepTX = function() { - try { - if (!ethFuncs.validateEtherAddress($scope.tx.to)) throw globalFuncs.errorMsgs[5]; - else if (!globalFuncs.isNumeric($scope.tx.value) || parseFloat($scope.tx.value) < 0) throw globalFuncs.errorMsgs[7]; - $scope.showConfirm = true; - } catch (e) { - $scope.prepTXStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - } - $scope.unlockAndSend = function() { - try { - $scope.decryptWallet(); - $scope.autoSend = true; - uiFuncs.generateTx($scope, $sce); - $scope.validateTxStatus = ""; - } catch (e) { - $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - } - $scope.decryptWallet = function() { - $scope.wallet = null; - $scope.validateTxStatus = ""; - $scope.wallet = Wallet.getWalletFromPrivKeyFile($scope.allWallets[$scope.selectedWallet].priv, $scope.password); - }; - $scope.setAllWallets(); -}; +'use strict'; +var quickSendCtrl = function($scope, $sce) { + $scope.allWallets = []; + $scope.selectedWallet = ""; + $scope.showConfirm = false; + $scope.tx = { + gasLimit: globalFuncs.defaultTxGasLimit, + data: "", + to: "", + unit: "ether", + value: "", + nonce: null, + gasPrice: null, + donate: false + } + $scope.setAllWallets = function() { + cxFuncs.getWalletsArr(function(wlts) { + $scope.allWallets = wlts; + $scope.updateBalance('allWallets'); + }); + }; + $scope.updateBalance = function(varWal) { + for (var i = 0; i < $scope[varWal].length; i++) { + $scope.setBalance($scope[varWal][i].addr, i, varWal); + } + }; + $scope.setBalance = function(address, id, varWal) { + ajaxReq.getBalance(address, function(data) { + if (data.error) { + $scope[varWal][id].balance = data.msg; + } else { + $scope[varWal][id].balance = etherUnits.toEther(data.data.balance, 'wei'); + $scope[varWal][id].balanceR = new BigNumber($scope[varWal][id].balance).toPrecision(5); + } + }); + }; + $scope.validateAddress = function() { + if (ethFuncs.validateEtherAddress($scope.tx.to)) { + $scope.validateAddressStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[0])); + } else { + $scope.validateAddressStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[5])); + } + } + $scope.transferAllBalance = function() { + $scope.wallet = {}; + $scope.wallet.getAddressString = function() { + return $scope.allWallets[$scope.selectedWallet].addr; + } + uiFuncs.transferAllBalance($scope, $sce); + } + $scope.prepTX = function() { + try { + if (!ethFuncs.validateEtherAddress($scope.tx.to)) throw globalFuncs.errorMsgs[5]; + else if (!globalFuncs.isNumeric($scope.tx.value) || parseFloat($scope.tx.value) < 0) throw globalFuncs.errorMsgs[7]; + $scope.showConfirm = true; + } catch (e) { + $scope.prepTXStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + } + $scope.unlockAndSend = function() { + try { + $scope.decryptWallet(); + $scope.autoSend = true; + uiFuncs.generateTx($scope, $sce); + $scope.validateTxStatus = ""; + } catch (e) { + $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + } + $scope.decryptWallet = function() { + $scope.wallet = null; + $scope.validateTxStatus = ""; + $scope.wallet = Wallet.getWalletFromPrivKeyFile($scope.allWallets[$scope.selectedWallet].priv, $scope.password); + }; + $scope.setAllWallets(); +}; module.exports = quickSendCtrl; },{}],7:[function(require,module,exports){ -'use strict'; -var bulkGenCtrl = function($scope) { - $scope.showWallets = false; - $scope.genWallets = function(){ - if($scope.amount==''||$scope.amount != parseInt($scope.amount, 10)) alert(globalFuncs.errorMsgs[0]); - else { - $scope.wallets = []; - var csv = ''; var txt = ''; - $scope.jsonWallets = []; - for(var i=0;i<$scope.amount;i++){ - var tWallet = Wallet.generate(false); - csv += tWallet.getChecksumAddressString() + ',' + tWallet.getPrivateKeyString() + '\n'; - txt += tWallet.getChecksumAddressString() + '\t' + tWallet.getPrivateKeyString() + '\n'; - $scope.jsonWallets.push({ - address: tWallet.getChecksumAddressString(), - private: tWallet.getPrivateKeyString() - }); - $scope.wallets.push(tWallet); - } - $scope.showWallets = true; - $scope.bJSON = globalFuncs.getBlob("text/json;charset=UTF-8",JSON.stringify($scope.jsonWallets)); - $scope.bTXT = globalFuncs.getBlob("text/plain;charset=UTF-8",txt); - $scope.bCSV = globalFuncs.getBlob("text/csv;charset=UTF-8",csv); - } - } - $scope.printQRCode = function() { - globalFuncs.printPaperWallets(JSON.stringify($scope.jsonWallets)); - } -}; +'use strict'; +var bulkGenCtrl = function($scope) { + $scope.showWallets = false; + $scope.genWallets = function(){ + if($scope.amount==''||$scope.amount != parseInt($scope.amount, 10)) alert(globalFuncs.errorMsgs[0]); + else { + $scope.wallets = []; + var csv = ''; var txt = ''; + $scope.jsonWallets = []; + for(var i=0;i<$scope.amount;i++){ + var tWallet = Wallet.generate(false); + csv += tWallet.getChecksumAddressString() + ',' + tWallet.getPrivateKeyString() + '\n'; + txt += tWallet.getChecksumAddressString() + '\t' + tWallet.getPrivateKeyString() + '\n'; + $scope.jsonWallets.push({ + address: tWallet.getChecksumAddressString(), + private: tWallet.getPrivateKeyString() + }); + $scope.wallets.push(tWallet); + } + $scope.showWallets = true; + $scope.bJSON = globalFuncs.getBlob("text/json;charset=UTF-8",JSON.stringify($scope.jsonWallets)); + $scope.bTXT = globalFuncs.getBlob("text/plain;charset=UTF-8",txt); + $scope.bCSV = globalFuncs.getBlob("text/csv;charset=UTF-8",csv); + } + } + $scope.printQRCode = function() { + globalFuncs.printPaperWallets(JSON.stringify($scope.jsonWallets)); + } +}; module.exports = bulkGenCtrl; },{}],8:[function(require,module,exports){ -'use strict'; -var decryptWalletCtrl = function($scope, $sce, walletService) { - $scope.walletType = ""; - $scope.requireFPass = $scope.requirePPass = $scope.showFDecrypt = $scope.showPDecrypt = false; - $scope.filePassword = ""; - $scope.fileContent = ""; - $scope.showContent = function($fileContent) { - $scope.fileStatus = $sce.trustAsHtml(globalFuncs.getSuccessText("File Selected: " + document.getElementById('fselector').files[0].name)); - try { - $scope.requireFPass = Wallet.walletRequirePass($fileContent); - $scope.showFDecrypt = !$scope.requireFPass; - $scope.fileContent = $fileContent; - } catch (e) { - $scope.fileStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - }; - $scope.openFileDialog = function($fileContent) { - document.getElementById('fselector').click(); - }; - $scope.onFilePassChange = function() { - $scope.showFDecrypt = $scope.filePassword.length > 3; - }; - $scope.onPrivKeyChange = function() { - $scope.requirePPass = $scope.manualprivkey.length == 128 || $scope.manualprivkey.length == 132; - $scope.showPDecrypt = $scope.manualprivkey.length == 64; - }; - $scope.onPrivKeyPassChange = function() { - $scope.showPDecrypt = $scope.privPassword.length > 6; - }; - $scope.decryptWallet = function() { - $scope.wallet=null; - $scope.decryptStatus=""; - try { - if ($scope.showPDecrypt && $scope.requirePPass) { - $scope.wallet = Wallet.fromMyEtherWalletKey($scope.manualprivkey, $scope.privPassword); - walletService.password = $scope.privPassword; - } else if ($scope.showPDecrypt && !$scope.requirePPass) { - $scope.wallet = new Wallet($scope.manualprivkey); - walletService.password = ''; - } else if ($scope.showFDecrypt) { - $scope.wallet = Wallet.getWalletFromPrivKeyFile($scope.fileContent, $scope.filePassword); - walletService.password = $scope.filePassword; - } - walletService.wallet = $scope.wallet; - } catch (e) { - $scope.decryptStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[6]+e)); - } - if($scope.wallet!=null) $scope.decryptStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[1])); - }; -}; +'use strict'; +var decryptWalletCtrl = function($scope, $sce, walletService) { + $scope.walletType = ""; + $scope.requireFPass = $scope.requirePPass = $scope.showFDecrypt = $scope.showPDecrypt = false; + $scope.filePassword = ""; + $scope.fileContent = ""; + $scope.showContent = function($fileContent) { + $scope.fileStatus = $sce.trustAsHtml(globalFuncs.getSuccessText("File Selected: " + document.getElementById('fselector').files[0].name)); + try { + $scope.requireFPass = Wallet.walletRequirePass($fileContent); + $scope.showFDecrypt = !$scope.requireFPass; + $scope.fileContent = $fileContent; + } catch (e) { + $scope.fileStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + }; + $scope.openFileDialog = function($fileContent) { + document.getElementById('fselector').click(); + }; + $scope.onFilePassChange = function() { + $scope.showFDecrypt = $scope.filePassword.length > 3; + }; + $scope.onPrivKeyChange = function() { + $scope.requirePPass = $scope.manualprivkey.length == 128 || $scope.manualprivkey.length == 132; + $scope.showPDecrypt = $scope.manualprivkey.length == 64; + }; + $scope.onPrivKeyPassChange = function() { + $scope.showPDecrypt = $scope.privPassword.length > 6; + }; + $scope.decryptWallet = function() { + $scope.wallet=null; + $scope.decryptStatus=""; + try { + if ($scope.showPDecrypt && $scope.requirePPass) { + $scope.wallet = Wallet.fromMyEtherWalletKey($scope.manualprivkey, $scope.privPassword); + walletService.password = $scope.privPassword; + } else if ($scope.showPDecrypt && !$scope.requirePPass) { + $scope.wallet = new Wallet($scope.manualprivkey); + walletService.password = ''; + } else if ($scope.showFDecrypt) { + $scope.wallet = Wallet.getWalletFromPrivKeyFile($scope.fileContent, $scope.filePassword); + walletService.password = $scope.filePassword; + } + walletService.wallet = $scope.wallet; + } catch (e) { + $scope.decryptStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[6]+e)); + } + if($scope.wallet!=null) $scope.decryptStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[1])); + }; +}; module.exports = decryptWalletCtrl; },{}],9:[function(require,module,exports){ -'use strict'; -var digixCtrl = function($scope, $sce, walletService) { - new Modal(document.getElementById('sendTransaction')); - walletService.wallet = null; - walletService.password = ''; - $scope.showSend = true; - $scope.showRaw = false; - $scope.digixContract = "0xf0160428a8552ac9bb7e050d90eeade4ddd52843"; - $scope.tokenContract = "0xe0b7927c4af23765cb51314a0e0521a9645f0e2a"; - $scope.badgeContract = "0x54bda709fed875224eae569bb6817d96ef7ed9ad"; - $scope.digixUserInfo = "0x1959a002"; - $scope.digixClaim = "0x4e71d92d"; - $scope.digixTransfer = "0xa9059cbb"; - $scope.balanceOf = "0x70a08231"; - $scope.tx = { - gasLimit: globalFuncs.digixClaimTxGasLimit, - data: $scope.digixClaim, - to: $scope.digixContract, - unit: "ether", - value: 0, - nonce: null, - gasPrice: null, - donate: false - } - $scope.tokenTx = { - to: '', - value: 0, - unit: "dgd" - } - $scope.$watch(function() { - if (walletService.wallet == null) return null; - return walletService.wallet.getAddressString(); - }, function() { - if (walletService.wallet == null) return; - $scope.wallet = walletService.wallet; - $scope.setBalance(); - }); - $scope.validateAddress = function(address, status) { - if (ethFuncs.validateEtherAddress(address)) { - $scope[status] = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[0])); - } else { - $scope[status] = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[5])); - } - } - $scope.setBalance = function() { - var tUserInfo = { - to: $scope.digixContract, - data: $scope.digixUserInfo - }; - ajaxReq.getBalance($scope.wallet.getAddressString(), function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.etherBalance = etherUnits.toEther(data.data.balance, 'wei'); - ajaxReq.getETHvalue(function(data) { - $scope.usdBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.usd); - $scope.eurBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.eur); - $scope.btcBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.btc); - }); - } - }); - var userInfo = ethFuncs.getDataObj($scope.digixContract, $scope.digixUserInfo, [ethFuncs.getNakedAddress($scope.wallet.getAddressString())]); - ajaxReq.getEthCall(userInfo, function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - var digixObj = $scope.processDigixInfo(data.data); - $scope.centsTotal = digixObj.centstotal; - $scope.weiTotal = digixObj.weitotal; - $scope.shareTotal = digixObj.share; - $scope.badgesTotal = digixObj.badges; - $scope.claimedTotal = digixObj.claimed.toString(); - } - }); - var tokenBalance = ethFuncs.getDataObj($scope.tokenContract, $scope.balanceOf, [ethFuncs.getNakedAddress($scope.wallet.getAddressString())]); - ajaxReq.getEthCall(tokenBalance, function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.tokenBalance = new BigNumber(data.data).div(1000000000).toString(); - } - }); - var badgeBalance = ethFuncs.getDataObj($scope.badgeContract, $scope.balanceOf, [ethFuncs.getNakedAddress($scope.wallet.getAddressString())]); - ajaxReq.getEthCall(badgeBalance, function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.badgeBalance = new BigNumber(data.data).toString(); - } - }); - } - $scope.processDigixInfo = function(data) { - data = data.replace('0x', ''); - var values = data.match(/.{1,64}/g); - var digixObj = { - centstotal: new BigNumber('0x' + values[0]).div(100).toString(), - weitotal: new BigNumber('0x' + values[1]).div(etherUnits.getValueOfUnit('ether')).toString(), - share: new BigNumber('0x' + values[2]).div(etherUnits.getValueOfUnit('gwei')).toString(), - badges: new BigNumber('0x' + values[3]).toString(), - claimed: new BigNumber('0x' + values[4]).toString() == '1' - }; - return digixObj; - } - $scope.$watch('tx', function() { - $scope.showRaw = false; - $scope.sendTxStatus = ""; - }, true); - $scope.$watch('showSend', function() { - $scope.showRaw = false; - $scope.sendTxStatus = ""; - if (!$scope.showSend) { - $scope.tx.data = $scope.digixClaim; - $scope.tx.to = $scope.digixContract; - $scope.tx.gasLimit = globalFuncs.digixClaimTxGasLimit; - } - }); - $scope.generateTokenTx = function() { - try { - if (!ethFuncs.validateEtherAddress($scope.tokenTx.to)) throw globalFuncs.errorMsgs[5]; - else if (!globalFuncs.isNumeric($scope.tokenTx.value) || parseFloat($scope.tokenTx.value) < 0) throw globalFuncs.errorMsgs[7]; - else if ($scope.tokenTx.unit == "dgd" && new BigNumber($scope.tokenTx.value).greaterThan(new BigNumber($scope.tokenBalance))) throw globalFuncs.errorMsgs[7]; - else if ($scope.tokenTx.unit == "dgdb" && new BigNumber($scope.tokenTx.value).greaterThan(new BigNumber($scope.badgeBalance))) throw globalFuncs.errorMsgs[7]; - var value = 0; - if ($scope.tokenTx.unit == "dgd") { - value = new BigNumber($scope.tokenTx.value).times(etherUnits.getValueOfUnit('gwei')).toString(16); - $scope.tx.to = $scope.tokenContract; - } else { - value = new BigNumber($scope.tokenTx.value).toString(16); - $scope.tx.to = $scope.badgeContract; - } - value = ethFuncs.padLeft(value, 64); - var toAdd = ethFuncs.padLeft(ethFuncs.getNakedAddress($scope.tokenTx.to), 64); - $scope.tx.data = $scope.digixTransfer + toAdd + value; - $scope.tx.value = 0; - $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText('')); - $scope.generateTx(); - } catch (e) { - $scope.showRaw = false; - $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - } - $scope.generateTx = function(){ - uiFuncs.generateTx($scope,$sce); - } - $scope.sendTx = function() { - uiFuncs.sendTx($scope,$sce); - } -}; -module.exports = digixCtrl; +'use strict'; +var digixCtrl = function($scope, $sce, walletService) { + new Modal(document.getElementById('sendTransaction')); + walletService.wallet = null; + walletService.password = ''; + $scope.showSend = true; + $scope.showRaw = false; + $scope.digixContract = "0xf0160428a8552ac9bb7e050d90eeade4ddd52843"; + $scope.tokenContract = "0xe0b7927c4af23765cb51314a0e0521a9645f0e2a"; + $scope.badgeContract = "0x54bda709fed875224eae569bb6817d96ef7ed9ad"; + $scope.digixUserInfo = "0x1959a002"; + $scope.digixClaim = "0x4e71d92d"; + $scope.digixTransfer = "0xa9059cbb"; + $scope.balanceOf = "0x70a08231"; + $scope.tx = { + gasLimit: globalFuncs.digixClaimTxGasLimit, + data: $scope.digixClaim, + to: $scope.digixContract, + unit: "ether", + value: 0, + nonce: null, + gasPrice: null, + donate: false + } + $scope.tokenTx = { + to: '', + value: 0, + unit: "dgd" + } + $scope.$watch(function() { + if (walletService.wallet == null) return null; + return walletService.wallet.getAddressString(); + }, function() { + if (walletService.wallet == null) return; + $scope.wallet = walletService.wallet; + $scope.setBalance(); + }); + $scope.validateAddress = function(address, status) { + if (ethFuncs.validateEtherAddress(address)) { + $scope[status] = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[0])); + } else { + $scope[status] = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[5])); + } + } + $scope.setBalance = function() { + var tUserInfo = { + to: $scope.digixContract, + data: $scope.digixUserInfo + }; + ajaxReq.getBalance($scope.wallet.getAddressString(), function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.etherBalance = etherUnits.toEther(data.data.balance, 'wei'); + ajaxReq.getETHvalue(function(data) { + $scope.usdBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.usd); + $scope.eurBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.eur); + $scope.btcBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.btc); + }); + } + }); + var userInfo = ethFuncs.getDataObj($scope.digixContract, $scope.digixUserInfo, [ethFuncs.getNakedAddress($scope.wallet.getAddressString())]); + ajaxReq.getEthCall(userInfo, function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + var digixObj = $scope.processDigixInfo(data.data); + $scope.centsTotal = digixObj.centstotal; + $scope.weiTotal = digixObj.weitotal; + $scope.shareTotal = digixObj.share; + $scope.badgesTotal = digixObj.badges; + $scope.claimedTotal = digixObj.claimed.toString(); + } + }); + var tokenBalance = ethFuncs.getDataObj($scope.tokenContract, $scope.balanceOf, [ethFuncs.getNakedAddress($scope.wallet.getAddressString())]); + ajaxReq.getEthCall(tokenBalance, function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.tokenBalance = new BigNumber(data.data).div(1000000000).toString(); + } + }); + var badgeBalance = ethFuncs.getDataObj($scope.badgeContract, $scope.balanceOf, [ethFuncs.getNakedAddress($scope.wallet.getAddressString())]); + ajaxReq.getEthCall(badgeBalance, function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.badgeBalance = new BigNumber(data.data).toString(); + } + }); + } + $scope.processDigixInfo = function(data) { + data = data.replace('0x', ''); + var values = data.match(/.{1,64}/g); + var digixObj = { + centstotal: new BigNumber('0x' + values[0]).div(100).toString(), + weitotal: new BigNumber('0x' + values[1]).div(etherUnits.getValueOfUnit('ether')).toString(), + share: new BigNumber('0x' + values[2]).div(etherUnits.getValueOfUnit('gwei')).toString(), + badges: new BigNumber('0x' + values[3]).toString(), + claimed: new BigNumber('0x' + values[4]).toString() == '1' + }; + return digixObj; + } + $scope.$watch('tx', function() { + $scope.showRaw = false; + $scope.sendTxStatus = ""; + }, true); + $scope.$watch('showSend', function() { + $scope.showRaw = false; + $scope.sendTxStatus = ""; + if (!$scope.showSend) { + $scope.tx.data = $scope.digixClaim; + $scope.tx.to = $scope.digixContract; + $scope.tx.gasLimit = globalFuncs.digixClaimTxGasLimit; + } + }); + $scope.generateTokenTx = function() { + try { + if (!ethFuncs.validateEtherAddress($scope.tokenTx.to)) throw globalFuncs.errorMsgs[5]; + else if (!globalFuncs.isNumeric($scope.tokenTx.value) || parseFloat($scope.tokenTx.value) < 0) throw globalFuncs.errorMsgs[7]; + else if ($scope.tokenTx.unit == "dgd" && new BigNumber($scope.tokenTx.value).greaterThan(new BigNumber($scope.tokenBalance))) throw globalFuncs.errorMsgs[7]; + else if ($scope.tokenTx.unit == "dgdb" && new BigNumber($scope.tokenTx.value).greaterThan(new BigNumber($scope.badgeBalance))) throw globalFuncs.errorMsgs[7]; + var value = 0; + if ($scope.tokenTx.unit == "dgd") { + value = new BigNumber($scope.tokenTx.value).times(etherUnits.getValueOfUnit('gwei')).toString(16); + $scope.tx.to = $scope.tokenContract; + } else { + value = new BigNumber($scope.tokenTx.value).toString(16); + $scope.tx.to = $scope.badgeContract; + } + value = ethFuncs.padLeft(value, 64); + var toAdd = ethFuncs.padLeft(ethFuncs.getNakedAddress($scope.tokenTx.to), 64); + $scope.tx.data = $scope.digixTransfer + toAdd + value; + $scope.tx.value = 0; + $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText('')); + $scope.generateTx(); + } catch (e) { + $scope.showRaw = false; + $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + } + $scope.generateTx = function(){ + uiFuncs.generateTx($scope,$sce); + } + $scope.sendTx = function() { + uiFuncs.sendTx($scope,$sce); + } +}; +module.exports = digixCtrl; },{}],10:[function(require,module,exports){ (function (Buffer){ -'use strict'; -var sendOfflineTxCtrl = function($scope, $sce, walletService) { - walletService.wallet = null; - walletService.password = ''; - $scope.showAdvance = false; - $scope.showRaw = false; - $scope.showWalletInfo = false; - $scope.gasPriceDec = 0; - $scope.nonceDec = 0; - $scope.tx = { - gasLimit: globalFuncs.defaultTxGasLimit, - from: "", - data: "", - to: "", - unit: "ether", - value: '', - nonce: null, - gasPrice: null, - donate: false - } - $scope.$watch(function() { - if (walletService.wallet == null) return null; - return walletService.wallet.getAddressString(); - }, function() { - if (walletService.wallet == null) return; - $scope.wallet = walletService.wallet; - }); - $scope.getWalletInfo = function() { - if (ethFuncs.validateEtherAddress($scope.tx.from)) { - ajaxReq.getTransactionData($scope.tx.from, function(data) { - if (data.error) throw data.msg; - data = data.data; - $scope.gasPriceDec = ethFuncs.hexToDecimal(ethFuncs.sanitizeHex(ethFuncs.addTinyMoreToGas(data.gasprice))); - $scope.nonceDec = ethFuncs.hexToDecimal(data.nonce); - $scope.showWalletInfo = true; - }); - } - } - $scope.$watch('tx', function() { - $scope.showRaw = false; - $scope.sendTxStatus = ""; - }, true); - $scope.validateAddress = function(address, status) { - if (ethFuncs.validateEtherAddress(address)) { - $scope[status] = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[0])); - } else { - $scope[status] = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[5])); - } - } - $scope.generateTx = function() { - try { - if (!ethFuncs.validateEtherAddress($scope.tx.to)) throw globalFuncs.errorMsgs[5]; - else if (!globalFuncs.isNumeric($scope.tx.value) || parseFloat($scope.tx.value) < 0) throw globalFuncs.errorMsgs[7]; - else if (!globalFuncs.isNumeric($scope.gasPriceDec) || parseFloat($scope.gasPriceDec) <= 0) throw globalFuncs.errorMsgs[10]; - else if (!globalFuncs.isNumeric($scope.nonceDec) || parseFloat($scope.nonceDec) < 0) throw globalFuncs.errorMsgs[11]; - else if (!globalFuncs.isNumeric($scope.tx.gasLimit) || parseFloat($scope.tx.gasLimit) <= 0) throw globalFuncs.errorMsgs[8]; - else if (!ethFuncs.validateHexString($scope.tx.data)) throw globalFuncs.errorMsgs[9]; - var rawTx = { - nonce: ethFuncs.sanitizeHex(ethFuncs.decimalToHex($scope.nonceDec)), - gasPrice: ethFuncs.sanitizeHex(ethFuncs.decimalToHex($scope.gasPriceDec)), - gasLimit: ethFuncs.sanitizeHex(ethFuncs.decimalToHex($scope.tx.gasLimit)), - to: ethFuncs.sanitizeHex($scope.tx.to), - value: ethFuncs.sanitizeHex(ethFuncs.decimalToHex(etherUnits.toWei($scope.tx.value, $scope.tx.unit))), - data: ethFuncs.sanitizeHex($scope.tx.data) - } - var eTx = new ethUtil.Tx(rawTx); - eTx.sign(new Buffer($scope.wallet.getPrivateKeyString(), 'hex')); - $scope.rawTx = JSON.stringify(rawTx); - $scope.signedTx = '0x' + eTx.serialize().toString('hex'); - $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText('')); - } catch (e) { - $scope.showRaw = false; - $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - } - $scope.confirmSendTx = function(){ - try { - if($scope.signedTx=="" || !ethFuncs.validateHexString($scope.signedTx)) throw globalFuncs.errorMsgs[12]; - var eTx = new ethUtil.Tx($scope.signedTx); - $scope.tx.to = '0x'+eTx.to.toString('hex'); - $scope.tx.value = etherUnits.toEther('0x'+eTx.value.toString('hex'),'wei'); - $scope.tx.unit = 'ether'; - new Modal(document.getElementById('sendTransactionOffline')).open(); - } catch (e){ - $scope.offlineTxPublishStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - } - $scope.sendTx = function() { - new Modal(document.getElementById('sendTransactionOffline')).close(); - ajaxReq.sendRawTx($scope.signedTx, function(data) { - if (data.error) { - $scope.offlineTxPublishStatus = $sce.trustAsHtml(globalFuncs.getDangerText(data.msg)); - } else { - $scope.offlineTxPublishStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[2] + " " + data.data)); - } - }); - } -}; +'use strict'; +var sendOfflineTxCtrl = function($scope, $sce, walletService) { + walletService.wallet = null; + walletService.password = ''; + $scope.showAdvance = false; + $scope.showRaw = false; + $scope.showWalletInfo = false; + $scope.gasPriceDec = 0; + $scope.nonceDec = 0; + $scope.tx = { + gasLimit: globalFuncs.defaultTxGasLimit, + from: "", + data: "", + to: "", + unit: "ether", + value: '', + nonce: null, + gasPrice: null, + donate: false + } + $scope.$watch(function() { + if (walletService.wallet == null) return null; + return walletService.wallet.getAddressString(); + }, function() { + if (walletService.wallet == null) return; + $scope.wallet = walletService.wallet; + }); + $scope.getWalletInfo = function() { + if (ethFuncs.validateEtherAddress($scope.tx.from)) { + ajaxReq.getTransactionData($scope.tx.from, function(data) { + if (data.error) throw data.msg; + data = data.data; + $scope.gasPriceDec = ethFuncs.hexToDecimal(ethFuncs.sanitizeHex(ethFuncs.addTinyMoreToGas(data.gasprice))); + $scope.nonceDec = ethFuncs.hexToDecimal(data.nonce); + $scope.showWalletInfo = true; + }); + } + } + $scope.$watch('tx', function() { + $scope.showRaw = false; + $scope.sendTxStatus = ""; + }, true); + $scope.validateAddress = function(address, status) { + if (ethFuncs.validateEtherAddress(address)) { + $scope[status] = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[0])); + } else { + $scope[status] = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[5])); + } + } + $scope.generateTx = function() { + try { + if (!ethFuncs.validateEtherAddress($scope.tx.to)) throw globalFuncs.errorMsgs[5]; + else if (!globalFuncs.isNumeric($scope.tx.value) || parseFloat($scope.tx.value) < 0) throw globalFuncs.errorMsgs[7]; + else if (!globalFuncs.isNumeric($scope.gasPriceDec) || parseFloat($scope.gasPriceDec) <= 0) throw globalFuncs.errorMsgs[10]; + else if (!globalFuncs.isNumeric($scope.nonceDec) || parseFloat($scope.nonceDec) < 0) throw globalFuncs.errorMsgs[11]; + else if (!globalFuncs.isNumeric($scope.tx.gasLimit) || parseFloat($scope.tx.gasLimit) <= 0) throw globalFuncs.errorMsgs[8]; + else if (!ethFuncs.validateHexString($scope.tx.data)) throw globalFuncs.errorMsgs[9]; + var rawTx = { + nonce: ethFuncs.sanitizeHex(ethFuncs.decimalToHex($scope.nonceDec)), + gasPrice: ethFuncs.sanitizeHex(ethFuncs.decimalToHex($scope.gasPriceDec)), + gasLimit: ethFuncs.sanitizeHex(ethFuncs.decimalToHex($scope.tx.gasLimit)), + to: ethFuncs.sanitizeHex($scope.tx.to), + value: ethFuncs.sanitizeHex(ethFuncs.decimalToHex(etherUnits.toWei($scope.tx.value, $scope.tx.unit))), + data: ethFuncs.sanitizeHex($scope.tx.data) + } + var eTx = new ethUtil.Tx(rawTx); + eTx.sign(new Buffer($scope.wallet.getPrivateKeyString(), 'hex')); + $scope.rawTx = JSON.stringify(rawTx); + $scope.signedTx = '0x' + eTx.serialize().toString('hex'); + $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText('')); + } catch (e) { + $scope.showRaw = false; + $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + } + $scope.confirmSendTx = function(){ + try { + if($scope.signedTx=="" || !ethFuncs.validateHexString($scope.signedTx)) throw globalFuncs.errorMsgs[12]; + var eTx = new ethUtil.Tx($scope.signedTx); + $scope.tx.to = '0x'+eTx.to.toString('hex'); + $scope.tx.value = etherUnits.toEther('0x'+eTx.value.toString('hex'),'wei'); + $scope.tx.unit = 'ether'; + new Modal(document.getElementById('sendTransactionOffline')).open(); + } catch (e){ + $scope.offlineTxPublishStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + } + $scope.sendTx = function() { + new Modal(document.getElementById('sendTransactionOffline')).close(); + ajaxReq.sendRawTx($scope.signedTx, function(data) { + if (data.error) { + $scope.offlineTxPublishStatus = $sce.trustAsHtml(globalFuncs.getDangerText(data.msg)); + } else { + $scope.offlineTxPublishStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[2] + " " + data.data)); + } + }); + } +}; module.exports = sendOfflineTxCtrl; }).call(this,require("buffer").Buffer) -},{"buffer":83}],11:[function(require,module,exports){ -'use strict'; -var sendTxCtrl = function($scope, $sce, walletService) { - new Modal(document.getElementById('sendTransaction')); - walletService.wallet = null; - walletService.password = ''; - $scope.showAdvance = false; - $scope.showRaw = false; - $scope.tx = { - gasLimit: globalFuncs.urlGet('gaslimit') == null ? globalFuncs.defaultTxGasLimit : globalFuncs.urlGet('gaslimit'), - data: globalFuncs.urlGet('data') == null ? "" : globalFuncs.urlGet('data'), - to: globalFuncs.urlGet('to') == null ? "" : globalFuncs.urlGet('to'), - unit: "ether", - value: globalFuncs.urlGet('value') == null ? "" : globalFuncs.urlGet('value'), - nonce: null, - gasPrice: null, - donate: false - } - $scope.$watch(function() { - if (walletService.wallet == null) return null; - return walletService.wallet.getAddressString(); - }, function() { - if (walletService.wallet == null) return; - $scope.wallet = walletService.wallet; - $scope.setBalance(); - }); - $scope.setBalance = function() { - ajaxReq.getBalance($scope.wallet.getAddressString(), function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.etherBalance = etherUnits.toEther(data.data.balance, 'wei'); - ajaxReq.getETHvalue(function(data) { - $scope.usdBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.usd); - $scope.eurBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.eur); - $scope.btcBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.btc); - }); - } - }); - } - $scope.$watch('tx', function() { - $scope.showRaw = false; - $scope.sendTxStatus = ""; - }, true); - $scope.validateAddress = function() { - if (ethFuncs.validateEtherAddress($scope.tx.to)) { - $scope.validateAddressStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[0])); - } else { - $scope.validateAddressStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[5])); - } - } - $scope.toggleShowAdvance = function() { - $scope.showAdvance = !$scope.showAdvance; - } - $scope.onDonateClick = function() { - $scope.tx.to = globalFuncs.donateAddress; - $scope.tx.donate = true; - $scope.validateAddress(); - } - $scope.generateTx = function(){ - uiFuncs.generateTx($scope,$sce); - } - $scope.sendTx = function() { - uiFuncs.sendTx($scope,$sce); - } - $scope.transferAllBalance = function() { - uiFuncs.transferAllBalance($scope,$sce); - } -}; +},{"buffer":84}],11:[function(require,module,exports){ +'use strict'; +var sendTxCtrl = function($scope, $sce, walletService) { + new Modal(document.getElementById('sendTransaction')); + walletService.wallet = null; + walletService.password = ''; + $scope.showAdvance = false; + $scope.showRaw = false; + $scope.tx = { + gasLimit: globalFuncs.urlGet('gaslimit') == null ? globalFuncs.defaultTxGasLimit : globalFuncs.urlGet('gaslimit'), + data: globalFuncs.urlGet('data') == null ? "" : globalFuncs.urlGet('data'), + to: globalFuncs.urlGet('to') == null ? "" : globalFuncs.urlGet('to'), + unit: "ether", + value: globalFuncs.urlGet('value') == null ? "" : globalFuncs.urlGet('value'), + nonce: null, + gasPrice: null, + donate: false + } + $scope.$watch(function() { + if (walletService.wallet == null) return null; + return walletService.wallet.getAddressString(); + }, function() { + if (walletService.wallet == null) return; + $scope.wallet = walletService.wallet; + $scope.setBalance(); + }); + $scope.setBalance = function() { + ajaxReq.getBalance($scope.wallet.getAddressString(), function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.etherBalance = etherUnits.toEther(data.data.balance, 'wei'); + ajaxReq.getETHvalue(function(data) { + $scope.usdBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.usd); + $scope.eurBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.eur); + $scope.btcBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.btc); + }); + } + }); + } + $scope.$watch('tx', function() { + $scope.showRaw = false; + $scope.sendTxStatus = ""; + }, true); + $scope.validateAddress = function() { + if (ethFuncs.validateEtherAddress($scope.tx.to)) { + $scope.validateAddressStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[0])); + } else { + $scope.validateAddressStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[5])); + } + } + $scope.toggleShowAdvance = function() { + $scope.showAdvance = !$scope.showAdvance; + } + $scope.onDonateClick = function() { + $scope.tx.to = globalFuncs.donateAddress; + $scope.tx.donate = true; + $scope.validateAddress(); + } + $scope.generateTx = function(){ + uiFuncs.generateTx($scope,$sce); + } + $scope.sendTx = function() { + uiFuncs.sendTx($scope,$sce); + } + $scope.transferAllBalance = function() { + uiFuncs.transferAllBalance($scope,$sce); + } +}; module.exports = sendTxCtrl; },{}],12:[function(require,module,exports){ -'use strict'; -var tabsCtrl = function($scope, globalService) { - $scope.tabNames = globalService.tabs; - var hval = window.location.hash; - if(hval!=""){ - hval = hval.replace("#",''); - for (var key in $scope.tabNames) { - if($scope.tabNames[key].url == hval){ - $scope.activeTab = globalService.currentTab = $scope.tabNames[key].id; - break; - } - $scope.activeTab = globalService.currentTab; - } - } else { - $scope.activeTab = globalService.currentTab; - } - $scope.tabClick = function(id) { - $scope.activeTab = globalService.currentTab = id; - for (var key in $scope.tabNames) { - if($scope.tabNames[key].id == id) - location.hash = $scope.tabNames[key].url; - } - } -}; -module.exports = tabsCtrl; +'use strict'; +var tabsCtrl = function($scope, globalService) { + $scope.tabNames = globalService.tabs; + var hval = window.location.hash; + if(hval!=""){ + hval = hval.replace("#",''); + for (var key in $scope.tabNames) { + if($scope.tabNames[key].url == hval){ + $scope.activeTab = globalService.currentTab = $scope.tabNames[key].id; + break; + } + $scope.activeTab = globalService.currentTab; + } + } else { + $scope.activeTab = globalService.currentTab; + } + $scope.tabClick = function(id) { + $scope.activeTab = globalService.currentTab = id; + for (var key in $scope.tabNames) { + if($scope.tabNames[key].id == id) + location.hash = $scope.tabNames[key].url; + } + } +}; +module.exports = tabsCtrl; },{}],13:[function(require,module,exports){ -'use strict'; -var theDaoCtrl = function($scope, $sce, walletService) { - $scope.curTab = "send"; - new Modal(document.getElementById('sendTransaction')); - $scope.voteModal = new Modal(document.getElementById('voteProposal')); - $scope.showVoteYes = $scope.showVoteNo = true; - walletService.wallet = null; - walletService.password = ''; - $scope.showAdvance = false; - $scope.showRaw = false; - $scope.slockitContract = "0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413"; //0xd838f9c9792bf8398e1f5fbfbd3b43c5a86445aa - $scope.slockitBalance = "0x70a08231"; - $scope.slockitSupply = "0x18160ddd"; - $scope.slockitTransfer = "0xa9059cbb"; - $scope.slockitProposal = "0x013cf08b"; - $scope.slockitminQuorumDivisor = "0x674ed066"; - $scope.slockitABalance = "0x39d1f908"; - $scope.slockitRToken = "0xcdef91d0"; - $scope.slockitVote = "0xc9d27afe"; - $scope.tx = { - gasLimit: 150000, - data: '', - to: $scope.slockitContract, - unit: "ether", - value: 0, - nonce: null, - gasPrice: null, - donate: false - } - $scope.token = { - balance: 0, - total: 0, - totRaised: 0 - } - $scope.tokenTx = { - to: '', - value: 0, - unit: "dao" - } - $scope.$watch(function() { - if (walletService.wallet == null) return null; - return walletService.wallet.getAddressString(); - }, function() { - if (walletService.wallet == null) return; - $scope.wallet = walletService.wallet; - $scope.setBalance(); - }); - $scope.setBalance = function() { - ajaxReq.getBalance($scope.wallet.getAddressString(), function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.etherBalance = etherUnits.toEther(data.data.balance, 'wei'); - ajaxReq.getETHvalue(function(data) { - $scope.usdBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.usd); - $scope.eurBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.eur); - $scope.btcBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.btc); - }); - } - }); - var userInfo = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitBalance, [ethFuncs.getNakedAddress($scope.wallet.getAddressString())]); - ajaxReq.getEthCall(userInfo, function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.token.balance = new BigNumber(data.data).div(etherUnits.getValueOfUnit('milli') * 10).toString(); - } - }); - var totSupply = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitSupply, []); - ajaxReq.getEthCall(totSupply, function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.token.total = new BigNumber(data.data).toString(); - } - }); - ajaxReq.getBalance($scope.slockitContract, function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.token.totRaised = etherUnits.toEther(data.data.balance, 'wei'); - } - }); - var minq = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitminQuorumDivisor, []); - ajaxReq.getEthCall(minq, function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.minQuorumDivisor = new BigNumber(data.data).toNumber(); - } - }); - var actB = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitABalance, []); - ajaxReq.getEthCall(actB, function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.actualBalance = new BigNumber(data.data).toNumber(); - } - }); - var rToken = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitRToken, [ethFuncs.getNakedAddress($scope.slockitContract)]); - ajaxReq.getEthCall(rToken, function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.rewardToken = new BigNumber(data.data).toNumber(); - } - }); - } - - $scope.setProposal = function() { - try { - $scope.loadProposalStatus = ""; - if (!globalFuncs.isNumeric($scope.proposalId) || parseFloat($scope.proposalId) < 0) throw globalFuncs.errorMsgs[15]; - var callProposal = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitProposal, [new BigNumber($scope.proposalId).toString(16)]); - ajaxReq.getEthCall(callProposal, function(data) { - try { - if (data.error) { - $scope.loadProposalStatus = data.msg; - } else { - var proposal = ethFuncs.contractOutToArray(data.data); - $scope.objProposal = { - id: $scope.proposalId, - recipient: '0x' + proposal[0], - amount: etherUnits.toEther('0x' + proposal[1], 'wei'), - content: proposal[12] == "0" ? "" : proposal.slice(13).join(), - description: proposal[12] == "0" ? "Propsoal ID #" + $scope.proposalId : globalFuncs.hexToAscii(proposal.slice(13).join('')).replace(/
/g, '\n').replace(/\\n/g, '\n'), - votingDeadline: new Date(new BigNumber("0x" + proposal[3]).toNumber() * 1000), - today: new Date(), - open: proposal[4] == '1' ? true : false, - proposalPassed: proposal[5] == '1' ? true : false, - proposalHash: '0x' + proposal[6], - proposalDeposit: etherUnits.toEther('0x' + proposal[7], 'wei'), - split: proposal[8] == '1' ? true : false, - yea: etherUnits.toEther('0x' + proposal[9], 'wei'), - nay: etherUnits.toEther('0x' + proposal[10], 'wei'), - creator: "0x" + proposal[11], - enabled: true, - minQuroum: function() { - var totalInWei = etherUnits.toWei($scope.token.totRaised, "ether"); - return etherUnits.toEther(totalInWei / $scope.minQuorumDivisor + (etherUnits.toWei(this.amount, "ether") * totalInWei) / (3 * ($scope.actualBalance + $scope.rewardToken)), "wei"); - }, - data: proposal - }; - $scope.showProposal = true; - - var yeaBN = new BigNumber($scope.objProposal.yea); - var nayBN = new BigNumber($scope.objProposal.nay); - $scope.objProposal.totalVotes = yeaBN.plus(nayBN) - $scope.objProposal.yeaPer = yeaBN.plus(nayBN).toNumber() == '0' ? 0 : yeaBN.div($scope.objProposal.totalVotes).times(100).toNumber(); - $scope.objProposal.nayPer = yeaBN.plus(nayBN).toNumber() == '0' ? 0 : nayBN.div($scope.objProposal.totalVotes).times(100).toNumber(); - - $scope.objProposal.quorumCurrent = ($scope.objProposal.totalVotes * 100) / $scope.token.totRaised; - $scope.objProposal.quorumPer = ($scope.objProposal.minQuroum() * 100) / $scope.token.totRaised; - - $scope.objProposal.openEnglish = $scope.objProposal.open == true ? "Yes" : "No"; - $scope.objProposal.splitEnglish = $scope.objProposal.split == true ? "Yes" : "No"; - $scope.objProposal.proposalPassedEnglish = $scope.objProposal.proposalPassed == true ? "Yes" : "No"; - - if ($scope.objProposal.description.indexOf('\n') > 0) { - var firstLine = $scope.objProposal.description.substring(0, $scope.objProposal.description.indexOf('\n')); - $scope.objProposal.descriptionHTML = $sce.trustAsHtml(globalFuncs.stripTags(marked($scope.objProposal.description.substring(firstLine.length + 1) || ""))); - $scope.objProposal.description = firstLine; - } - } - } catch (e) { - $scope.loadProposalStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[15] + e)); - $scope.showProposal = false; - } - }); - } catch (e) { - $scope.loadProposalStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - } - $scope.$watch('curTab', function() { - $scope.tx.data = ''; - $scope.showRaw = $scope.showProposal = false; - }); - $scope.$watch('[tx,curTab]', function() { - $scope.showRaw = false; - $scope.sendTxStatus = ""; - }, true); - - // sending - $scope.generateTokenTx = function() { - try { - if (!ethFuncs.validateEtherAddress($scope.tokenTx.to)) throw globalFuncs.errorMsgs[5]; - else if (!globalFuncs.isNumeric($scope.tokenTx.value) || parseFloat($scope.tokenTx.value) < 0) throw globalFuncs.errorMsgs[7]; - $scope.tx.to = $scope.slockitContract; - var value = ethFuncs.padLeft(new BigNumber($scope.tokenTx.value).times(etherUnits.getValueOfUnit('milli') * 10).toString(16), 64); - var toAdd = ethFuncs.padLeft(ethFuncs.getNakedAddress($scope.tokenTx.to), 64); - $scope.tx.data = $scope.slockitTransfer + toAdd + value; - $scope.tx.value = 0; - $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText('')); - $scope.generateTx(); - } catch (e) { - $scope.showRaw = false; - $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - }; - - $scope.generateTx = function() { - uiFuncs.generateTx($scope, $sce); - } - $scope.sendTx = function() { - uiFuncs.sendTx($scope, $sce); - } - - // voting - $scope.generateVoteTx = function(isYes) { - if (isYes) $scope.showVoteNo = false; - else $scope.showVoteYes = false; - try { - $scope.tx.to = $scope.slockitContract; - var id = ethFuncs.padLeft(new BigNumber($scope.proposalId).toString(16), 64); - var vote = isYes ? ethFuncs.padLeft("1", 64) : ethFuncs.padLeft("0", 64); - $scope.tx.data = $scope.slockitVote + id + vote; - $scope.tx.value = 0; - $scope.generateTx2(); - } catch (e) { - $scope.showRaw = false; - $scope.voteTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - } - $scope.generateTx2 = function() { - uiFuncs.generateTx($scope, $sce, function() { - $scope.sendTx2(); - }); - } - $scope.sendTx2 = function() { - ajaxReq.sendRawTx($scope.signedTx, function(data) { - if (data.error) { - $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(data.msg + "
" + globalFuncs.errorMsgs[17])); - } else { - $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[4] + " " + globalFuncs.successMsgs[2] + " " + data.data)); - } - }); - } -}; -module.exports = theDaoCtrl; +'use strict'; +var theDaoCtrl = function($scope, $sce, walletService) { + $scope.curTab = "send"; + new Modal(document.getElementById('sendTransaction')); + $scope.voteModal = new Modal(document.getElementById('voteProposal')); + $scope.showVoteYes = $scope.showVoteNo = true; + walletService.wallet = null; + walletService.password = ''; + $scope.showAdvance = false; + $scope.showRaw = false; + $scope.slockitContract = "0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413"; //0xd838f9c9792bf8398e1f5fbfbd3b43c5a86445aa + $scope.slockitBalance = "0x70a08231"; + $scope.slockitSupply = "0x18160ddd"; + $scope.slockitTransfer = "0xa9059cbb"; + $scope.slockitProposal = "0x013cf08b"; + $scope.slockitminQuorumDivisor = "0x674ed066"; + $scope.slockitABalance = "0x39d1f908"; + $scope.slockitRToken = "0xcdef91d0"; + $scope.slockitVote = "0xc9d27afe"; + $scope.tx = { + gasLimit: 150000, + data: '', + to: $scope.slockitContract, + unit: "ether", + value: 0, + nonce: null, + gasPrice: null, + donate: false + } + $scope.token = { + balance: 0, + total: 0, + totRaised: 0 + } + $scope.tokenTx = { + to: '', + value: 0, + unit: "dao" + } + $scope.$watch(function() { + if (walletService.wallet == null) return null; + return walletService.wallet.getAddressString(); + }, function() { + if (walletService.wallet == null) return; + $scope.wallet = walletService.wallet; + $scope.setBalance(); + }); + $scope.setBalance = function() { + ajaxReq.getBalance($scope.wallet.getAddressString(), function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.etherBalance = etherUnits.toEther(data.data.balance, 'wei'); + ajaxReq.getETHvalue(function(data) { + $scope.usdBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.usd); + $scope.eurBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.eur); + $scope.btcBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.btc); + }); + } + }); + var userInfo = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitBalance, [ethFuncs.getNakedAddress($scope.wallet.getAddressString())]); + ajaxReq.getEthCall(userInfo, function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.token.balance = new BigNumber(data.data).div(etherUnits.getValueOfUnit('milli') * 10).toString(); + } + }); + var totSupply = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitSupply, []); + ajaxReq.getEthCall(totSupply, function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.token.total = new BigNumber(data.data).toString(); + } + }); + ajaxReq.getBalance($scope.slockitContract, function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.token.totRaised = etherUnits.toEther(data.data.balance, 'wei'); + } + }); + var minq = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitminQuorumDivisor, []); + ajaxReq.getEthCall(minq, function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.minQuorumDivisor = new BigNumber(data.data).toNumber(); + } + }); + var actB = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitABalance, []); + ajaxReq.getEthCall(actB, function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.actualBalance = new BigNumber(data.data).toNumber(); + } + }); + var rToken = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitRToken, [ethFuncs.getNakedAddress($scope.slockitContract)]); + ajaxReq.getEthCall(rToken, function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.rewardToken = new BigNumber(data.data).toNumber(); + } + }); + } + + $scope.setProposal = function() { + try { + $scope.loadProposalStatus = ""; + if (!globalFuncs.isNumeric($scope.proposalId) || parseFloat($scope.proposalId) < 0) throw globalFuncs.errorMsgs[15]; + var callProposal = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitProposal, [new BigNumber($scope.proposalId).toString(16)]); + ajaxReq.getEthCall(callProposal, function(data) { + try { + if (data.error) { + $scope.loadProposalStatus = data.msg; + } else { + var proposal = ethFuncs.contractOutToArray(data.data); + $scope.objProposal = { + id: $scope.proposalId, + recipient: '0x' + proposal[0], + amount: etherUnits.toEther('0x' + proposal[1], 'wei'), + content: proposal[12] == "0" ? "" : proposal.slice(13).join(), + description: proposal[12] == "0" ? "Propsoal ID #" + $scope.proposalId : globalFuncs.stripTags(globalFuncs.hexToAscii(proposal.slice(13).join('')).replace(/
/g, '\n').replace(/\\n/g, '\n')), + votingDeadline: new Date(new BigNumber("0x" + proposal[3]).toNumber() * 1000), + today: new Date(), + open: proposal[4] == '1' ? true : false, + proposalPassed: proposal[5] == '1' ? true : false, + proposalHash: '0x' + proposal[6], + proposalDeposit: etherUnits.toEther('0x' + proposal[7], 'wei'), + split: proposal[8] == '1' ? true : false, + yea: etherUnits.toEther('0x' + proposal[9], 'wei'), + nay: etherUnits.toEther('0x' + proposal[10], 'wei'), + creator: "0x" + proposal[11], + enabled: true, + minQuroum: function() { + var totalInWei = etherUnits.toWei($scope.token.totRaised, "ether"); + return etherUnits.toEther(totalInWei / $scope.minQuorumDivisor + (etherUnits.toWei(this.amount, "ether") * totalInWei) / (3 * ($scope.actualBalance + $scope.rewardToken)), "wei"); + }, + data: proposal + }; + $scope.showProposal = true; + + var yeaBN = new BigNumber($scope.objProposal.yea); + var nayBN = new BigNumber($scope.objProposal.nay); + $scope.objProposal.totalVotes = yeaBN.plus(nayBN) + $scope.objProposal.yeaPer = yeaBN.plus(nayBN).toNumber() == '0' ? 0 : yeaBN.div($scope.objProposal.totalVotes).times(100).toNumber(); + $scope.objProposal.nayPer = yeaBN.plus(nayBN).toNumber() == '0' ? 0 : nayBN.div($scope.objProposal.totalVotes).times(100).toNumber(); + + $scope.objProposal.quorumCurrent = ($scope.objProposal.totalVotes * 100) / $scope.token.totRaised; + $scope.objProposal.quorumPer = ($scope.objProposal.minQuroum() * 100) / $scope.token.totRaised; + + $scope.objProposal.openEnglish = $scope.objProposal.open == true ? "Yes" : "No"; + $scope.objProposal.splitEnglish = $scope.objProposal.split == true ? "Yes" : "No"; + $scope.objProposal.proposalPassedEnglish = $scope.objProposal.proposalPassed == true ? "Yes" : "No"; + + if ($scope.objProposal.description.indexOf('\n') > 0) { + var firstLine = $scope.objProposal.description.substring(0, $scope.objProposal.description.indexOf('\n')); + $scope.objProposal.descriptionHTML = $sce.trustAsHtml(marked($scope.objProposal.description.substring(firstLine.length + 1) || "")); + $scope.objProposal.description = firstLine; + } + } + } catch (e) { + $scope.loadProposalStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[15] + e)); + $scope.showProposal = false; + } + }); + } catch (e) { + $scope.loadProposalStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + } + $scope.$watch('curTab', function() { + $scope.tx.data = ''; + $scope.showRaw = $scope.showProposal = false; + }); + $scope.$watch('[tx,curTab]', function() { + $scope.showRaw = false; + $scope.sendTxStatus = ""; + }, true); + + // sending + $scope.generateTokenTx = function() { + try { + if (!ethFuncs.validateEtherAddress($scope.tokenTx.to)) throw globalFuncs.errorMsgs[5]; + else if (!globalFuncs.isNumeric($scope.tokenTx.value) || parseFloat($scope.tokenTx.value) < 0) throw globalFuncs.errorMsgs[7]; + $scope.tx.to = $scope.slockitContract; + var value = ethFuncs.padLeft(new BigNumber($scope.tokenTx.value).times(etherUnits.getValueOfUnit('milli') * 10).toString(16), 64); + var toAdd = ethFuncs.padLeft(ethFuncs.getNakedAddress($scope.tokenTx.to), 64); + $scope.tx.data = $scope.slockitTransfer + toAdd + value; + $scope.tx.value = 0; + $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText('')); + $scope.generateTx(); + } catch (e) { + $scope.showRaw = false; + $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + }; + + $scope.generateTx = function() { + uiFuncs.generateTx($scope, $sce); + } + $scope.sendTx = function() { + uiFuncs.sendTx($scope, $sce); + } + + // voting + $scope.generateVoteTx = function(isYes) { + if (isYes) $scope.showVoteNo = false; + else $scope.showVoteYes = false; + try { + $scope.tx.to = $scope.slockitContract; + var id = ethFuncs.padLeft(new BigNumber($scope.proposalId).toString(16), 64); + var vote = isYes ? ethFuncs.padLeft("1", 64) : ethFuncs.padLeft("0", 64); + $scope.tx.data = $scope.slockitVote + id + vote; + $scope.tx.value = 0; + $scope.generateTx2(); + } catch (e) { + $scope.showRaw = false; + $scope.voteTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + } + $scope.generateTx2 = function() { + uiFuncs.generateTx($scope, $sce, function() { + $scope.sendTx2(); + }); + } + $scope.sendTx2 = function() { + ajaxReq.sendRawTx($scope.signedTx, function(data) { + if (data.error) { + $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(data.msg + "
" + globalFuncs.errorMsgs[17])); + } else { + $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[4] + " " + globalFuncs.successMsgs[2] + " " + data.data)); + } + }); + } +}; +module.exports = theDaoCtrl; },{}],14:[function(require,module,exports){ -'use strict'; -var theDaoProposalCtrl = function($scope, $sce, walletService) { - walletService.wallet = null; - walletService.password = ''; - $scope.voteModal = new Modal(document.getElementById('voteProposal')); - $scope.showVoteYes = $scope.showVoteNo = true; - $scope.AllProposals = []; - $scope.slockitContract = "0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413"; - $scope.slockitBalance = "0x70a08231"; - $scope.slockitSupply = "0x18160ddd"; - $scope.slockitTransfer = "0xa9059cbb"; - $scope.slockitProposal = "0x013cf08b"; - $scope.slockitminQuorumDivisor = "0x674ed066"; - $scope.slockitABalance = "0x39d1f908"; - $scope.slockitRToken = "0xcdef91d0"; - $scope.slockitVote = "0xc9d27afe"; - $scope.initValues = function() { - ajaxReq.getBalance($scope.slockitContract, function(data) { - if (!data.error) $scope.totRaised = etherUnits.toEther(data.data.balance, 'wei'); - var minq = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitminQuorumDivisor, []); - ajaxReq.getEthCall(minq, function(data) { - if (!data.error) $scope.minQuorumDivisor = new BigNumber(data.data).toNumber(); - var actB = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitABalance, []); - ajaxReq.getEthCall(actB, function(data) { - if (!data.error) $scope.actualBalance = new BigNumber(data.data).toNumber(); - var rToken = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitRToken, [ethFuncs.getNakedAddress($scope.slockitContract)]); - ajaxReq.getEthCall(rToken, function(data) { - if (!data.error) $scope.rewardToken = new BigNumber(data.data).toNumber(); - $scope.getAllProposals(); - }); - }); - }); - }); - } - $scope.tx = { - gasLimit: 150000, - data: '', - to: $scope.slockitContract, - unit: "ether", - value: 0, - nonce: null, - gasPrice: null, - donate: false - } - $scope.$watch(function() { - if (walletService.wallet == null) return null; - return walletService.wallet.getAddressString(); - }, function() { - if (walletService.wallet == null) return; - $scope.wallet = walletService.wallet; - }); - $scope.openVote = function(id) { - $scope.voteID = id; - $scope.showVoteYes = $scope.showVoteNo = true; - $scope.voteTxStatus = $scope.sendTxStatus = ""; - $scope.voteModal.open(); - } - $scope.getAllProposals = function() { - ajaxReq.getDAOProposals(function(proposals) { - for (var i = 0; i < proposals.length; i++) { - $scope.AllProposals.push($scope.getProposalObj(proposals[i])); - } - }); - } - - $scope.filters = { - }; - - if (globalFuncs.urlGet('id') == null) { - $scope.comparator = false; - } else { - $scope.filters.id = parseInt(globalFuncs.urlGet('id')); - $scope.comparator = true; - } - - if (globalFuncs.urlGet('open') == null) { - } else { - $scope.filters.open = globalFuncs.urlGet('open'); - $scope.comparator = false; - } - - if (globalFuncs.urlGet('split') == null) { - } else { - $scope.filters.split = globalFuncs.urlGet('split'); - $scope.comparator = false; - } - - if (globalFuncs.urlGet('description') == null) { - } else { - $scope.filters.description = globalFuncs.urlGet('description'); - $scope.comparator = false; - } - - if (globalFuncs.urlGet('id') == null && globalFuncs.urlGet('open') == null && globalFuncs.urlGet('split') == null && globalFuncs.urlGet('description') == null ) { - $scope.filters.split = 'false'; - $scope.filters.open = 'true'; - $scope.comparator = false; - } - - $scope.$watch('filters.id', function() { - if ($scope.filters.id == '') { - $scope.comparator = false; - $scope.filters.id = ''; - } - if ($scope.filters.id == null) { - $scope.comparator = false; - } - console.log("split: " + JSON.stringify($scope.filters)); - console.log("split: comparator: " + $scope.comparator); - }); - - $scope.$watch('filters.open', function() { - if ($scope.filters.open == null) {} else { - $scope.comparator = false; - $scope.filters.id = ''; - } - console.log("open: " + JSON.stringify($scope.filters)); - console.log("open: comparator: " + $scope.comparator); - }); - $scope.$watch('filters.split', function() { - if ($scope.filters.split == null) {} else { - $scope.comparator = false; - $scope.filters.id = ''; - } - console.log("split: " + JSON.stringify($scope.filters)); - console.log("split: comparator: " + $scope.comparator); - }); - - console.log("load: " + JSON.stringify($scope.filters)); - console.log("load: comparator: " + $scope.comparator); - - - - $scope.initValues(); - $scope.showProposal = function(id) { - if (!$scope.AllProposals[id].showprop) { - var callProposal = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitProposal, [new BigNumber(id).toString(16)]); - ajaxReq.getEthCall(callProposal, function(data) { - var iobj = { - proposalID: id, - data: data.data - }; - $scope.AllProposals[id] = $scope.getProposalObj(iobj); - $scope.AllProposals[id].showprop = true; - }); - } else { - $scope.AllProposals[id].showprop = false; - } - } - $scope.generateVoteTx = function(isYes) { - if (isYes) $scope.showVoteNo = false; - else $scope.showVoteYes = false; - try { - $scope.tx.to = $scope.slockitContract; - var id = ethFuncs.padLeft(new BigNumber($scope.voteID).toString(16), 64); - var vote = isYes ? ethFuncs.padLeft("1", 64) : ethFuncs.padLeft("0", 64); - $scope.tx.data = $scope.slockitVote + id + vote; - $scope.tx.value = 0; - $scope.generateTx(); - } catch (e) { - $scope.showRaw = false; - $scope.voteTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - } - $scope.getProposalObj = function(tProposal) { - var proposal = ethFuncs.contractOutToArray(tProposal.data); - var objProposal = { - id: tProposal.proposalID, - recipient: '0x' + proposal[0], - amount: etherUnits.toEther('0x' + proposal[1], 'wei'), - content: proposal[12] == "0" ? "" : proposal.slice(13).join(), - description: proposal[12] == "0" ? "Propsoal ID #" + tProposal.proposalID : globalFuncs.hexToAscii(proposal.slice(13).join('')).replace(/
/g, '\n').replace(/\\n/g, '\n'), - votingDeadline: new Date(new BigNumber("0x" + proposal[3]).toNumber() * 1000), - today: new Date(), - open: proposal[4] == '1' ? true : false, - proposalPassed: proposal[5] == '1' ? true : false, - proposalHash: '0x' + proposal[6], - proposalDeposit: etherUnits.toEther('0x' + proposal[7], 'wei'), - split: proposal[8] == '1' ? true : false, - yea: etherUnits.toEther('0x' + proposal[9], 'wei'), - nay: etherUnits.toEther('0x' + proposal[10], 'wei'), - creator: "0x" + proposal[11], - show: true, - showprop: false, - minQuroum: function() { - var totalInWei = etherUnits.toWei($scope.totRaised, "ether"); - return etherUnits.toEther(totalInWei / $scope.minQuorumDivisor + (etherUnits.toWei(this.amount, "ether") * totalInWei) / (3 * ($scope.actualBalance + $scope.rewardToken)), "wei"); - }, - data: proposal - }; - var yeaBN = new BigNumber(objProposal.yea); - var nayBN = new BigNumber(objProposal.nay); - objProposal.totalVotes = yeaBN.plus(nayBN) - objProposal.yeaPer = yeaBN.plus(nayBN).toNumber() == '0' ? 0 : yeaBN.div(objProposal.totalVotes).times(100).toNumber(); - objProposal.nayPer = yeaBN.plus(nayBN).toNumber() == '0' ? 0 : nayBN.div(objProposal.totalVotes).times(100).toNumber(); - - objProposal.quorumCurrent = (objProposal.totalVotes * 100) / $scope.totRaised; - objProposal.quorumPer = (objProposal.minQuroum() * 100) / $scope.totRaised; - - objProposal.openEnglish = objProposal.open == true ? "Yes" : "No"; - objProposal.splitEnglish = objProposal.split == true ? "Yes" : "No"; - objProposal.proposalPassedEnglish = objProposal.proposalPassed == true ? "Yes" : "No"; - - if (objProposal.description.indexOf('\n') > 0) { - var firstLine = objProposal.description.substring(0, objProposal.description.indexOf('\n')); - objProposal.descriptionHTML = $sce.trustAsHtml(globalFuncs.stripTags(marked(objProposal.description.substring(firstLine.length + 1) || ""))); - objProposal.description = firstLine; - } - - return objProposal; - } - $scope.generateTx = function() { - uiFuncs.generateTx($scope, $sce, function(){ - $scope.sendTx(); - }); - } - $scope.sendTx = function() { - ajaxReq.sendRawTx($scope.signedTx, function(data) { - if (data.error) { - $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(data.msg + "
" + globalFuncs.errorMsgs[17] )); - } else { - $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[4] + " " +globalFuncs.successMsgs[2] + " " + data.data)); - } - }); - } - -}; - - -module.exports = theDaoProposalCtrl; +'use strict'; +var theDaoProposalCtrl = function($scope, $sce, walletService) { + walletService.wallet = null; + walletService.password = ''; + $scope.voteModal = new Modal(document.getElementById('voteProposal')); + $scope.showVoteYes = $scope.showVoteNo = true; + $scope.AllProposals = []; + $scope.slockitContract = "0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413"; + $scope.slockitBalance = "0x70a08231"; + $scope.slockitSupply = "0x18160ddd"; + $scope.slockitTransfer = "0xa9059cbb"; + $scope.slockitProposal = "0x013cf08b"; + $scope.slockitminQuorumDivisor = "0x674ed066"; + $scope.slockitABalance = "0x39d1f908"; + $scope.slockitRToken = "0xcdef91d0"; + $scope.slockitVote = "0xc9d27afe"; + $scope.initValues = function() { + ajaxReq.getBalance($scope.slockitContract, function(data) { + if (!data.error) $scope.totRaised = etherUnits.toEther(data.data.balance, 'wei'); + var minq = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitminQuorumDivisor, []); + ajaxReq.getEthCall(minq, function(data) { + if (!data.error) $scope.minQuorumDivisor = new BigNumber(data.data).toNumber(); + var actB = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitABalance, []); + ajaxReq.getEthCall(actB, function(data) { + if (!data.error) $scope.actualBalance = new BigNumber(data.data).toNumber(); + var rToken = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitRToken, [ethFuncs.getNakedAddress($scope.slockitContract)]); + ajaxReq.getEthCall(rToken, function(data) { + if (!data.error) $scope.rewardToken = new BigNumber(data.data).toNumber(); + $scope.getAllProposals(); + }); + }); + }); + }); + } + $scope.tx = { + gasLimit: 150000, + data: '', + to: $scope.slockitContract, + unit: "ether", + value: 0, + nonce: null, + gasPrice: null, + donate: false + } + $scope.$watch(function() { + if (walletService.wallet == null) return null; + return walletService.wallet.getAddressString(); + }, function() { + if (walletService.wallet == null) return; + $scope.wallet = walletService.wallet; + }); + $scope.openVote = function(id) { + $scope.voteID = id; + $scope.showVoteYes = $scope.showVoteNo = true; + $scope.voteTxStatus = $scope.sendTxStatus = ""; + $scope.voteModal.open(); + } + $scope.getAllProposals = function() { + ajaxReq.getDAOProposals(function(proposals) { + for (var i = 0; i < proposals.length; i++) { + $scope.AllProposals.push($scope.getProposalObj(proposals[i])); + } + }); + } + + $scope.filters = { + id: globalFuncs.urlGet('id') != null ? parseInt(globalFuncs.urlGet('id')) : '', + open: globalFuncs.urlGet('open') != null ? globalFuncs.urlGet('open') : '', + split: globalFuncs.urlGet('split') != null ? globalFuncs.urlGet('split') : '', + description: globalFuncs.urlGet('description') != null ? globalFuncs.urlGet('description') : '' + }; + $scope.comparator = globalFuncs.urlGet('id') != null; + if ($scope.filters.id == '' && $scope.filters.open == '' && $scope.filters.split == '' && $scope.filters.description == '' ) { + $scope.filters.split = 'false'; + $scope.filters.open = 'true'; + } + + $scope.$watch('filters', function(newValue, oldValue) { + if ((newValue.id!=oldValue.id)&&($scope.filters.id == '' || $scope.filters.id == null)) $scope.comparator = false; + if (newValue.open!=oldValue.open && $scope.filters.open == '') $scope.filters.id = ''; + if (newValue.split!=oldValue.split && $scope.filters.split != '') $scope.filters.id = ''; + }, true); + $scope.initValues(); + $scope.showProposal = function(id) { + if (!$scope.AllProposals[id].showprop) { + var callProposal = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitProposal, [new BigNumber(id).toString(16)]); + ajaxReq.getEthCall(callProposal, function(data) { + var iobj = { + proposalID: id, + data: data.data + }; + $scope.AllProposals[id] = $scope.getProposalObj(iobj); + $scope.AllProposals[id].showprop = true; + }); + } else { + $scope.AllProposals[id].showprop = false; + } + } + $scope.generateVoteTx = function(isYes) { + if (isYes) $scope.showVoteNo = false; + else $scope.showVoteYes = false; + try { + $scope.tx.to = $scope.slockitContract; + var id = ethFuncs.padLeft(new BigNumber($scope.voteID).toString(16), 64); + var vote = isYes ? ethFuncs.padLeft("1", 64) : ethFuncs.padLeft("0", 64); + $scope.tx.data = $scope.slockitVote + id + vote; + $scope.tx.value = 0; + $scope.generateTx(); + } catch (e) { + $scope.showRaw = false; + $scope.voteTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + } + $scope.getProposalObj = function(tProposal) { + var proposal = ethFuncs.contractOutToArray(tProposal.data); + var objProposal = { + id: tProposal.proposalID, + recipient: '0x' + proposal[0], + amount: etherUnits.toEther('0x' + proposal[1], 'wei'), + content: proposal[12] == "0" ? "" : proposal.slice(13).join(), + description: proposal[12] == "0" ? "Propsoal ID #" + tProposal.proposalID : globalFuncs.stripTags(globalFuncs.hexToAscii(proposal.slice(13).join('')).replace(/
/g, '\n').replace(/\\n/g, '\n')), + votingDeadline: new Date(new BigNumber("0x" + proposal[3]).toNumber() * 1000), + today: new Date(), + open: proposal[4] == '1' ? true : false, + proposalPassed: proposal[5] == '1' ? true : false, + proposalHash: '0x' + proposal[6], + proposalDeposit: etherUnits.toEther('0x' + proposal[7], 'wei'), + split: proposal[8] == '1' ? true : false, + yea: etherUnits.toEther('0x' + proposal[9], 'wei'), + nay: etherUnits.toEther('0x' + proposal[10], 'wei'), + creator: "0x" + proposal[11], + show: true, + showprop: false, + minQuroum: function() { + var totalInWei = etherUnits.toWei($scope.totRaised, "ether"); + return etherUnits.toEther(totalInWei / $scope.minQuorumDivisor + (etherUnits.toWei(this.amount, "ether") * totalInWei) / (3 * ($scope.actualBalance + $scope.rewardToken)), "wei"); + }, + data: proposal + }; + var yeaBN = new BigNumber(objProposal.yea); + var nayBN = new BigNumber(objProposal.nay); + objProposal.totalVotes = yeaBN.plus(nayBN) + objProposal.yeaPer = yeaBN.plus(nayBN).toNumber() == '0' ? 0 : yeaBN.div(objProposal.totalVotes).times(100).toNumber(); + objProposal.nayPer = yeaBN.plus(nayBN).toNumber() == '0' ? 0 : nayBN.div(objProposal.totalVotes).times(100).toNumber(); + + objProposal.quorumCurrent = (objProposal.totalVotes * 100) / $scope.totRaised; + objProposal.quorumPer = (objProposal.minQuroum() * 100) / $scope.totRaised; + + objProposal.openEnglish = objProposal.open == true ? "Yes" : "No"; + objProposal.splitEnglish = objProposal.split == true ? "Yes" : "No"; + objProposal.proposalPassedEnglish = objProposal.proposalPassed == true ? "Yes" : "No"; + + if (objProposal.description.indexOf('\n') > 0) { + var firstLine = objProposal.description.substring(0, objProposal.description.indexOf('\n')); + objProposal.descriptionHTML = $sce.trustAsHtml(marked(objProposal.description.substring(firstLine.length + 1) || "")); + objProposal.description = firstLine; + } + return objProposal; + } + $scope.generateTx = function() { + uiFuncs.generateTx($scope, $sce, function(){ + $scope.sendTx(); + }); + } + $scope.sendTx = function() { + ajaxReq.sendRawTx($scope.signedTx, function(data) { + if (data.error) { + $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(data.msg + "
" + globalFuncs.errorMsgs[17] )); + } else { + $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[4] + " " +globalFuncs.successMsgs[2] + " " + data.data)); + } + }); + } + +}; + + +module.exports = theDaoProposalCtrl; },{}],15:[function(require,module,exports){ -'use strict'; -var viewCtrl = function($scope, globalService) { - $scope.globalService = globalService; -}; +'use strict'; +var viewCtrl = function($scope, globalService) { + $scope.globalService = globalService; +}; module.exports = viewCtrl; },{}],16:[function(require,module,exports){ -'use strict'; -var viewWalletCtrl = function($scope, walletService) { - walletService.wallet = null; - walletService.password = ''; - $scope.$watch(function() { - if (walletService.wallet == null) return null; - return walletService.wallet.getAddressString(); - }, function() { - if (walletService.wallet == null) return; - $scope.wallet = walletService.wallet; - $scope.showEnc = walletService.password != ''; - $scope.blob = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toJSON()); - if (walletService.password != '') { - $scope.blobEnc = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toV3(walletService.password, { - kdf: globalFuncs.kdf, - n: globalFuncs.scrypt.n - })); - $scope.encFileName = $scope.wallet.getV3Filename(); - } - ajaxReq.getBalance($scope.wallet.getAddressString(), function(data){ - if(data.error){ - $scope.etherBalance = data.msg; - } else { - $scope.etherBalance = etherUnits.toEther(data.data.balance,'wei'); - ajaxReq.getETHvalue(function(data){ - $scope.usdBalance = etherUnits.toFiat($scope.etherBalance,'ether',data.usd); - $scope.eurBalance = etherUnits.toFiat($scope.etherBalance,'ether',data.eur); - $scope.btcBalance = etherUnits.toFiat($scope.etherBalance,'ether',data.btc); - }); - } - }); - }); - $scope.printQRCode = function() { - globalFuncs.printPaperWallets(JSON.stringify([{ - address: $scope.wallet.getAddressString(), - private: $scope.wallet.getPrivateKeyString() - }])); - } -}; +'use strict'; +var viewWalletCtrl = function($scope, walletService) { + walletService.wallet = null; + walletService.password = ''; + $scope.$watch(function() { + if (walletService.wallet == null) return null; + return walletService.wallet.getAddressString(); + }, function() { + if (walletService.wallet == null) return; + $scope.wallet = walletService.wallet; + $scope.showEnc = walletService.password != ''; + $scope.blob = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toJSON()); + if (walletService.password != '') { + $scope.blobEnc = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toV3(walletService.password, { + kdf: globalFuncs.kdf, + n: globalFuncs.scrypt.n + })); + $scope.encFileName = $scope.wallet.getV3Filename(); + } + ajaxReq.getBalance($scope.wallet.getAddressString(), function(data){ + if(data.error){ + $scope.etherBalance = data.msg; + } else { + $scope.etherBalance = etherUnits.toEther(data.data.balance,'wei'); + ajaxReq.getETHvalue(function(data){ + $scope.usdBalance = etherUnits.toFiat($scope.etherBalance,'ether',data.usd); + $scope.eurBalance = etherUnits.toFiat($scope.etherBalance,'ether',data.eur); + $scope.btcBalance = etherUnits.toFiat($scope.etherBalance,'ether',data.btc); + }); + } + }); + }); + $scope.printQRCode = function() { + globalFuncs.printPaperWallets(JSON.stringify([{ + address: $scope.wallet.getAddressString(), + private: $scope.wallet.getPrivateKeyString() + }])); + } +}; module.exports = viewWalletCtrl; },{}],17:[function(require,module,exports){ -'use strict'; -var walletGenCtrl = function($scope) { - $scope.password = ""; - $scope.wallet = null; - $scope.showWallet = false; - $scope.blob = $scope.blobEnc = ""; - $scope.isDone = true; - $scope.showPass = true; - $scope.genNewWallet = function() { - if (!$scope.isStrongPass()) { - alert(globalFuncs.errorMsgs[1]); - } else if($scope.isDone){ - $scope.isDone = false; - $scope.wallet = Wallet.generate(false); - $scope.showWallet = true; - $scope.blob = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toJSON()); - $scope.blobEnc = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toV3($scope.password, { - kdf: globalFuncs.kdf, - n: globalFuncs.scrypt.n - })); - $scope.encFileName = $scope.wallet.getV3Filename(); - if(parent!=null) - parent.postMessage(JSON.stringify({address:$scope.wallet.getAddressString(), checksumAddress: $scope.wallet.getChecksumAddressString()}),"*"); - $scope.isDone = true; - } - } - $scope.printQRCode = function() { - globalFuncs.printPaperWallets(JSON.stringify([{ - address: $scope.wallet.getAddressString(), - private: $scope.wallet.getPrivateKeyString() - }])); - } - $scope.isStrongPass = function(){ - return globalFuncs.isStrongPass($scope.password); - } -}; +'use strict'; +var walletGenCtrl = function($scope) { + $scope.password = ""; + $scope.wallet = null; + $scope.showWallet = false; + $scope.blob = $scope.blobEnc = ""; + $scope.isDone = true; + $scope.showPass = true; + $scope.genNewWallet = function() { + if (!$scope.isStrongPass()) { + alert(globalFuncs.errorMsgs[1]); + } else if($scope.isDone){ + $scope.isDone = false; + $scope.wallet = Wallet.generate(false); + $scope.showWallet = true; + $scope.blob = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toJSON()); + $scope.blobEnc = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toV3($scope.password, { + kdf: globalFuncs.kdf, + n: globalFuncs.scrypt.n + })); + $scope.encFileName = $scope.wallet.getV3Filename(); + if(parent!=null) + parent.postMessage(JSON.stringify({address:$scope.wallet.getAddressString(), checksumAddress: $scope.wallet.getChecksumAddressString()}),"*"); + $scope.isDone = true; + } + } + $scope.printQRCode = function() { + globalFuncs.printPaperWallets(JSON.stringify([{ + address: $scope.wallet.getAddressString(), + private: $scope.wallet.getPrivateKeyString() + }])); + } + $scope.isStrongPass = function(){ + return globalFuncs.isStrongPass($scope.password); + } +}; module.exports = walletGenCtrl; },{}],18:[function(require,module,exports){ -'use strict'; -var cxFuncs = function() {} -cxFuncs.storage = chrome.storage.sync; -cxFuncs.getAllNickNames = function(callback) { - var nickNames = []; - this.storage.get(null, function(items) { - for (var key in items) { - if (items.hasOwnProperty(key)) { - var tobj = JSON.parse(items[key]); - if (tobj.type == 'wallet' || tobj.type == 'watchOnly') { - nickNames.push(tobj.nick); - nickNames.push(key); - } - } - } - callback(nickNames); - }); -} -cxFuncs.addWalletToStorage = function(address, encStr, nickname, callback) { - nickname = nickname.replace(/(<([^>]+)>)/ig, ""); - var value = { - nick: nickname, - priv: encStr, - type: 'wallet' - }; - var keyname = ethUtil.toChecksumAddress(address); - var obj = {}; - obj[keyname] = JSON.stringify(value); - this.storage.set(obj, callback); -} -cxFuncs.addWatchOnlyAddress = function(address, nickname, callback) { - nickname = nickname.replace(/(<([^>]+)>)/ig, ""); - var value = { - nick: nickname, - type: 'watchOnly' - }; - var keyname = ethUtil.toChecksumAddress(address);; - var obj = {}; - obj[keyname] = JSON.stringify(value); - this.storage.set(obj, callback); -} -cxFuncs.getStorageArr = function(filter, callback) { - var wallets = []; - this.storage.get(null, function(items) { - for (var key in items) { - if (items.hasOwnProperty(key)) { - var tobj = JSON.parse(items[key]); - if (tobj.type == filter) { - tobj['addr'] = key; - wallets.push(tobj); - } - } - } - wallets.sort(function(a, b) { - if (a.nick < b.nick) return -1; - if (a.nick > b.nick) return 1; - return 0; - }); - callback(wallets); - }); -} -cxFuncs.getWalletsArr = function(callback) { - this.getStorageArr('wallet', callback); -} -cxFuncs.getWatchOnlyArr = function(callback) { - this.getStorageArr('watchOnly', callback); -} -cxFuncs.deleteAccount = function(address,callback){ - this.storage.remove(address,function(){ - callback(address); - }); -} -cxFuncs.editNickName = function(address,newNick, callback){ - newNick = newNick.replace(/(<([^>]+)>)/ig,""); - this.storage.get(address, function(account) { - var accountInfo = account[address]; - accountInfo = JSON.parse(accountInfo); - accountInfo['nick'] = newNick; - account[address] = JSON.stringify(accountInfo); - cxFuncs.storage.set(account,function(){ - callback(newNick); - }); - }); -} +'use strict'; +var cxFuncs = function() {} +cxFuncs.storage = chrome.storage.sync; +cxFuncs.getAllNickNames = function(callback) { + var nickNames = []; + this.storage.get(null, function(items) { + for (var key in items) { + if (items.hasOwnProperty(key)) { + var tobj = JSON.parse(items[key]); + if (tobj.type == 'wallet' || tobj.type == 'watchOnly') { + nickNames.push(tobj.nick); + nickNames.push(key); + } + } + } + callback(nickNames); + }); +} +cxFuncs.addWalletToStorage = function(address, encStr, nickname, callback) { + nickname = nickname.replace(/(<([^>]+)>)/ig, ""); + var value = { + nick: nickname, + priv: encStr, + type: 'wallet' + }; + var keyname = ethUtil.toChecksumAddress(address); + var obj = {}; + obj[keyname] = JSON.stringify(value); + this.storage.set(obj, callback); +} +cxFuncs.addWatchOnlyAddress = function(address, nickname, callback) { + nickname = nickname.replace(/(<([^>]+)>)/ig, ""); + var value = { + nick: nickname, + type: 'watchOnly' + }; + var keyname = ethUtil.toChecksumAddress(address);; + var obj = {}; + obj[keyname] = JSON.stringify(value); + this.storage.set(obj, callback); +} +cxFuncs.getStorageArr = function(filter, callback) { + var wallets = []; + this.storage.get(null, function(items) { + for (var key in items) { + if (items.hasOwnProperty(key)) { + var tobj = JSON.parse(items[key]); + if (tobj.type == filter) { + tobj['addr'] = key; + wallets.push(tobj); + } + } + } + wallets.sort(function(a, b) { + if (a.nick < b.nick) return -1; + if (a.nick > b.nick) return 1; + return 0; + }); + callback(wallets); + }); +} +cxFuncs.getWalletsArr = function(callback) { + this.getStorageArr('wallet', callback); +} +cxFuncs.getWatchOnlyArr = function(callback) { + this.getStorageArr('watchOnly', callback); +} +cxFuncs.deleteAccount = function(address,callback){ + this.storage.remove(address,function(){ + callback(address); + }); +} +cxFuncs.editNickName = function(address,newNick, callback){ + newNick = newNick.replace(/(<([^>]+)>)/ig,""); + this.storage.get(address, function(account) { + var accountInfo = account[address]; + accountInfo = JSON.parse(accountInfo); + accountInfo['nick'] = newNick; + account[address] = JSON.stringify(accountInfo); + cxFuncs.storage.set(account,function(){ + callback(newNick); + }); + }); +} module.exports = cxFuncs; },{}],19:[function(require,module,exports){ -'use strict'; -var QRCodeDrtv = function() { - return function(scope, element, attrs) { - var watchVar = attrs.watchVar; - scope.$watch(watchVar, function() { - var value = attrs.qrCode; - element.empty(); - var delay = 0; - if (element[0].clientWidth == 0) delay = 200; - setTimeout(function() { - new QRCode(element[0], { - text: value, - width: element[0].clientWidth, - height: element[0].clientWidth, - colorDark: "#000000", - colorLight: "#ffffff", - correctLevel: QRCode.CorrectLevel.H - }); - }, delay); - }); - }; -}; +'use strict'; +var QRCodeDrtv = function() { + return function(scope, element, attrs) { + var watchVar = attrs.watchVar; + scope.$watch(watchVar, function() { + var value = attrs.qrCode; + element.empty(); + var delay = 0; + if (element[0].clientWidth == 0) delay = 200; + setTimeout(function() { + new QRCode(element[0], { + text: value, + width: element[0].clientWidth, + height: element[0].clientWidth, + colorDark: "#000000", + colorLight: "#ffffff", + correctLevel: QRCode.CorrectLevel.H + }); + }, delay); + }); + }; +}; module.exports = QRCodeDrtv; },{}],20:[function(require,module,exports){ -'use strict'; -var blockiesDrtv = function() { - return function(scope, element, attrs){ - var watchVar = attrs.watchVar; - scope.$watch(watchVar, function() { - var address = attrs.blockieAddress; - var content = ethFuncs.validateEtherAddress(address) ? globalFuncs.getBlockie(address):''; - element.css({ - 'background-image': 'url(' + content +')' - }); - }); - }; -}; +'use strict'; +var blockiesDrtv = function() { + return function(scope, element, attrs){ + var watchVar = attrs.watchVar; + scope.$watch(watchVar, function() { + var address = attrs.blockieAddress; + var content = ethFuncs.validateEtherAddress(address) ? globalFuncs.getBlockie(address):''; + element.css({ + 'background-image': 'url(' + content +')' + }); + }); + }; +}; module.exports = blockiesDrtv; },{}],21:[function(require,module,exports){ -'use strict'; -var cxWalletDecryptDrtv = function() { - return { - restrict : "E", - template : '
\n \ -
\n \ -

Select a Wallet:

\n \ -
\n \ - \n \ -
\n \ -
\n \ -
\n \ -

Enter the Password:

\n \ - \n \ -
\n \ -
\n \ -

Access Your Wallet:

\n \ - \n \ -
\n \ -
\n \ -
' - }; -}; -module.exports = cxWalletDecryptDrtv; +'use strict'; +var cxWalletDecryptDrtv = function() { + return { + restrict : "E", + template : '
\n \ +
\n \ +

Select a Wallet:

\n \ +
\n \ + \n \ +
\n \ +
\n \ +
\n \ +

Enter the Password:

\n \ + \n \ +
\n \ +
\n \ +

Access Your Wallet:

\n \ + \n \ +
\n \ +
\n \ +
' + }; +}; +module.exports = cxWalletDecryptDrtv; },{}],22:[function(require,module,exports){ -'use strict'; -var fileReaderDrtv = function($parse) { - return { - restrict: 'A', - scope: false, - link: function(scope, element, attrs) { - var fn = $parse(attrs.onReadFile); - element.on('change', function(onChangeEvent) { - var reader = new FileReader(); - reader.onload = function(onLoadEvent) { - scope.$apply(function() { - fn(scope, { - $fileContent: onLoadEvent.target.result - }); - }); - }; - reader.readAsText((onChangeEvent.srcElement || onChangeEvent.target).files[0]); - }); - } - }; -}; +'use strict'; +var fileReaderDrtv = function($parse) { + return { + restrict: 'A', + scope: false, + link: function(scope, element, attrs) { + var fn = $parse(attrs.onReadFile); + element.on('change', function(onChangeEvent) { + var reader = new FileReader(); + reader.onload = function(onLoadEvent) { + scope.$apply(function() { + fn(scope, { + $fileContent: onLoadEvent.target.result + }); + }); + }; + reader.readAsText((onChangeEvent.srcElement || onChangeEvent.target).files[0]); + }); + } + }; +}; module.exports = fileReaderDrtv; },{}],23:[function(require,module,exports){ -'use strict'; -var walletDecryptDrtv = function() { - return { - restrict : "E", - template : '
\n \ -
\n \ -

Select the format of your private key:

\n \ -
\n \ - \n \ -
\n \ -
\n \ - \n \ -
\n \ -
\n \ -
\n \ - \n \ -
\n \ -

Select your wallet file:

\n \ -
\n \ - \n \ - SELECT WALLET FILE... \n \ -
\n \ -
\n \ -
\n \ -

Your file is encrypted. Please enter the password:

\n \ - \n \ -
\n \ -
\n \ - \n \ - \n \ -
\n \ -

Paste / type your private key:

\n \ -
\n \ - \n \ -
\n \ -
\n \ -

Your file is encrypted. Please enter the password:

\n \ - \n \ -
\n \ -
\n \ - \n \ -
\n \ -
\n \ -

Access Your Wallet:

\n \ -

Access Your Wallet:

\n \ - \n \ -
\n \ -
\n \ -
' - }; -}; -module.exports = walletDecryptDrtv; +'use strict'; +var walletDecryptDrtv = function() { + return { + restrict : "E", + template : '
\n \ +
\n \ +

Select the format of your private key:

\n \ +
\n \ + \n \ +
\n \ +
\n \ + \n \ +
\n \ +
\n \ +
\n \ + \n \ +
\n \ +

Select your wallet file:

\n \ +
\n \ + \n \ + SELECT WALLET FILE... \n \ +
\n \ +
\n \ +
\n \ +

Your file is encrypted. Please enter the password:

\n \ + \n \ +
\n \ +
\n \ + \n \ + \n \ +
\n \ +

Paste / type your private key:

\n \ +
\n \ + \n \ +
\n \ +
\n \ +

Your file is encrypted. Please enter the password:

\n \ + \n \ +
\n \ +
\n \ + \n \ +
\n \ +
\n \ +

Access Your Wallet:

\n \ +

Access Your Wallet:

\n \ + \n \ +
\n \ +
\n \ +
' + }; +}; +module.exports = walletDecryptDrtv; },{}],24:[function(require,module,exports){ -'use strict'; -var ethFuncs = function() {} -ethFuncs.validateEtherAddress = function(address) { - if (address.substring(0, 2) != "0x") return false; - else if (!/^(0x)?[0-9a-f]{40}$/i.test(address)) return false; - else if (/^(0x)?[0-9a-f]{40}$/.test(address) || /^(0x)?[0-9A-F]{40}$/.test(address)) return true; - else - return this.isChecksumAddress(address); -} -ethFuncs.isChecksumAddress = function(address) { - return address == ethUtil.toChecksumAddress(address); -} -ethFuncs.validateHexString = function(str) { - if (str == "") return true; - str = str.substring(0, 2) == '0x' ? str.substring(2) : str; - var re = /[0-9A-Fa-f]+$/g; - return re.test(str); -} -ethFuncs.sanitizeHex = function(hex) { - hex = hex.substring(0, 2) == '0x' ? hex.substring(2) : hex; - if (hex == "") return ""; - return '0x' + this.padLeftEven(hex); -} -ethFuncs.padLeftEven = function(hex) { - hex = hex.length % 2 != 0 ? '0' + hex : hex; - return hex; -} -ethFuncs.addTinyMoreToGas = function(hex) { - hex = this.sanitizeHex(hex); - return new BigNumber(hex).plus(etherUnits.getValueOfUnit('gwei')).toDigits(2).toString(16); -} -ethFuncs.decimalToHex = function(dec) { - return new BigNumber(dec).toString(16); -} -ethFuncs.hexToDecimal = function(hex) { - return new BigNumber(this.sanitizeHex(hex)).toString(); -} -ethFuncs.contractOutToArray = function(hex) { - hex = hex.replace('0x', '').match(/.{64}/g); - for(var i=0;i= width ? n : new Array(width - n.length + 1).join(z) + n; -} -ethFuncs.getDataObj = function(to, func, arrVals) { - var val=""; - for(var i=0;i= width ? n : new Array(width - n.length + 1).join(z) + n; +} +ethFuncs.getDataObj = function(to, func, arrVals) { + var val=""; + for(var i=0;i"); -} -globalFuncs.getBlob = function(mime, str) { - var str = (typeof str === 'object') ? JSON.stringify(str) : str; - if (str == null) return ''; - var blob = new Blob([str], { - type: mime - }); - return window.URL.createObjectURL(blob); -} -globalFuncs.getSuccessText = function(str) { - return '

' + str + '

' -} -globalFuncs.getDangerText = function(str) { - return '

' + str + '

' -} -globalFuncs.errorMsgs = [ - "Please enter valid amount. ", - "Your password must be at least 9 characters. Please ensure it is a strong password. ", - "Sorry! We don't have a clue what type of wallet file this is. ", - "This is not a valid wallet file. ", - "This unit doesn\'t exists, please use the one of the following units ", - "Invalid address. ", - "Invalid password. ", - "Invalid amount. ", - "Invalid gas limit. ", - "Invalid data value. ", - "Invalid gas amount. ", - "Invalid nonce. ", - "Invalid signed transaction. ", - "A wallet with this nickname already exists. ", - "Wallet not found. ", - "Whoops. It doesnt look like a proposal with this ID exists yet or there is an error reading this proposal. ", - "A wallet with this address already exists in storage. Please check your wallets page. ", - "You need to have at some ETH in your account to cover the cost of gas. .05ETH should be more than sufficient for a few sends and votes. "]; -globalFuncs.successMsgs = ["Valid address", "Wallet successfully decrypted", "Transaction submitted. TX ID: ", "New wallet added: ", "You have successfully voted. Thank you for being an active participant in The DAO."]; -globalFuncs.scrypt = { - n: 1024 -}; -globalFuncs.postDelay = 300; -globalFuncs.kdf = "scrypt"; -globalFuncs.defaultTxGasLimit = 21000; -globalFuncs.digixClaimTxGasLimit = 150000; -globalFuncs.donateAddress = "0x7cB57B5A97eAbe94205C07890BE4c1aD31E486A8"; -globalFuncs.isNumeric = function(n) { - return !isNaN(parseFloat(n)) && isFinite(n); -} -globalFuncs.urlGet = function(name) { - if (name = (new RegExp('[?&]' + encodeURIComponent(name) + '=([^&]*)')).exec(location.search)) return this.stripTags(decodeURIComponent(name[1])); -} -globalFuncs.stripTags = function(str) { - var SCRIPT_REGEX = /)<[^<]*)*<\/script>/gi; - while (SCRIPT_REGEX.test(str)) { - str = str.replace(SCRIPT_REGEX, ""); - } - return str; -} -globalFuncs.checkAndRedirectHTTPS = function() { - var host = "myetherwallet.com"; - var githost = "kvhnuke.github.io"; - var githostw = "www.kvhnuke.github.io"; - var hostw = "www.myetherwallet.com"; - if ((host == window.location.host || githost == window.location.host || hostw == window.location.host || githostw == window.location.host) && (window.location.protocol != "https:")) window.location.protocol = "https"; -} -globalFuncs.isStrongPass = function(password) { - if (password.length > 8) { - return true; - } else { - return false; - } - //var re = /(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}/; - //return re.test(password); -} -globalFuncs.hexToAscii = function(hex) { - return hex.match(/.{1,2}/g).map(function(v) { - return String.fromCharCode(parseInt(v, 16)); - }).join(''); -} -module.exports = globalFuncs; +'use strict'; +var globalFuncs = function() {} +globalFuncs.getBlockie = function(address) { + return blockies.create({ + seed: address.toLowerCase(), + size: 8, + scale: 16 + }).toDataURL(); +} +globalFuncs.printPaperWallets = function(strJson) { + var win = window.open("about:blank", "_blank"); + var data = ""); +} +globalFuncs.getBlob = function(mime, str) { + var str = (typeof str === 'object') ? JSON.stringify(str) : str; + if (str == null) return ''; + var blob = new Blob([str], { + type: mime + }); + return window.URL.createObjectURL(blob); +} +globalFuncs.getSuccessText = function(str) { + return '

' + str + '

' +} +globalFuncs.getDangerText = function(str) { + return '

' + str + '

' +} +globalFuncs.errorMsgs = [ + "Please enter valid amount. ", + "Your password must be at least 9 characters. Please ensure it is a strong password. ", + "Sorry! We don't have a clue what type of wallet file this is. ", + "This is not a valid wallet file. ", + "This unit doesn\'t exists, please use the one of the following units ", + "Invalid address. ", + "Invalid password. ", + "Invalid amount. ", + "Invalid gas limit. ", + "Invalid data value. ", + "Invalid gas amount. ", + "Invalid nonce. ", + "Invalid signed transaction. ", + "A wallet with this nickname already exists. ", + "Wallet not found. ", + "Whoops. It doesnt look like a proposal with this ID exists yet or there is an error reading this proposal. ", + "A wallet with this address already exists in storage. Please check your wallets page. ", + "You need to have at some ETH in your account to cover the cost of gas. .05ETH should be more than sufficient for a few sends and votes. "]; +globalFuncs.successMsgs = ["Valid address", "Wallet successfully decrypted", "Transaction submitted. TX ID: ", "New wallet added: ", "You have successfully voted. Thank you for being an active participant in The DAO."]; +globalFuncs.scrypt = { + n: 1024 +}; +globalFuncs.postDelay = 300; +globalFuncs.kdf = "scrypt"; +globalFuncs.defaultTxGasLimit = 21000; +globalFuncs.digixClaimTxGasLimit = 150000; +globalFuncs.donateAddress = "0x7cB57B5A97eAbe94205C07890BE4c1aD31E486A8"; +globalFuncs.isNumeric = function(n) { + return !isNaN(parseFloat(n)) && isFinite(n); +} +globalFuncs.urlGet = function(name) { + if (name = (new RegExp('[?&]' + encodeURIComponent(name) + '=([^&]*)')).exec(location.search)) return this.stripTags(decodeURIComponent(name[1])); +} +globalFuncs.stripTags = function(str) { + var SCRIPT_REGEX = /)<[^<]*)*<\/script>/gi; + while (SCRIPT_REGEX.test(str)) { + str = str.replace(SCRIPT_REGEX, ""); + } + return str; +} +globalFuncs.checkAndRedirectHTTPS = function() { + var host = "myetherwallet.com"; + var githost = "kvhnuke.github.io"; + var githostw = "www.kvhnuke.github.io"; + var hostw = "www.myetherwallet.com"; + if ((host == window.location.host || githost == window.location.host || hostw == window.location.host || githostw == window.location.host) && (window.location.protocol != "https:")) window.location.protocol = "https"; +} +globalFuncs.isStrongPass = function(password) { + return password.length > 8; +} +globalFuncs.hexToAscii = function(hex) { + return hex.match(/.{1,2}/g).map(function(v) { + return String.fromCharCode(parseInt(v, 16)); + }).join(''); +} +module.exports = globalFuncs; },{}],27:[function(require,module,exports){ -'use strict'; -var IS_CX = false; -if(typeof chrome != 'undefined') - IS_CX = chrome.windows === undefined ? false : true; -require("babel-polyfill"); -var angular = require('angular'); -var BigNumber = require('bignumber.js'); -window.BigNumber = BigNumber; -var marked = require('marked'); -window.marked = marked; -var ethUtil = require('ethereumjs-util'); -ethUtil.crypto = require('crypto'); -ethUtil.Tx = require('ethereumjs-tx'); -ethUtil.scrypt = require('scryptsy'); -ethUtil.uuid = require('uuid'); -window.ethUtil = ethUtil; -var Wallet = require('./myetherwallet'); -window.Wallet = Wallet; -var globalFuncs = require('./globalFuncs'); -window.globalFuncs = globalFuncs; -var uiFuncs = require('./uiFuncs'); -window.uiFuncs = uiFuncs; -var etherUnits = require('./etherUnits'); -window.etherUnits = etherUnits; -var ajaxReq = require('./ajaxReq'); -window.ajaxReq = ajaxReq; -var ethFuncs = require('./ethFuncs'); -window.ethFuncs = ethFuncs; -if(IS_CX){ - var cxFuncs = require('./cxFuncs'); - window.cxFuncs = cxFuncs; -} -var tabsCtrl = require('./controllers/tabsCtrl'); -var viewCtrl = require('./controllers/viewCtrl'); -var walletGenCtrl = require('./controllers/walletGenCtrl'); -var bulkGenCtrl = require('./controllers/bulkGenCtrl'); -var decryptWalletCtrl = require('./controllers/decryptWalletCtrl'); -var viewWalletCtrl = require('./controllers/viewWalletCtrl'); -var sendTxCtrl = require('./controllers/sendTxCtrl'); -var digixCtrl = require('./controllers/digixCtrl'); -var theDaoCtrl = require('./controllers/theDaoCtrl'); -var theDaoProposalCtrl = require('./controllers/theDaoProposalCtrl'); -var sendOfflineTxCtrl = require('./controllers/sendOfflineTxCtrl'); -var globalService = require('./services/globalService'); -var walletService = require('./services/walletService'); -var blockiesDrtv = require('./directives/blockiesDrtv'); -var QRCodeDrtv = require('./directives/QRCodeDrtv'); -var walletDecryptDrtv = require('./directives/walletDecryptDrtv'); -var cxWalletDecryptDrtv = require('./directives/cxWalletDecryptDrtv'); -var fileReaderDrtv = require('./directives/fileReaderDrtv'); -if(IS_CX){ - var addWalletCtrl = require('./controllers/CX/addWalletCtrl'); - var cxDecryptWalletCtrl = require('./controllers/CX/cxDecryptWalletCtrl'); - var myWalletsCtrl = require('./controllers/CX/myWalletsCtrl'); - var mainPopCtrl = require('./controllers/CX/mainPopCtrl'); - var quickSendCtrl = require('./controllers/CX/quickSendCtrl'); -} -var app = angular.module('mewApp', []); -app.config(['$compileProvider', function($compileProvider) { - $compileProvider.aHrefSanitizationWhitelist(/^\s*(|blob|):/); -}]); -app.factory('globalService', ['$http','$httpParamSerializerJQLike',globalService]); -app.factory('walletService', walletService); -app.directive('blockieAddress', blockiesDrtv); -app.directive('qrCode', QRCodeDrtv); -app.directive('onReadFile', fileReaderDrtv); -app.directive('walletDecryptDrtv', walletDecryptDrtv); -app.directive('cxWalletDecryptDrtv', cxWalletDecryptDrtv); -app.controller('tabsCtrl', ['$scope', 'globalService', tabsCtrl]); -app.controller('viewCtrl', ['$scope', 'globalService', viewCtrl]); -app.controller('walletGenCtrl', ['$scope', walletGenCtrl]); -app.controller('bulkGenCtrl', ['$scope', bulkGenCtrl]); -app.controller('decryptWalletCtrl', ['$scope','$sce','walletService', decryptWalletCtrl]); -app.controller('viewWalletCtrl', ['$scope','walletService', viewWalletCtrl]); -app.controller('sendTxCtrl', ['$scope','$sce','walletService', sendTxCtrl]); -app.controller('digixCtrl', ['$scope','$sce','walletService', digixCtrl]); -app.controller('theDaoCtrl', ['$scope','$sce','walletService', theDaoCtrl]); -app.controller('theDaoProposalCtrl', ['$scope','$sce','walletService', theDaoProposalCtrl]); -app.controller('sendOfflineTxCtrl', ['$scope','$sce','walletService', sendOfflineTxCtrl]); -if(IS_CX){ - app.controller('addWalletCtrl', ['$scope','$sce', addWalletCtrl]); - app.controller('myWalletsCtrl', ['$scope','$sce', myWalletsCtrl]); - app.controller('mainPopCtrl', ['$scope','$sce', mainPopCtrl]); - app.controller('quickSendCtrl', ['$scope','$sce', quickSendCtrl]); - app.controller('cxDecryptWalletCtrl', ['$scope','$sce','walletService', cxDecryptWalletCtrl]); -} - -},{"./ajaxReq":1,"./controllers/CX/addWalletCtrl":2,"./controllers/CX/cxDecryptWalletCtrl":3,"./controllers/CX/mainPopCtrl":4,"./controllers/CX/myWalletsCtrl":5,"./controllers/CX/quickSendCtrl":6,"./controllers/bulkGenCtrl":7,"./controllers/decryptWalletCtrl":8,"./controllers/digixCtrl":9,"./controllers/sendOfflineTxCtrl":10,"./controllers/sendTxCtrl":11,"./controllers/tabsCtrl":12,"./controllers/theDaoCtrl":13,"./controllers/theDaoProposalCtrl":14,"./controllers/viewCtrl":15,"./controllers/viewWalletCtrl":16,"./controllers/walletGenCtrl":17,"./cxFuncs":18,"./directives/QRCodeDrtv":19,"./directives/blockiesDrtv":20,"./directives/cxWalletDecryptDrtv":21,"./directives/fileReaderDrtv":22,"./directives/walletDecryptDrtv":23,"./ethFuncs":24,"./etherUnits":25,"./globalFuncs":26,"./myetherwallet":28,"./services/globalService":29,"./services/walletService":30,"./uiFuncs":31,"angular":33,"babel-polyfill":49,"bignumber.js":51,"crypto":386,"ethereumjs-tx":416,"ethereumjs-util":417,"marked":433,"scryptsy":463,"uuid":483}],28:[function(require,module,exports){ +'use strict'; +var IS_CX = false; +if(typeof chrome != 'undefined') + IS_CX = chrome.windows === undefined ? false : true; +require("babel-polyfill"); +var angular = require('angular'); +var BigNumber = require('bignumber.js'); +window.BigNumber = BigNumber; +var marked = require('marked'); +window.marked = marked; +var ethUtil = require('ethereumjs-util'); +ethUtil.crypto = require('crypto'); +ethUtil.Tx = require('ethereumjs-tx'); +ethUtil.scrypt = require('scryptsy'); +ethUtil.uuid = require('uuid'); +window.ethUtil = ethUtil; +var Wallet = require('./myetherwallet'); +window.Wallet = Wallet; +var globalFuncs = require('./globalFuncs'); +window.globalFuncs = globalFuncs; +var uiFuncs = require('./uiFuncs'); +window.uiFuncs = uiFuncs; +var etherUnits = require('./etherUnits'); +window.etherUnits = etherUnits; +var ajaxReq = require('./ajaxReq'); +window.ajaxReq = ajaxReq; +var ethFuncs = require('./ethFuncs'); +window.ethFuncs = ethFuncs; +if(IS_CX){ + var cxFuncs = require('./cxFuncs'); + window.cxFuncs = cxFuncs; +} +var tabsCtrl = require('./controllers/tabsCtrl'); +var viewCtrl = require('./controllers/viewCtrl'); +var walletGenCtrl = require('./controllers/walletGenCtrl'); +var bulkGenCtrl = require('./controllers/bulkGenCtrl'); +var decryptWalletCtrl = require('./controllers/decryptWalletCtrl'); +var viewWalletCtrl = require('./controllers/viewWalletCtrl'); +var sendTxCtrl = require('./controllers/sendTxCtrl'); +var digixCtrl = require('./controllers/digixCtrl'); +var theDaoCtrl = require('./controllers/theDaoCtrl'); +var theDaoProposalCtrl = require('./controllers/theDaoProposalCtrl'); +var sendOfflineTxCtrl = require('./controllers/sendOfflineTxCtrl'); +var globalService = require('./services/globalService'); +var walletService = require('./services/walletService'); +var blockiesDrtv = require('./directives/blockiesDrtv'); +var QRCodeDrtv = require('./directives/QRCodeDrtv'); +var walletDecryptDrtv = require('./directives/walletDecryptDrtv'); +var cxWalletDecryptDrtv = require('./directives/cxWalletDecryptDrtv'); +var fileReaderDrtv = require('./directives/fileReaderDrtv'); +if(IS_CX){ + var addWalletCtrl = require('./controllers/CX/addWalletCtrl'); + var cxDecryptWalletCtrl = require('./controllers/CX/cxDecryptWalletCtrl'); + var myWalletsCtrl = require('./controllers/CX/myWalletsCtrl'); + var mainPopCtrl = require('./controllers/CX/mainPopCtrl'); + var quickSendCtrl = require('./controllers/CX/quickSendCtrl'); +} +var app = angular.module('mewApp', []); +app.config(['$compileProvider', function($compileProvider) { + $compileProvider.aHrefSanitizationWhitelist(/^\s*(|blob|):/); +}]); +app.factory('globalService', ['$http','$httpParamSerializerJQLike',globalService]); +app.factory('walletService', walletService); +app.directive('blockieAddress', blockiesDrtv); +app.directive('qrCode', QRCodeDrtv); +app.directive('onReadFile', fileReaderDrtv); +app.directive('walletDecryptDrtv', walletDecryptDrtv); +app.directive('cxWalletDecryptDrtv', cxWalletDecryptDrtv); +app.controller('tabsCtrl', ['$scope', 'globalService', tabsCtrl]); +app.controller('viewCtrl', ['$scope', 'globalService', viewCtrl]); +app.controller('walletGenCtrl', ['$scope', walletGenCtrl]); +app.controller('bulkGenCtrl', ['$scope', bulkGenCtrl]); +app.controller('decryptWalletCtrl', ['$scope','$sce','walletService', decryptWalletCtrl]); +app.controller('viewWalletCtrl', ['$scope','walletService', viewWalletCtrl]); +app.controller('sendTxCtrl', ['$scope','$sce','walletService', sendTxCtrl]); +app.controller('digixCtrl', ['$scope','$sce','walletService', digixCtrl]); +app.controller('theDaoCtrl', ['$scope','$sce','walletService', theDaoCtrl]); +app.controller('theDaoProposalCtrl', ['$scope','$sce','walletService', theDaoProposalCtrl]); +app.controller('sendOfflineTxCtrl', ['$scope','$sce','walletService', sendOfflineTxCtrl]); +if(IS_CX){ + app.controller('addWalletCtrl', ['$scope','$sce', addWalletCtrl]); + app.controller('myWalletsCtrl', ['$scope','$sce', myWalletsCtrl]); + app.controller('mainPopCtrl', ['$scope','$sce', mainPopCtrl]); + app.controller('quickSendCtrl', ['$scope','$sce', quickSendCtrl]); + app.controller('cxDecryptWalletCtrl', ['$scope','$sce','walletService', cxDecryptWalletCtrl]); +} + +},{"./ajaxReq":1,"./controllers/CX/addWalletCtrl":2,"./controllers/CX/cxDecryptWalletCtrl":3,"./controllers/CX/mainPopCtrl":4,"./controllers/CX/myWalletsCtrl":5,"./controllers/CX/quickSendCtrl":6,"./controllers/bulkGenCtrl":7,"./controllers/decryptWalletCtrl":8,"./controllers/digixCtrl":9,"./controllers/sendOfflineTxCtrl":10,"./controllers/sendTxCtrl":11,"./controllers/tabsCtrl":12,"./controllers/theDaoCtrl":13,"./controllers/theDaoProposalCtrl":14,"./controllers/viewCtrl":15,"./controllers/viewWalletCtrl":16,"./controllers/walletGenCtrl":17,"./cxFuncs":18,"./directives/QRCodeDrtv":19,"./directives/blockiesDrtv":20,"./directives/cxWalletDecryptDrtv":21,"./directives/fileReaderDrtv":22,"./directives/walletDecryptDrtv":23,"./ethFuncs":24,"./etherUnits":25,"./globalFuncs":26,"./myetherwallet":28,"./services/globalService":29,"./services/walletService":30,"./uiFuncs":31,"angular":33,"babel-polyfill":49,"bignumber.js":52,"crypto":387,"ethereumjs-tx":417,"ethereumjs-util":418,"marked":434,"scryptsy":463,"uuid":483}],28:[function(require,module,exports){ (function (Buffer){ -'use strict'; -var Wallet = function(priv) { - this.privKey = priv.length == 32 ? priv : Buffer(priv, 'hex') -} -Wallet.generate = function(icapDirect) { - if (icapDirect) { - while (true) { - var privKey = ethUtil.crypto.randomBytes(32) - if (ethUtil.privateToAddress(privKey)[0] === 0) { - return new Wallet(privKey) - } - } - } else { - return new Wallet(ethUtil.crypto.randomBytes(32)) - } -} -Wallet.prototype.getPrivateKey = function() { - return this.privKey -} -Wallet.prototype.getPrivateKeyString = function() { - return this.getPrivateKey().toString('hex') -} -Wallet.prototype.getPublicKey = function() { - return ethUtil.privateToPublic(this.privKey) -} -Wallet.prototype.getPublicKeyString = function() { - return '0x' + this.getPublicKey().toString('hex') -} -Wallet.prototype.getAddress = function() { - return ethUtil.privateToAddress(this.privKey) -} -Wallet.prototype.getAddressString = function() { - return '0x' + this.getAddress().toString('hex') -} -Wallet.prototype.getChecksumAddressString = function() { - return ethUtil.toChecksumAddress(this.getAddressString()) -} -Wallet.fromPrivateKey = function(priv) { - return new Wallet(priv) -} -Wallet.prototype.toV3 = function(password, opts) { - opts = opts || {} - var salt = opts.salt || ethUtil.crypto.randomBytes(32) - var iv = opts.iv || ethUtil.crypto.randomBytes(16) - var derivedKey - var kdf = opts.kdf || 'scrypt' - var kdfparams = { - dklen: opts.dklen || 32, - salt: salt.toString('hex') - } - if (kdf === 'pbkdf2') { - kdfparams.c = opts.c || 262144 - kdfparams.prf = 'hmac-sha256' - derivedKey = ethUtil.crypto.pbkdf2Sync(new Buffer(password), salt, kdfparams.c, kdfparams.dklen, 'sha256') - } else if (kdf === 'scrypt') { - // FIXME: support progress reporting callback - kdfparams.n = opts.n || 262144 - kdfparams.r = opts.r || 8 - kdfparams.p = opts.p || 1 - derivedKey = ethUtil.scrypt(new Buffer(password), salt, kdfparams.n, kdfparams.r, kdfparams.p, kdfparams.dklen) - } else { - throw new Error('Unsupported kdf') - } - var cipher = ethUtil.crypto.createCipheriv(opts.cipher || 'aes-128-ctr', derivedKey.slice(0, 16), iv) - if (!cipher) { - throw new Error('Unsupported cipher') - } - var ciphertext = Buffer.concat([cipher.update(this.privKey), cipher.final()]) - var mac = ethUtil.sha3(Buffer.concat([derivedKey.slice(16, 32), new Buffer(ciphertext, 'hex')])) - return { - version: 3, - id: ethUtil.uuid.v4({ - random: opts.uuid || ethUtil.crypto.randomBytes(16) - }), - address: this.getAddress().toString('hex'), - Crypto: { - ciphertext: ciphertext.toString('hex'), - cipherparams: { - iv: iv.toString('hex') - }, - cipher: opts.cipher || 'aes-128-ctr', - kdf: kdf, - kdfparams: kdfparams, - mac: mac.toString('hex') - } - } -} -Wallet.prototype.toJSON = function() { - return { - address: this.getAddressString(), - checksumAddress: this.getChecksumAddressString(), - privKey: this.getPrivateKeyString(), - pubKey: this.getPublicKeyString(), - publisher:"MyEtherWallet", - encrypted:false, - version:2 - } -} -Wallet.fromMyEtherWallet = function(input, password) { - var json = (typeof input === 'object') ? input : JSON.parse(input) - var privKey - if (!json.locked) { - if (json.private.length !== 64) { - throw new Error('Invalid private key length') - } - privKey = new Buffer(json.private, 'hex') - } else { - if (typeof password !== 'string') { - throw new Error('Password required') - } - if (password.length < 7) { - throw new Error('Password must be at least 7 characters') - } - var cipher = json.encrypted ? json.private.slice(0, 128) : json.private - cipher = Wallet.decodeCryptojsSalt(cipher) - var evp = Wallet.evp_kdf(new Buffer(password), cipher.salt, { - keysize: 32, - ivsize: 16 - }) - var decipher = ethUtil.crypto.createDecipheriv('aes-256-cbc', evp.key, evp.iv) - privKey = Wallet.decipherBuffer(decipher, new Buffer(cipher.ciphertext)) - privKey = new Buffer((privKey.toString()), 'hex') - } - var wallet = new Wallet(privKey) - if (wallet.getAddressString() !== json.address) { - throw new Error('Invalid private key or address') - } - return wallet -} -Wallet.fromMyEtherWalletV2 = function (input){ - var json = (typeof input === 'object') ? input : JSON.parse(input); - if (json.privKey.length !== 64) { - throw new Error('Invalid private key length'); - }; - var privKey = new Buffer(json.privKey, 'hex'); - return new Wallet(privKey); -} -Wallet.fromEthSale = function(input, password) { - var json = (typeof input === 'object') ? input : JSON.parse(input) - var encseed = new Buffer(json.encseed, 'hex') - var derivedKey = ethUtil.crypto.pbkdf2Sync(Buffer(password), Buffer(password), 2000, 32, 'sha256').slice(0, 16) - var decipher = ethUtil.crypto.createDecipheriv('aes-128-cbc', derivedKey, encseed.slice(0, 16)) - var seed = Wallet.decipherBuffer(decipher, encseed.slice(16)) - var wallet = new Wallet(ethUtil.sha3(seed)) - if (wallet.getAddress().toString('hex') !== json.ethaddr) { - throw new Error('Decoded key mismatch - possibly wrong passphrase') - } - return wallet -} -Wallet.fromMyEtherWalletKey = function(input, password) { - var cipher = input.slice(0, 128) - cipher = Wallet.decodeCryptojsSalt(cipher) - var evp = Wallet.evp_kdf(new Buffer(password), cipher.salt, { - keysize: 32, - ivsize: 16 - }) - var decipher = ethUtil.crypto.createDecipheriv('aes-256-cbc', evp.key, evp.iv) - var privKey = Wallet.decipherBuffer(decipher, new Buffer(cipher.ciphertext)) - privKey = new Buffer((privKey.toString()), 'hex') - return new Wallet(privKey) -} -Wallet.fromV3 = function(input, password, nonStrict) { - var json = (typeof input === 'object') ? input : JSON.parse(nonStrict ? input.toLowerCase() : input) - if (json.version !== 3) { - throw new Error('Not a V3 wallet') - } - var derivedKey - var kdfparams - if (json.crypto.kdf === 'scrypt') { - kdfparams = json.crypto.kdfparams - derivedKey = ethUtil.scrypt(new Buffer(password), new Buffer(kdfparams.salt, 'hex'), kdfparams.n, kdfparams.r, kdfparams.p, kdfparams.dklen) - } else if (json.crypto.kdf === 'pbkdf2') { - kdfparams = json.crypto.kdfparams - if (kdfparams.prf !== 'hmac-sha256') { - throw new Error('Unsupported parameters to PBKDF2') - } - derivedKey = ethUtil.crypto.pbkdf2Sync(new Buffer(password), new Buffer(kdfparams.salt, 'hex'), kdfparams.c, kdfparams.dklen, 'sha256') - } else { - throw new Error('Unsupported key derivation scheme') - } - var ciphertext = new Buffer(json.crypto.ciphertext, 'hex') - var mac = ethUtil.sha3(Buffer.concat([derivedKey.slice(16, 32), ciphertext])) - if (mac.toString('hex') !== json.crypto.mac) { - throw new Error('Key derivation failed - possibly wrong passphrase') - } - var decipher = ethUtil.crypto.createDecipheriv(json.crypto.cipher, derivedKey.slice(0, 16), new Buffer(json.crypto.cipherparams.iv, 'hex')) - var seed = Wallet.decipherBuffer(decipher, ciphertext, 'hex') - return new Wallet(seed) -} -Wallet.prototype.toV3String = function(password, opts) { - return JSON.stringify(this.toV3(password, opts)) -} -Wallet.prototype.getV3Filename = function (timestamp) { - var ts = timestamp ? new Date(timestamp) : new Date() - return [ - 'UTC--', - ts.toJSON().replace(/:/g, '-'), - '--', - this.getAddress().toString('hex') - ].join('') -} -Wallet.decipherBuffer = function(decipher, data) { - return Buffer.concat([decipher.update(data), decipher.final()]) -} -Wallet.decodeCryptojsSalt = function(input) { - var ciphertext = new Buffer(input, 'base64') - if (ciphertext.slice(0, 8).toString() === 'Salted__') { - return { - salt: ciphertext.slice(8, 16), - ciphertext: ciphertext.slice(16) - } - } else { - return { - ciphertext: ciphertext - } - } -} -Wallet.evp_kdf = function(data, salt, opts) { - // A single EVP iteration, returns `D_i`, where block equlas to `D_(i-1)` - - function iter(block) { - var hash = ethUtil.crypto.createHash(opts.digest || 'md5') - hash.update(block) - hash.update(data) - hash.update(salt) - block = hash.digest() - for (var i = 1; i < (opts.count || 1); i++) { - hash = ethUtil.crypto.createHash(opts.digest || 'md5') - hash.update(block) - block = hash.digest() - } - return block - } - var keysize = opts.keysize || 16 - var ivsize = opts.ivsize || 16 - var ret = [] - var i = 0 - while (Buffer.concat(ret).length < (keysize + ivsize)) { - ret[i] = iter((i === 0) ? new Buffer(0) : ret[i - 1]) - i++ - } - var tmp = Buffer.concat(ret) - return { - key: tmp.slice(0, keysize), - iv: tmp.slice(keysize, keysize + ivsize) - } -} -Wallet.walletRequirePass = function(ethjson) { - var jsonArr; - try { - jsonArr = JSON.parse(ethjson); - } catch (err) { - throw globalFuncs.errorMsgs[3]; - } - if (jsonArr.encseed != null) return true; - else if (jsonArr.Crypto != null || jsonArr.crypto != null) return true - else if (jsonArr.hash != null && jsonArr.locked) return true; - else if (jsonArr.hash != null && !jsonArr.locked) return false; - else if (jsonArr.publisher == "MyEtherWallet" && !jsonArr.encrypted) return false; - else - throw globalFuncs.errorMsgs[2]; -} -Wallet.getWalletFromPrivKeyFile = function(strjson, password) { - var jsonArr = JSON.parse(strjson); - if (jsonArr.encseed != null) return Wallet.fromEthSale(strjson, password); - else if (jsonArr.Crypto != null || jsonArr.crypto != null) return Wallet.fromV3(strjson, password, true); - else if (jsonArr.hash != null) return Wallet.fromMyEtherWallet(strjson, password); - else if (jsonArr.publisher == "MyEtherWallet") return Wallet.fromMyEtherWalletV2(strjson); - else - throw globalFuncs.errorMsgs[2]; -} +'use strict'; +var Wallet = function(priv) { + this.privKey = priv.length == 32 ? priv : Buffer(priv, 'hex') +} +Wallet.generate = function(icapDirect) { + if (icapDirect) { + while (true) { + var privKey = ethUtil.crypto.randomBytes(32) + if (ethUtil.privateToAddress(privKey)[0] === 0) { + return new Wallet(privKey) + } + } + } else { + return new Wallet(ethUtil.crypto.randomBytes(32)) + } +} +Wallet.prototype.getPrivateKey = function() { + return this.privKey +} +Wallet.prototype.getPrivateKeyString = function() { + return this.getPrivateKey().toString('hex') +} +Wallet.prototype.getPublicKey = function() { + return ethUtil.privateToPublic(this.privKey) +} +Wallet.prototype.getPublicKeyString = function() { + return '0x' + this.getPublicKey().toString('hex') +} +Wallet.prototype.getAddress = function() { + return ethUtil.privateToAddress(this.privKey) +} +Wallet.prototype.getAddressString = function() { + return '0x' + this.getAddress().toString('hex') +} +Wallet.prototype.getChecksumAddressString = function() { + return ethUtil.toChecksumAddress(this.getAddressString()) +} +Wallet.fromPrivateKey = function(priv) { + return new Wallet(priv) +} +Wallet.prototype.toV3 = function(password, opts) { + opts = opts || {} + var salt = opts.salt || ethUtil.crypto.randomBytes(32) + var iv = opts.iv || ethUtil.crypto.randomBytes(16) + var derivedKey + var kdf = opts.kdf || 'scrypt' + var kdfparams = { + dklen: opts.dklen || 32, + salt: salt.toString('hex') + } + if (kdf === 'pbkdf2') { + kdfparams.c = opts.c || 262144 + kdfparams.prf = 'hmac-sha256' + derivedKey = ethUtil.crypto.pbkdf2Sync(new Buffer(password), salt, kdfparams.c, kdfparams.dklen, 'sha256') + } else if (kdf === 'scrypt') { + // FIXME: support progress reporting callback + kdfparams.n = opts.n || 262144 + kdfparams.r = opts.r || 8 + kdfparams.p = opts.p || 1 + derivedKey = ethUtil.scrypt(new Buffer(password), salt, kdfparams.n, kdfparams.r, kdfparams.p, kdfparams.dklen) + } else { + throw new Error('Unsupported kdf') + } + var cipher = ethUtil.crypto.createCipheriv(opts.cipher || 'aes-128-ctr', derivedKey.slice(0, 16), iv) + if (!cipher) { + throw new Error('Unsupported cipher') + } + var ciphertext = Buffer.concat([cipher.update(this.privKey), cipher.final()]) + var mac = ethUtil.sha3(Buffer.concat([derivedKey.slice(16, 32), new Buffer(ciphertext, 'hex')])) + return { + version: 3, + id: ethUtil.uuid.v4({ + random: opts.uuid || ethUtil.crypto.randomBytes(16) + }), + address: this.getAddress().toString('hex'), + Crypto: { + ciphertext: ciphertext.toString('hex'), + cipherparams: { + iv: iv.toString('hex') + }, + cipher: opts.cipher || 'aes-128-ctr', + kdf: kdf, + kdfparams: kdfparams, + mac: mac.toString('hex') + } + } +} +Wallet.prototype.toJSON = function() { + return { + address: this.getAddressString(), + checksumAddress: this.getChecksumAddressString(), + privKey: this.getPrivateKeyString(), + pubKey: this.getPublicKeyString(), + publisher:"MyEtherWallet", + encrypted:false, + version:2 + } +} +Wallet.fromMyEtherWallet = function(input, password) { + var json = (typeof input === 'object') ? input : JSON.parse(input) + var privKey + if (!json.locked) { + if (json.private.length !== 64) { + throw new Error('Invalid private key length') + } + privKey = new Buffer(json.private, 'hex') + } else { + if (typeof password !== 'string') { + throw new Error('Password required') + } + if (password.length < 7) { + throw new Error('Password must be at least 7 characters') + } + var cipher = json.encrypted ? json.private.slice(0, 128) : json.private + cipher = Wallet.decodeCryptojsSalt(cipher) + var evp = Wallet.evp_kdf(new Buffer(password), cipher.salt, { + keysize: 32, + ivsize: 16 + }) + var decipher = ethUtil.crypto.createDecipheriv('aes-256-cbc', evp.key, evp.iv) + privKey = Wallet.decipherBuffer(decipher, new Buffer(cipher.ciphertext)) + privKey = new Buffer((privKey.toString()), 'hex') + } + var wallet = new Wallet(privKey) + if (wallet.getAddressString() !== json.address) { + throw new Error('Invalid private key or address') + } + return wallet +} +Wallet.fromMyEtherWalletV2 = function (input){ + var json = (typeof input === 'object') ? input : JSON.parse(input); + if (json.privKey.length !== 64) { + throw new Error('Invalid private key length'); + }; + var privKey = new Buffer(json.privKey, 'hex'); + return new Wallet(privKey); +} +Wallet.fromEthSale = function(input, password) { + var json = (typeof input === 'object') ? input : JSON.parse(input) + var encseed = new Buffer(json.encseed, 'hex') + var derivedKey = ethUtil.crypto.pbkdf2Sync(Buffer(password), Buffer(password), 2000, 32, 'sha256').slice(0, 16) + var decipher = ethUtil.crypto.createDecipheriv('aes-128-cbc', derivedKey, encseed.slice(0, 16)) + var seed = Wallet.decipherBuffer(decipher, encseed.slice(16)) + var wallet = new Wallet(ethUtil.sha3(seed)) + if (wallet.getAddress().toString('hex') !== json.ethaddr) { + throw new Error('Decoded key mismatch - possibly wrong passphrase') + } + return wallet +} +Wallet.fromMyEtherWalletKey = function(input, password) { + var cipher = input.slice(0, 128) + cipher = Wallet.decodeCryptojsSalt(cipher) + var evp = Wallet.evp_kdf(new Buffer(password), cipher.salt, { + keysize: 32, + ivsize: 16 + }) + var decipher = ethUtil.crypto.createDecipheriv('aes-256-cbc', evp.key, evp.iv) + var privKey = Wallet.decipherBuffer(decipher, new Buffer(cipher.ciphertext)) + privKey = new Buffer((privKey.toString()), 'hex') + return new Wallet(privKey) +} +Wallet.fromV3 = function(input, password, nonStrict) { + var json = (typeof input === 'object') ? input : JSON.parse(nonStrict ? input.toLowerCase() : input) + if (json.version !== 3) { + throw new Error('Not a V3 wallet') + } + var derivedKey + var kdfparams + if (json.crypto.kdf === 'scrypt') { + kdfparams = json.crypto.kdfparams + derivedKey = ethUtil.scrypt(new Buffer(password), new Buffer(kdfparams.salt, 'hex'), kdfparams.n, kdfparams.r, kdfparams.p, kdfparams.dklen) + } else if (json.crypto.kdf === 'pbkdf2') { + kdfparams = json.crypto.kdfparams + if (kdfparams.prf !== 'hmac-sha256') { + throw new Error('Unsupported parameters to PBKDF2') + } + derivedKey = ethUtil.crypto.pbkdf2Sync(new Buffer(password), new Buffer(kdfparams.salt, 'hex'), kdfparams.c, kdfparams.dklen, 'sha256') + } else { + throw new Error('Unsupported key derivation scheme') + } + var ciphertext = new Buffer(json.crypto.ciphertext, 'hex') + var mac = ethUtil.sha3(Buffer.concat([derivedKey.slice(16, 32), ciphertext])) + if (mac.toString('hex') !== json.crypto.mac) { + throw new Error('Key derivation failed - possibly wrong passphrase') + } + var decipher = ethUtil.crypto.createDecipheriv(json.crypto.cipher, derivedKey.slice(0, 16), new Buffer(json.crypto.cipherparams.iv, 'hex')) + var seed = Wallet.decipherBuffer(decipher, ciphertext, 'hex') + return new Wallet(seed) +} +Wallet.prototype.toV3String = function(password, opts) { + return JSON.stringify(this.toV3(password, opts)) +} +Wallet.prototype.getV3Filename = function (timestamp) { + var ts = timestamp ? new Date(timestamp) : new Date() + return [ + 'UTC--', + ts.toJSON().replace(/:/g, '-'), + '--', + this.getAddress().toString('hex') + ].join('') +} +Wallet.decipherBuffer = function(decipher, data) { + return Buffer.concat([decipher.update(data), decipher.final()]) +} +Wallet.decodeCryptojsSalt = function(input) { + var ciphertext = new Buffer(input, 'base64') + if (ciphertext.slice(0, 8).toString() === 'Salted__') { + return { + salt: ciphertext.slice(8, 16), + ciphertext: ciphertext.slice(16) + } + } else { + return { + ciphertext: ciphertext + } + } +} +Wallet.evp_kdf = function(data, salt, opts) { + // A single EVP iteration, returns `D_i`, where block equlas to `D_(i-1)` + + function iter(block) { + var hash = ethUtil.crypto.createHash(opts.digest || 'md5') + hash.update(block) + hash.update(data) + hash.update(salt) + block = hash.digest() + for (var i = 1; i < (opts.count || 1); i++) { + hash = ethUtil.crypto.createHash(opts.digest || 'md5') + hash.update(block) + block = hash.digest() + } + return block + } + var keysize = opts.keysize || 16 + var ivsize = opts.ivsize || 16 + var ret = [] + var i = 0 + while (Buffer.concat(ret).length < (keysize + ivsize)) { + ret[i] = iter((i === 0) ? new Buffer(0) : ret[i - 1]) + i++ + } + var tmp = Buffer.concat(ret) + return { + key: tmp.slice(0, keysize), + iv: tmp.slice(keysize, keysize + ivsize) + } +} +Wallet.walletRequirePass = function(ethjson) { + var jsonArr; + try { + jsonArr = JSON.parse(ethjson); + } catch (err) { + throw globalFuncs.errorMsgs[3]; + } + if (jsonArr.encseed != null) return true; + else if (jsonArr.Crypto != null || jsonArr.crypto != null) return true + else if (jsonArr.hash != null && jsonArr.locked) return true; + else if (jsonArr.hash != null && !jsonArr.locked) return false; + else if (jsonArr.publisher == "MyEtherWallet" && !jsonArr.encrypted) return false; + else + throw globalFuncs.errorMsgs[2]; +} +Wallet.getWalletFromPrivKeyFile = function(strjson, password) { + var jsonArr = JSON.parse(strjson); + if (jsonArr.encseed != null) return Wallet.fromEthSale(strjson, password); + else if (jsonArr.Crypto != null || jsonArr.crypto != null) return Wallet.fromV3(strjson, password, true); + else if (jsonArr.hash != null) return Wallet.fromMyEtherWallet(strjson, password); + else if (jsonArr.publisher == "MyEtherWallet") return Wallet.fromMyEtherWalletV2(strjson); + else + throw globalFuncs.errorMsgs[2]; +} module.exports = Wallet; }).call(this,require("buffer").Buffer) -},{"buffer":83}],29:[function(require,module,exports){ -'use strict'; -var globalService = function($http, $httpParamSerializerJQLike) { - globalFuncs.checkAndRedirectHTTPS(); - ajaxReq.http = $http; - ajaxReq.postSerializer = $httpParamSerializerJQLike; - - var tabs = { - generateWallet: { - id: 0, - name: "Generate Wallet", - url: "generate-wallet", - mew: true, - cx: false - }, - bulkGenerate: { - id: 1, - name: "Bulk Generate", - url: "bulk-generate", - mew: false, - cx: false - }, - viewWalletInfo: { - id: 2, - name: "View Wallet Info", - url: "view-wallet-info", - mew: true, - cx: false - }, - myWallet: { - id: 3, - name: "My Wallets", - url: "my-wallet", - mew: false, - cx: true - }, - addWallet: { - id: 4, - name: "Add Wallet", - url: "add-wallet", - mew: false, - cx: true - }, - sendTransaction: { - id: 5, - name: "Send Transaction", - url: "send-transaction", - mew: true, - cx: true - }, - offlineTransaction: { - id: 6, - name: "Offline Transaction", - url:"offline-transaction", - mew: true, - cx: false - }, - dao: { - id: 7, - name: "The DAO", - url: "the-dao", - mew: true, - cx: true - }, - daoproposals: { - id: 8, - name: "DAO Proposals", - url: "dao-proposals", - mew: true, - cx: true - }, - digix: { - id: 9, - name: "Digix", - url: "digix", - mew: true, - cx: true - }, - contracts: { - id: 10, - name: "Contracts", - url:"contracts", - mew: false, - cx: false - }, - help: { - id: 11, - name: "Help", - url: "help", - mew: true, - cx: true - } - }; - var currentTab = 0; - if(typeof chrome != 'undefined') - currentTab = chrome.windows === undefined ? 0 : 3; - return { - tabs: tabs, - currentTab: currentTab - }; -}; -module.exports = globalService; - - +},{"buffer":84}],29:[function(require,module,exports){ +'use strict'; +var globalService = function($http, $httpParamSerializerJQLike) { + globalFuncs.checkAndRedirectHTTPS(); + ajaxReq.http = $http; + ajaxReq.postSerializer = $httpParamSerializerJQLike; + + var tabs = { + generateWallet: { + id: 0, + name: "Generate Wallet", + url: "generate-wallet", + mew: true, + cx: false + }, + bulkGenerate: { + id: 1, + name: "Bulk Generate", + url: "bulk-generate", + mew: false, + cx: false + }, + viewWalletInfo: { + id: 2, + name: "View Wallet Info", + url: "view-wallet-info", + mew: true, + cx: false + }, + myWallet: { + id: 3, + name: "My Wallets", + url: "my-wallet", + mew: false, + cx: true + }, + addWallet: { + id: 4, + name: "Add Wallet", + url: "add-wallet", + mew: false, + cx: true + }, + sendTransaction: { + id: 5, + name: "Send Transaction", + url: "send-transaction", + mew: true, + cx: true + }, + offlineTransaction: { + id: 6, + name: "Offline Transaction", + url:"offline-transaction", + mew: true, + cx: false + }, + dao: { + id: 7, + name: "The DAO", + url: "the-dao", + mew: true, + cx: true + }, + daoproposals: { + id: 8, + name: "DAO Proposals", + url: "dao-proposals", + mew: true, + cx: true + }, + digix: { + id: 9, + name: "Digix", + url: "digix", + mew: true, + cx: true + }, + contracts: { + id: 10, + name: "Contracts", + url:"contracts", + mew: false, + cx: false + }, + help: { + id: 11, + name: "Help", + url: "help", + mew: true, + cx: true + } + }; + var currentTab = 0; + if(typeof chrome != 'undefined') + currentTab = chrome.windows === undefined ? 0 : 3; + return { + tabs: tabs, + currentTab: currentTab + }; +}; +module.exports = globalService; + + },{}],30:[function(require,module,exports){ -'use strict'; -var walletService = function() { - return { - wallet: null, - password:'' - } -}; +'use strict'; +var walletService = function() { + return { + wallet: null, + password:'' + } +}; module.exports = walletService; },{}],31:[function(require,module,exports){ (function (Buffer){ -'use strict'; -var uiFuncs = function() {} -uiFuncs.generateTx = function($scope, $sce, callback) { - try { - if (!ethFuncs.validateEtherAddress($scope.tx.to)) throw globalFuncs.errorMsgs[5]; - else if (!globalFuncs.isNumeric($scope.tx.value) || parseFloat($scope.tx.value) < 0) throw globalFuncs.errorMsgs[7]; - else if (!globalFuncs.isNumeric($scope.tx.gasLimit) || parseFloat($scope.tx.gasLimit) <= 0) throw globalFuncs.errorMsgs[8]; - else if (!ethFuncs.validateHexString($scope.tx.data)) throw globalFuncs.errorMsgs[9]; - ajaxReq.getTransactionData($scope.wallet.getAddressString(), function(data) { - if (data.error) throw data.msg; - data = data.data; - var rawTx = { - nonce: ethFuncs.sanitizeHex(data.nonce), - gasPrice: ethFuncs.sanitizeHex(ethFuncs.addTinyMoreToGas(data.gasprice)), - gasLimit: ethFuncs.sanitizeHex(ethFuncs.decimalToHex($scope.tx.gasLimit)), - to: ethFuncs.sanitizeHex($scope.tx.to), - value: ethFuncs.sanitizeHex(ethFuncs.decimalToHex(etherUnits.toWei($scope.tx.value, $scope.tx.unit))), - data: ethFuncs.sanitizeHex($scope.tx.data) - } - var eTx = new ethUtil.Tx(rawTx); - eTx.sign(new Buffer($scope.wallet.getPrivateKeyString(), 'hex')); - $scope.rawTx = JSON.stringify(rawTx); - $scope.signedTx = '0x' + eTx.serialize().toString('hex'); - $scope.showRaw = true; - if($scope.autoSend){ - uiFuncs.sendTx($scope, $sce); - $scope.autoSend = false; - } - if(callback !== undefined) callback(); - }); - $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText('')); - } catch (e) { - $scope.showRaw = false; - $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } -} -uiFuncs.sendTx = function($scope, $sce) { - if(document.getElementById('sendTransaction')!=null) - new Modal(document.getElementById('sendTransaction')).close(); - ajaxReq.sendRawTx($scope.signedTx, function(data) { - if (data.error) { - $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(data.msg)); - } else { - if( $scope.setBalance !== undefined ) $scope.setBalance(); - $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[2] + " " + data.data)); - } - }); -} -uiFuncs.transferAllBalance = function($scope, $sce) { - try { - ajaxReq.getTransactionData($scope.wallet.getAddressString(), function(data) { - if (data.error) throw data.msg; - data = data.data; - var gasPrice = new BigNumber(ethFuncs.sanitizeHex(ethFuncs.addTinyMoreToGas(data.gasprice))).times($scope.tx.gasLimit); - var maxVal = new BigNumber(data.balance).minus(gasPrice); - $scope.tx.unit = "ether"; - $scope.tx.value = etherUnits.toEther(maxVal, 'wei'); - $scope.tx.value = $scope.tx.value < 0 ? 0 : $scope.tx.value; - }); - } catch (e) { - $scope.showRaw = false; - $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } -} +'use strict'; +var uiFuncs = function() {} +uiFuncs.generateTx = function($scope, $sce, callback) { + try { + if (!ethFuncs.validateEtherAddress($scope.tx.to)) throw globalFuncs.errorMsgs[5]; + else if (!globalFuncs.isNumeric($scope.tx.value) || parseFloat($scope.tx.value) < 0) throw globalFuncs.errorMsgs[7]; + else if (!globalFuncs.isNumeric($scope.tx.gasLimit) || parseFloat($scope.tx.gasLimit) <= 0) throw globalFuncs.errorMsgs[8]; + else if (!ethFuncs.validateHexString($scope.tx.data)) throw globalFuncs.errorMsgs[9]; + ajaxReq.getTransactionData($scope.wallet.getAddressString(), function(data) { + if (data.error) throw data.msg; + data = data.data; + var rawTx = { + nonce: ethFuncs.sanitizeHex(data.nonce), + gasPrice: ethFuncs.sanitizeHex(ethFuncs.addTinyMoreToGas(data.gasprice)), + gasLimit: ethFuncs.sanitizeHex(ethFuncs.decimalToHex($scope.tx.gasLimit)), + to: ethFuncs.sanitizeHex($scope.tx.to), + value: ethFuncs.sanitizeHex(ethFuncs.decimalToHex(etherUnits.toWei($scope.tx.value, $scope.tx.unit))), + data: ethFuncs.sanitizeHex($scope.tx.data) + } + var eTx = new ethUtil.Tx(rawTx); + eTx.sign(new Buffer($scope.wallet.getPrivateKeyString(), 'hex')); + $scope.rawTx = JSON.stringify(rawTx); + $scope.signedTx = '0x' + eTx.serialize().toString('hex'); + $scope.showRaw = true; + if($scope.autoSend){ + uiFuncs.sendTx($scope, $sce); + $scope.autoSend = false; + } + if(callback !== undefined) callback(); + }); + $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText('')); + } catch (e) { + $scope.showRaw = false; + $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } +} +uiFuncs.sendTx = function($scope, $sce) { + if(document.getElementById('sendTransaction')!=null) + new Modal(document.getElementById('sendTransaction')).close(); + ajaxReq.sendRawTx($scope.signedTx, function(data) { + if (data.error) { + $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(data.msg)); + } else { + if( $scope.setBalance !== undefined ) $scope.setBalance(); + $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[2] + " " + data.data)); + } + }); +} +uiFuncs.transferAllBalance = function($scope, $sce) { + try { + ajaxReq.getTransactionData($scope.wallet.getAddressString(), function(data) { + if (data.error) throw data.msg; + data = data.data; + var gasPrice = new BigNumber(ethFuncs.sanitizeHex(ethFuncs.addTinyMoreToGas(data.gasprice))).times($scope.tx.gasLimit); + var maxVal = new BigNumber(data.balance).minus(gasPrice); + $scope.tx.unit = "ether"; + $scope.tx.value = etherUnits.toEther(maxVal, 'wei'); + $scope.tx.value = $scope.tx.value < 0 ? 0 : $scope.tx.value; + }); + } catch (e) { + $scope.showRaw = false; + $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } +} module.exports = uiFuncs; }).call(this,require("buffer").Buffer) -},{"buffer":83}],32:[function(require,module,exports){ +},{"buffer":84}],32:[function(require,module,exports){ /** * @license AngularJS v1.5.6 * (c) 2010-2016 Google, Inc. http://angularjs.org @@ -33565,7 +33507,7 @@ asn1.constants = require('./asn1/constants'); asn1.decoders = require('./asn1/decoders'); asn1.encoders = require('./asn1/encoders'); -},{"./asn1/api":35,"./asn1/base":37,"./asn1/constants":41,"./asn1/decoders":43,"./asn1/encoders":46,"bn.js":53}],35:[function(require,module,exports){ +},{"./asn1/api":35,"./asn1/base":37,"./asn1/constants":41,"./asn1/decoders":43,"./asn1/encoders":46,"bn.js":54}],35:[function(require,module,exports){ var asn1 = require('../asn1'); var inherits = require('inherits'); @@ -33628,7 +33570,7 @@ Entity.prototype.encode = function encode(data, enc, /* internal */ reporter) { return this._getEncoder(enc).encode(data, reporter); }; -},{"../asn1":34,"inherits":428,"vm":484}],36:[function(require,module,exports){ +},{"../asn1":34,"inherits":429,"vm":484}],36:[function(require,module,exports){ var inherits = require('inherits'); var Reporter = require('../base').Reporter; var Buffer = require('buffer').Buffer; @@ -33746,7 +33688,7 @@ EncoderBuffer.prototype.join = function join(out, offset) { return out; }; -},{"../base":37,"buffer":83,"inherits":428}],37:[function(require,module,exports){ +},{"../base":37,"buffer":84,"inherits":429}],37:[function(require,module,exports){ var base = exports; base.Reporter = require('./reporter').Reporter; @@ -34371,7 +34313,7 @@ Node.prototype._isPrintstr = function isPrintstr(str) { return /^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(str); }; -},{"../base":37,"minimalistic-assert":435}],39:[function(require,module,exports){ +},{"../base":37,"minimalistic-assert":436}],39:[function(require,module,exports){ var inherits = require('inherits'); function Reporter(options) { @@ -34475,7 +34417,7 @@ ReporterError.prototype.rethrow = function rethrow(msg) { return this; }; -},{"inherits":428}],40:[function(require,module,exports){ +},{"inherits":429}],40:[function(require,module,exports){ var constants = require('../constants'); exports.tagClass = { @@ -34863,7 +34805,7 @@ function derDecodeLen(buf, primitive, fail) { return len; } -},{"../../asn1":34,"inherits":428}],43:[function(require,module,exports){ +},{"../../asn1":34,"inherits":429}],43:[function(require,module,exports){ var decoders = exports; decoders.der = require('./der'); @@ -34920,7 +34862,7 @@ PEMDecoder.prototype.decode = function decode(data, options) { return DERDecoder.prototype.decode.call(this, input, options); }; -},{"./der":42,"buffer":83,"inherits":428}],45:[function(require,module,exports){ +},{"./der":42,"buffer":84,"inherits":429}],45:[function(require,module,exports){ var inherits = require('inherits'); var Buffer = require('buffer').Buffer; @@ -35215,7 +35157,7 @@ function encodeTag(tag, primitive, cls, reporter) { return res; } -},{"../../asn1":34,"buffer":83,"inherits":428}],46:[function(require,module,exports){ +},{"../../asn1":34,"buffer":84,"inherits":429}],46:[function(require,module,exports){ var encoders = exports; encoders.der = require('./der'); @@ -35244,7 +35186,7 @@ PEMEncoder.prototype.encode = function encode(data, options) { return out.join('\n'); }; -},{"./der":45,"inherits":428}],48:[function(require,module,exports){ +},{"./der":45,"inherits":429}],48:[function(require,module,exports){ // http://wiki.commonjs.org/wiki/Unit_Testing/1.0 // // THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8! @@ -35607,13 +35549,13 @@ var objectKeys = Object.keys || function (obj) { },{"util/":481}],49:[function(require,module,exports){ (function (global){ -"use strict"; +/*istanbul ignore next*/"use strict"; -require("core-js/shim"); +/*istanbul ignore next*/require("core-js/shim"); -require("regenerator-runtime/runtime"); +/*istanbul ignore next*/require("babel-regenerator-runtime"); -require("core-js/fn/regexp/escape"); +/*istanbul ignore next*/require("core-js/fn/regexp/escape"); /* eslint max-len: 0 */ @@ -35640,7 +35582,668 @@ define(String.prototype, "padRight", "".padEnd); [][key] && define(Array, key, Function.call.bind([][key])); }); }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"core-js/fn/regexp/escape":85,"core-js/shim":379,"regenerator-runtime/runtime":460}],50:[function(require,module,exports){ +},{"babel-regenerator-runtime":50,"core-js/fn/regexp/escape":86,"core-js/shim":380}],50:[function(require,module,exports){ +(function (process,global){ +/** + * Copyright (c) 2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * https://raw.github.com/facebook/regenerator/master/LICENSE file. An + * additional grant of patent rights can be found in the PATENTS file in + * the same directory. + */ + +!(function(global) { + "use strict"; + + var hasOwn = Object.prototype.hasOwnProperty; + var undefined; // More compressible than void 0. + var iteratorSymbol = + typeof Symbol === "function" && Symbol.iterator || "@@iterator"; + + var inModule = typeof module === "object"; + var runtime = global.regeneratorRuntime; + if (runtime) { + if (inModule) { + // If regeneratorRuntime is defined globally and we're in a module, + // make the exports object identical to regeneratorRuntime. + module.exports = runtime; + } + // Don't bother evaluating the rest of this file if the runtime was + // already defined globally. + return; + } + + // Define the runtime globally (as expected by generated code) as either + // module.exports (if we're in a module) or a new, empty object. + runtime = global.regeneratorRuntime = inModule ? module.exports : {}; + + function wrap(innerFn, outerFn, self, tryLocsList) { + // If outerFn provided, then outerFn.prototype instanceof Generator. + var generator = Object.create((outerFn || Generator).prototype); + var context = new Context(tryLocsList || []); + + // The ._invoke method unifies the implementations of the .next, + // .throw, and .return methods. + generator._invoke = makeInvokeMethod(innerFn, self, context); + + return generator; + } + runtime.wrap = wrap; + + // Try/catch helper to minimize deoptimizations. Returns a completion + // record like context.tryEntries[i].completion. This interface could + // have been (and was previously) designed to take a closure to be + // invoked without arguments, but in all the cases we care about we + // already have an existing method we want to call, so there's no need + // to create a new function object. We can even get away with assuming + // the method takes exactly one argument, since that happens to be true + // in every case, so we don't have to touch the arguments object. The + // only additional allocation required is the completion record, which + // has a stable shape and so hopefully should be cheap to allocate. + function tryCatch(fn, obj, arg) { + try { + return { type: "normal", arg: fn.call(obj, arg) }; + } catch (err) { + return { type: "throw", arg: err }; + } + } + + var GenStateSuspendedStart = "suspendedStart"; + var GenStateSuspendedYield = "suspendedYield"; + var GenStateExecuting = "executing"; + var GenStateCompleted = "completed"; + + // Returning this object from the innerFn has the same effect as + // breaking out of the dispatch switch statement. + var ContinueSentinel = {}; + + // Dummy constructor functions that we use as the .constructor and + // .constructor.prototype properties for functions that return Generator + // objects. For full spec compliance, you may wish to configure your + // minifier not to mangle the names of these two functions. + function Generator() {} + function GeneratorFunction() {} + function GeneratorFunctionPrototype() {} + + var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype; + GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; + GeneratorFunctionPrototype.constructor = GeneratorFunction; + GeneratorFunction.displayName = "GeneratorFunction"; + + // Helper for defining the .next, .throw, and .return methods of the + // Iterator interface in terms of a single ._invoke method. + function defineIteratorMethods(prototype) { + ["next", "throw", "return"].forEach(function(method) { + prototype[method] = function(arg) { + return this._invoke(method, arg); + }; + }); + } + + runtime.isGeneratorFunction = function(genFun) { + var ctor = typeof genFun === "function" && genFun.constructor; + return ctor + ? ctor === GeneratorFunction || + // For the native GeneratorFunction constructor, the best we can + // do is to check its .name property. + (ctor.displayName || ctor.name) === "GeneratorFunction" + : false; + }; + + runtime.mark = function(genFun) { + if (Object.setPrototypeOf) { + Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); + } else { + genFun.__proto__ = GeneratorFunctionPrototype; + } + genFun.prototype = Object.create(Gp); + return genFun; + }; + + // Within the body of any async function, `await x` is transformed to + // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test + // `value instanceof AwaitArgument` to determine if the yielded value is + // meant to be awaited. Some may consider the name of this method too + // cutesy, but they are curmudgeons. + runtime.awrap = function(arg) { + return new AwaitArgument(arg); + }; + + function AwaitArgument(arg) { + this.arg = arg; + } + + function AsyncIterator(generator) { + // This invoke function is written in a style that assumes some + // calling function (or Promise) will handle exceptions. + function invoke(method, arg) { + var result = generator[method](arg); + var value = result.value; + return value instanceof AwaitArgument + ? Promise.resolve(value.arg).then(invokeNext, invokeThrow) + : Promise.resolve(value).then(function(unwrapped) { + // When a yielded Promise is resolved, its final value becomes + // the .value of the Promise<{value,done}> result for the + // current iteration. If the Promise is rejected, however, the + // result for this iteration will be rejected with the same + // reason. Note that rejections of yielded Promises are not + // thrown back into the generator function, as is the case + // when an awaited Promise is rejected. This difference in + // behavior between yield and await is important, because it + // allows the consumer to decide what to do with the yielded + // rejection (swallow it and continue, manually .throw it back + // into the generator, abandon iteration, whatever). With + // await, by contrast, there is no opportunity to examine the + // rejection reason outside the generator function, so the + // only option is to throw it from the await expression, and + // let the generator function handle the exception. + result.value = unwrapped; + return result; + }); + } + + if (typeof process === "object" && process.domain) { + invoke = process.domain.bind(invoke); + } + + var invokeNext = invoke.bind(generator, "next"); + var invokeThrow = invoke.bind(generator, "throw"); + var invokeReturn = invoke.bind(generator, "return"); + var previousPromise; + + function enqueue(method, arg) { + function callInvokeWithMethodAndArg() { + return invoke(method, arg); + } + + return previousPromise = + // If enqueue has been called before, then we want to wait until + // all previous Promises have been resolved before calling invoke, + // so that results are always delivered in the correct order. If + // enqueue has not been called before, then it is important to + // call invoke immediately, without waiting on a callback to fire, + // so that the async generator function has the opportunity to do + // any necessary setup in a predictable way. This predictability + // is why the Promise constructor synchronously invokes its + // executor callback, and why async functions synchronously + // execute code before the first await. Since we implement simple + // async functions in terms of async generators, it is especially + // important to get this right, even though it requires care. + previousPromise ? previousPromise.then( + callInvokeWithMethodAndArg, + // Avoid propagating failures to Promises returned by later + // invocations of the iterator. + callInvokeWithMethodAndArg + ) : new Promise(function (resolve) { + resolve(callInvokeWithMethodAndArg()); + }); + } + + // Define the unified helper method that is used to implement .next, + // .throw, and .return (see defineIteratorMethods). + this._invoke = enqueue; + } + + defineIteratorMethods(AsyncIterator.prototype); + + // Note that simple async functions are implemented on top of + // AsyncIterator objects; they just return a Promise for the value of + // the final result produced by the iterator. + runtime.async = function(innerFn, outerFn, self, tryLocsList) { + var iter = new AsyncIterator( + wrap(innerFn, outerFn, self, tryLocsList) + ); + + return runtime.isGeneratorFunction(outerFn) + ? iter // If outerFn is a generator, return the full iterator. + : iter.next().then(function(result) { + return result.done ? result.value : iter.next(); + }); + }; + + function makeInvokeMethod(innerFn, self, context) { + var state = GenStateSuspendedStart; + + return function invoke(method, arg) { + if (state === GenStateExecuting) { + throw new Error("Generator is already running"); + } + + if (state === GenStateCompleted) { + if (method === "throw") { + throw arg; + } + + // Be forgiving, per 25.3.3.3.3 of the spec: + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume + return doneResult(); + } + + while (true) { + var delegate = context.delegate; + if (delegate) { + if (method === "return" || + (method === "throw" && delegate.iterator[method] === undefined)) { + // A return or throw (when the delegate iterator has no throw + // method) always terminates the yield* loop. + context.delegate = null; + + // If the delegate iterator has a return method, give it a + // chance to clean up. + var returnMethod = delegate.iterator["return"]; + if (returnMethod) { + var record = tryCatch(returnMethod, delegate.iterator, arg); + if (record.type === "throw") { + // If the return method threw an exception, let that + // exception prevail over the original return or throw. + method = "throw"; + arg = record.arg; + continue; + } + } + + if (method === "return") { + // Continue with the outer return, now that the delegate + // iterator has been terminated. + continue; + } + } + + var record = tryCatch( + delegate.iterator[method], + delegate.iterator, + arg + ); + + if (record.type === "throw") { + context.delegate = null; + + // Like returning generator.throw(uncaught), but without the + // overhead of an extra function call. + method = "throw"; + arg = record.arg; + continue; + } + + // Delegate generator ran and handled its own exceptions so + // regardless of what the method was, we continue as if it is + // "next" with an undefined arg. + method = "next"; + arg = undefined; + + var info = record.arg; + if (info.done) { + context[delegate.resultName] = info.value; + context.next = delegate.nextLoc; + } else { + state = GenStateSuspendedYield; + return info; + } + + context.delegate = null; + } + + if (method === "next") { + context._sent = arg; + + if (state === GenStateSuspendedYield) { + context.sent = arg; + } else { + context.sent = undefined; + } + } else if (method === "throw") { + if (state === GenStateSuspendedStart) { + state = GenStateCompleted; + throw arg; + } + + if (context.dispatchException(arg)) { + // If the dispatched exception was caught by a catch block, + // then let that catch block handle the exception normally. + method = "next"; + arg = undefined; + } + + } else if (method === "return") { + context.abrupt("return", arg); + } + + state = GenStateExecuting; + + var record = tryCatch(innerFn, self, context); + if (record.type === "normal") { + // If an exception is thrown from innerFn, we leave state === + // GenStateExecuting and loop back for another invocation. + state = context.done + ? GenStateCompleted + : GenStateSuspendedYield; + + var info = { + value: record.arg, + done: context.done + }; + + if (record.arg === ContinueSentinel) { + if (context.delegate && method === "next") { + // Deliberately forget the last sent value so that we don't + // accidentally pass it on to the delegate. + arg = undefined; + } + } else { + return info; + } + + } else if (record.type === "throw") { + state = GenStateCompleted; + // Dispatch the exception by looping back around to the + // context.dispatchException(arg) call above. + method = "throw"; + arg = record.arg; + } + } + }; + } + + // Define Generator.prototype.{next,throw,return} in terms of the + // unified ._invoke helper method. + defineIteratorMethods(Gp); + + Gp[iteratorSymbol] = function() { + return this; + }; + + Gp.toString = function() { + return "[object Generator]"; + }; + + function pushTryEntry(locs) { + var entry = { tryLoc: locs[0] }; + + if (1 in locs) { + entry.catchLoc = locs[1]; + } + + if (2 in locs) { + entry.finallyLoc = locs[2]; + entry.afterLoc = locs[3]; + } + + this.tryEntries.push(entry); + } + + function resetTryEntry(entry) { + var record = entry.completion || {}; + record.type = "normal"; + delete record.arg; + entry.completion = record; + } + + function Context(tryLocsList) { + // The root entry object (effectively a try statement without a catch + // or a finally block) gives us a place to store values thrown from + // locations where there is no enclosing try statement. + this.tryEntries = [{ tryLoc: "root" }]; + tryLocsList.forEach(pushTryEntry, this); + this.reset(true); + } + + runtime.keys = function(object) { + var keys = []; + for (var key in object) { + keys.push(key); + } + keys.reverse(); + + // Rather than returning an object with a next method, we keep + // things simple and return the next function itself. + return function next() { + while (keys.length) { + var key = keys.pop(); + if (key in object) { + next.value = key; + next.done = false; + return next; + } + } + + // To avoid creating an additional object, we just hang the .value + // and .done properties off the next function object itself. This + // also ensures that the minifier will not anonymize the function. + next.done = true; + return next; + }; + }; + + function values(iterable) { + if (iterable) { + var iteratorMethod = iterable[iteratorSymbol]; + if (iteratorMethod) { + return iteratorMethod.call(iterable); + } + + if (typeof iterable.next === "function") { + return iterable; + } + + if (!isNaN(iterable.length)) { + var i = -1, next = function next() { + while (++i < iterable.length) { + if (hasOwn.call(iterable, i)) { + next.value = iterable[i]; + next.done = false; + return next; + } + } + + next.value = undefined; + next.done = true; + + return next; + }; + + return next.next = next; + } + } + + // Return an iterator with no values. + return { next: doneResult }; + } + runtime.values = values; + + function doneResult() { + return { value: undefined, done: true }; + } + + Context.prototype = { + constructor: Context, + + reset: function(skipTempReset) { + this.prev = 0; + this.next = 0; + this.sent = undefined; + this.done = false; + this.delegate = null; + + this.tryEntries.forEach(resetTryEntry); + + if (!skipTempReset) { + for (var name in this) { + // Not sure about the optimal order of these conditions: + if (name.charAt(0) === "t" && + hasOwn.call(this, name) && + !isNaN(+name.slice(1))) { + this[name] = undefined; + } + } + } + }, + + stop: function() { + this.done = true; + + var rootEntry = this.tryEntries[0]; + var rootRecord = rootEntry.completion; + if (rootRecord.type === "throw") { + throw rootRecord.arg; + } + + return this.rval; + }, + + dispatchException: function(exception) { + if (this.done) { + throw exception; + } + + var context = this; + function handle(loc, caught) { + record.type = "throw"; + record.arg = exception; + context.next = loc; + return !!caught; + } + + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + var record = entry.completion; + + if (entry.tryLoc === "root") { + // Exception thrown outside of any try block that could handle + // it, so set the completion value of the entire function to + // throw the exception. + return handle("end"); + } + + if (entry.tryLoc <= this.prev) { + var hasCatch = hasOwn.call(entry, "catchLoc"); + var hasFinally = hasOwn.call(entry, "finallyLoc"); + + if (hasCatch && hasFinally) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } else if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + + } else if (hasCatch) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } + + } else if (hasFinally) { + if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + + } else { + throw new Error("try statement without catch or finally"); + } + } + } + }, + + abrupt: function(type, arg) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc <= this.prev && + hasOwn.call(entry, "finallyLoc") && + this.prev < entry.finallyLoc) { + var finallyEntry = entry; + break; + } + } + + if (finallyEntry && + (type === "break" || + type === "continue") && + finallyEntry.tryLoc <= arg && + arg <= finallyEntry.finallyLoc) { + // Ignore the finally entry if control is not jumping to a + // location outside the try/catch block. + finallyEntry = null; + } + + var record = finallyEntry ? finallyEntry.completion : {}; + record.type = type; + record.arg = arg; + + if (finallyEntry) { + this.next = finallyEntry.finallyLoc; + } else { + this.complete(record); + } + + return ContinueSentinel; + }, + + complete: function(record, afterLoc) { + if (record.type === "throw") { + throw record.arg; + } + + if (record.type === "break" || + record.type === "continue") { + this.next = record.arg; + } else if (record.type === "return") { + this.rval = record.arg; + this.next = "end"; + } else if (record.type === "normal" && afterLoc) { + this.next = afterLoc; + } + }, + + finish: function(finallyLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.finallyLoc === finallyLoc) { + this.complete(entry.completion, entry.afterLoc); + resetTryEntry(entry); + return ContinueSentinel; + } + } + }, + + "catch": function(tryLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc === tryLoc) { + var record = entry.completion; + if (record.type === "throw") { + var thrown = record.arg; + resetTryEntry(entry); + } + return thrown; + } + } + + // The context.catch method must only be called with a location + // argument that corresponds to a known catch block. + throw new Error("illegal catch attempt"); + }, + + delegateYield: function(iterable, resultName, nextLoc) { + this.delegate = { + iterator: values(iterable), + resultName: resultName, + nextLoc: nextLoc + }; + + return ContinueSentinel; + } + }; +})( + // Among the various tricks for obtaining a reference to the global + // object, this seems to be the most reliable technique that does not + // use indirect eval (which violates Content Security Policy). + typeof global === "object" ? global : + typeof window === "object" ? window : + typeof self === "object" ? self : this +); + +}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"_process":443}],51:[function(require,module,exports){ 'use strict' exports.toByteArray = toByteArray @@ -35751,7 +36354,7 @@ function fromByteArray (uint8) { return parts.join('') } -},{}],51:[function(require,module,exports){ +},{}],52:[function(require,module,exports){ /*! bignumber.js v2.3.0 https://github.com/MikeMcl/bignumber.js/LICENCE */ ;(function (globalObj) { @@ -38486,7 +39089,7 @@ function fromByteArray (uint8) { } })(this); -},{}],52:[function(require,module,exports){ +},{}],53:[function(require,module,exports){ (function (Buffer){ // Reference https://github.com/bitcoin/bips/blob/master/bip-0066.mediawiki // Format: 0x30 [total-length] 0x02 [R-length] [R] 0x02 [S-length] [S] @@ -38601,7 +39204,7 @@ module.exports = { } }).call(this,require("buffer").Buffer) -},{"buffer":83}],53:[function(require,module,exports){ +},{"buffer":84}],54:[function(require,module,exports){ (function (module, exports) { 'use strict'; @@ -42022,7 +42625,7 @@ module.exports = { }; })(typeof module === 'undefined' || module, this); -},{}],54:[function(require,module,exports){ +},{}],55:[function(require,module,exports){ var r; module.exports = function rand(len) { @@ -42081,9 +42684,9 @@ if (typeof window === 'object') { } } -},{}],55:[function(require,module,exports){ - },{}],56:[function(require,module,exports){ + +},{}],57:[function(require,module,exports){ (function (Buffer){ // based on the aes implimentation in triple sec // https://github.com/keybase/triplesec @@ -42264,7 +42867,7 @@ AES.prototype._doCryptBlock = function (M, keySchedule, SUB_MIX, SBOX) { exports.AES = AES }).call(this,require("buffer").Buffer) -},{"buffer":83}],57:[function(require,module,exports){ +},{"buffer":84}],58:[function(require,module,exports){ (function (Buffer){ var aes = require('./aes') var Transform = require('cipher-base') @@ -42365,7 +42968,7 @@ function xorTest (a, b) { } }).call(this,require("buffer").Buffer) -},{"./aes":56,"./ghash":61,"buffer":83,"buffer-xor":82,"cipher-base":84,"inherits":428}],58:[function(require,module,exports){ +},{"./aes":57,"./ghash":62,"buffer":84,"buffer-xor":83,"cipher-base":85,"inherits":429}],59:[function(require,module,exports){ var ciphers = require('./encrypter') exports.createCipher = exports.Cipher = ciphers.createCipher exports.createCipheriv = exports.Cipheriv = ciphers.createCipheriv @@ -42378,7 +42981,7 @@ function getCiphers () { } exports.listCiphers = exports.getCiphers = getCiphers -},{"./decrypter":59,"./encrypter":60,"./modes":62}],59:[function(require,module,exports){ +},{"./decrypter":60,"./encrypter":61,"./modes":63}],60:[function(require,module,exports){ (function (Buffer){ var aes = require('./aes') var Transform = require('cipher-base') @@ -42519,7 +43122,7 @@ exports.createDecipher = createDecipher exports.createDecipheriv = createDecipheriv }).call(this,require("buffer").Buffer) -},{"./aes":56,"./authCipher":57,"./modes":62,"./modes/cbc":63,"./modes/cfb":64,"./modes/cfb1":65,"./modes/cfb8":66,"./modes/ctr":67,"./modes/ecb":68,"./modes/ofb":69,"./streamCipher":70,"buffer":83,"cipher-base":84,"evp_bytestokey":419,"inherits":428}],60:[function(require,module,exports){ +},{"./aes":57,"./authCipher":58,"./modes":63,"./modes/cbc":64,"./modes/cfb":65,"./modes/cfb1":66,"./modes/cfb8":67,"./modes/ctr":68,"./modes/ecb":69,"./modes/ofb":70,"./streamCipher":71,"buffer":84,"cipher-base":85,"evp_bytestokey":420,"inherits":429}],61:[function(require,module,exports){ (function (Buffer){ var aes = require('./aes') var Transform = require('cipher-base') @@ -42645,7 +43248,7 @@ exports.createCipheriv = createCipheriv exports.createCipher = createCipher }).call(this,require("buffer").Buffer) -},{"./aes":56,"./authCipher":57,"./modes":62,"./modes/cbc":63,"./modes/cfb":64,"./modes/cfb1":65,"./modes/cfb8":66,"./modes/ctr":67,"./modes/ecb":68,"./modes/ofb":69,"./streamCipher":70,"buffer":83,"cipher-base":84,"evp_bytestokey":419,"inherits":428}],61:[function(require,module,exports){ +},{"./aes":57,"./authCipher":58,"./modes":63,"./modes/cbc":64,"./modes/cfb":65,"./modes/cfb1":66,"./modes/cfb8":67,"./modes/ctr":68,"./modes/ecb":69,"./modes/ofb":70,"./streamCipher":71,"buffer":84,"cipher-base":85,"evp_bytestokey":420,"inherits":429}],62:[function(require,module,exports){ (function (Buffer){ var zeros = new Buffer(16) zeros.fill(0) @@ -42747,7 +43350,7 @@ function xor (a, b) { } }).call(this,require("buffer").Buffer) -},{"buffer":83}],62:[function(require,module,exports){ +},{"buffer":84}],63:[function(require,module,exports){ exports['aes-128-ecb'] = { cipher: 'AES', key: 128, @@ -42920,7 +43523,7 @@ exports['aes-256-gcm'] = { type: 'auth' } -},{}],63:[function(require,module,exports){ +},{}],64:[function(require,module,exports){ var xor = require('buffer-xor') exports.encrypt = function (self, block) { @@ -42939,7 +43542,7 @@ exports.decrypt = function (self, block) { return xor(out, pad) } -},{"buffer-xor":82}],64:[function(require,module,exports){ +},{"buffer-xor":83}],65:[function(require,module,exports){ (function (Buffer){ var xor = require('buffer-xor') @@ -42974,7 +43577,7 @@ function encryptStart (self, data, decrypt) { } }).call(this,require("buffer").Buffer) -},{"buffer":83,"buffer-xor":82}],65:[function(require,module,exports){ +},{"buffer":84,"buffer-xor":83}],66:[function(require,module,exports){ (function (Buffer){ function encryptByte (self, byteParam, decrypt) { var pad @@ -43012,7 +43615,7 @@ function shiftIn (buffer, value) { } }).call(this,require("buffer").Buffer) -},{"buffer":83}],66:[function(require,module,exports){ +},{"buffer":84}],67:[function(require,module,exports){ (function (Buffer){ function encryptByte (self, byteParam, decrypt) { var pad = self._cipher.encryptBlock(self._prev) @@ -43031,7 +43634,7 @@ exports.encrypt = function (self, chunk, decrypt) { } }).call(this,require("buffer").Buffer) -},{"buffer":83}],67:[function(require,module,exports){ +},{"buffer":84}],68:[function(require,module,exports){ (function (Buffer){ var xor = require('buffer-xor') @@ -43066,7 +43669,7 @@ exports.encrypt = function (self, chunk) { } }).call(this,require("buffer").Buffer) -},{"buffer":83,"buffer-xor":82}],68:[function(require,module,exports){ +},{"buffer":84,"buffer-xor":83}],69:[function(require,module,exports){ exports.encrypt = function (self, block) { return self._cipher.encryptBlock(block) } @@ -43074,7 +43677,7 @@ exports.decrypt = function (self, block) { return self._cipher.decryptBlock(block) } -},{}],69:[function(require,module,exports){ +},{}],70:[function(require,module,exports){ (function (Buffer){ var xor = require('buffer-xor') @@ -43094,7 +43697,7 @@ exports.encrypt = function (self, chunk) { } }).call(this,require("buffer").Buffer) -},{"buffer":83,"buffer-xor":82}],70:[function(require,module,exports){ +},{"buffer":84,"buffer-xor":83}],71:[function(require,module,exports){ (function (Buffer){ var aes = require('./aes') var Transform = require('cipher-base') @@ -43123,7 +43726,7 @@ StreamCipher.prototype._final = function () { } }).call(this,require("buffer").Buffer) -},{"./aes":56,"buffer":83,"cipher-base":84,"inherits":428}],71:[function(require,module,exports){ +},{"./aes":57,"buffer":84,"cipher-base":85,"inherits":429}],72:[function(require,module,exports){ var ebtk = require('evp_bytestokey') var aes = require('browserify-aes/browser') var DES = require('browserify-des') @@ -43198,7 +43801,7 @@ function getCiphers () { } exports.listCiphers = exports.getCiphers = getCiphers -},{"browserify-aes/browser":58,"browserify-aes/modes":62,"browserify-des":72,"browserify-des/modes":73,"evp_bytestokey":419}],72:[function(require,module,exports){ +},{"browserify-aes/browser":59,"browserify-aes/modes":63,"browserify-des":73,"browserify-des/modes":74,"evp_bytestokey":420}],73:[function(require,module,exports){ (function (Buffer){ var CipherBase = require('cipher-base') var des = require('des.js') @@ -43245,7 +43848,7 @@ DES.prototype._final = function () { } }).call(this,require("buffer").Buffer) -},{"buffer":83,"cipher-base":84,"des.js":387,"inherits":428}],73:[function(require,module,exports){ +},{"buffer":84,"cipher-base":85,"des.js":388,"inherits":429}],74:[function(require,module,exports){ exports['des-ecb'] = { key: 8, iv: 0 @@ -43271,7 +43874,7 @@ exports['des-ede'] = { iv: 0 } -},{}],74:[function(require,module,exports){ +},{}],75:[function(require,module,exports){ (function (Buffer){ var bn = require('bn.js'); var randomBytes = require('randombytes'); @@ -43315,7 +43918,7 @@ function getr(priv) { } }).call(this,require("buffer").Buffer) -},{"bn.js":53,"buffer":83,"randombytes":449}],75:[function(require,module,exports){ +},{"bn.js":54,"buffer":84,"randombytes":450}],76:[function(require,module,exports){ (function (Buffer){ const Sha3 = require('js-sha3') @@ -43353,7 +43956,7 @@ module.exports = { } }).call(this,require("buffer").Buffer) -},{"buffer":83,"js-sha3":431}],76:[function(require,module,exports){ +},{"buffer":84,"js-sha3":432}],77:[function(require,module,exports){ (function (Buffer){ 'use strict' exports['RSA-SHA224'] = exports.sha224WithRSAEncryption = { @@ -43429,7 +44032,7 @@ exports['RSA-MD5'] = exports.md5WithRSAEncryption = { } }).call(this,require("buffer").Buffer) -},{"buffer":83}],77:[function(require,module,exports){ +},{"buffer":84}],78:[function(require,module,exports){ (function (Buffer){ var _algos = require('./algos') var createHash = require('create-hash') @@ -43536,7 +44139,7 @@ module.exports = { } }).call(this,require("buffer").Buffer) -},{"./algos":76,"./sign":79,"./verify":80,"buffer":83,"create-hash":382,"inherits":428,"stream":477}],78:[function(require,module,exports){ +},{"./algos":77,"./sign":80,"./verify":81,"buffer":84,"create-hash":383,"inherits":429,"stream":477}],79:[function(require,module,exports){ 'use strict' exports['1.3.132.0.10'] = 'secp256k1' @@ -43550,7 +44153,7 @@ exports['1.3.132.0.34'] = 'p384' exports['1.3.132.0.35'] = 'p521' -},{}],79:[function(require,module,exports){ +},{}],80:[function(require,module,exports){ (function (Buffer){ // much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js var createHmac = require('create-hmac') @@ -43739,7 +44342,7 @@ module.exports.getKey = getKey module.exports.makeKey = makeKey }).call(this,require("buffer").Buffer) -},{"./curves":78,"bn.js":53,"browserify-rsa":74,"buffer":83,"create-hmac":385,"elliptic":397,"parse-asn1":439}],80:[function(require,module,exports){ +},{"./curves":79,"bn.js":54,"browserify-rsa":75,"buffer":84,"create-hmac":386,"elliptic":398,"parse-asn1":440}],81:[function(require,module,exports){ (function (Buffer){ // much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js var curves = require('./curves') @@ -43846,7 +44449,7 @@ function checkValue (b, q) { module.exports = verify }).call(this,require("buffer").Buffer) -},{"./curves":78,"bn.js":53,"buffer":83,"elliptic":397,"parse-asn1":439}],81:[function(require,module,exports){ +},{"./curves":79,"bn.js":54,"buffer":84,"elliptic":398,"parse-asn1":440}],82:[function(require,module,exports){ (function (global){ 'use strict'; @@ -43958,7 +44561,7 @@ exports.allocUnsafeSlow = function allocUnsafeSlow(size) { } }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"buffer":83}],82:[function(require,module,exports){ +},{"buffer":84}],83:[function(require,module,exports){ (function (Buffer){ module.exports = function xor (a, b) { var length = Math.min(a.length, b.length) @@ -43972,7 +44575,7 @@ module.exports = function xor (a, b) { } }).call(this,require("buffer").Buffer) -},{"buffer":83}],83:[function(require,module,exports){ +},{"buffer":84}],84:[function(require,module,exports){ (function (global){ /*! * The buffer module from node.js, for the browser. @@ -45687,7 +46290,7 @@ function isnan (val) { } }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"base64-js":50,"ieee754":426,"isarray":430}],84:[function(require,module,exports){ +},{"base64-js":51,"ieee754":427,"isarray":431}],85:[function(require,module,exports){ (function (Buffer){ var Transform = require('stream').Transform var inherits = require('inherits') @@ -45781,21 +46384,21 @@ CipherBase.prototype._toString = function (value, enc, final) { } }).call(this,require("buffer").Buffer) -},{"buffer":83,"inherits":428,"stream":477,"string_decoder":478}],85:[function(require,module,exports){ +},{"buffer":84,"inherits":429,"stream":477,"string_decoder":478}],86:[function(require,module,exports){ require('../../modules/core.regexp.escape'); module.exports = require('../../modules/_core').RegExp.escape; -},{"../../modules/_core":106,"../../modules/core.regexp.escape":203}],86:[function(require,module,exports){ +},{"../../modules/_core":107,"../../modules/core.regexp.escape":204}],87:[function(require,module,exports){ module.exports = function(it){ if(typeof it != 'function')throw TypeError(it + ' is not a function!'); return it; }; -},{}],87:[function(require,module,exports){ +},{}],88:[function(require,module,exports){ var cof = require('./_cof'); module.exports = function(it, msg){ if(typeof it != 'number' && cof(it) != 'Number')throw TypeError(msg); return +it; }; -},{"./_cof":101}],88:[function(require,module,exports){ +},{"./_cof":102}],89:[function(require,module,exports){ // 22.1.3.31 Array.prototype[@@unscopables] var UNSCOPABLES = require('./_wks')('unscopables') , ArrayProto = Array.prototype; @@ -45803,19 +46406,19 @@ if(ArrayProto[UNSCOPABLES] == undefined)require('./_hide')(ArrayProto, UNSCOPABL module.exports = function(key){ ArrayProto[UNSCOPABLES][key] = true; }; -},{"./_hide":123,"./_wks":200}],89:[function(require,module,exports){ +},{"./_hide":124,"./_wks":201}],90:[function(require,module,exports){ module.exports = function(it, Constructor, name, forbiddenField){ if(!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)){ throw TypeError(name + ': incorrect invocation!'); } return it; }; -},{}],90:[function(require,module,exports){ +},{}],91:[function(require,module,exports){ var isObject = require('./_is-object'); module.exports = function(it){ if(!isObject(it))throw TypeError(it + ' is not an object!'); return it; }; -},{"./_is-object":132}],91:[function(require,module,exports){ +},{"./_is-object":133}],92:[function(require,module,exports){ // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) 'use strict'; var toObject = require('./_to-object') @@ -45842,7 +46445,7 @@ module.exports = [].copyWithin || function copyWithin(target/*= 0*/, start/*= 0, from += inc; } return O; }; -},{"./_to-index":188,"./_to-length":191,"./_to-object":192}],92:[function(require,module,exports){ +},{"./_to-index":189,"./_to-length":192,"./_to-object":193}],93:[function(require,module,exports){ // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) 'use strict'; var toObject = require('./_to-object') @@ -45858,7 +46461,7 @@ module.exports = function fill(value /*, start = 0, end = @length */){ while(endPos > index)O[index++] = value; return O; }; -},{"./_to-index":188,"./_to-length":191,"./_to-object":192}],93:[function(require,module,exports){ +},{"./_to-index":189,"./_to-length":192,"./_to-object":193}],94:[function(require,module,exports){ var forOf = require('./_for-of'); module.exports = function(iter, ITERATOR){ @@ -45867,7 +46470,7 @@ module.exports = function(iter, ITERATOR){ return result; }; -},{"./_for-of":120}],94:[function(require,module,exports){ +},{"./_for-of":121}],95:[function(require,module,exports){ // false -> Array#indexOf // true -> Array#includes var toIObject = require('./_to-iobject') @@ -45889,7 +46492,7 @@ module.exports = function(IS_INCLUDES){ } return !IS_INCLUDES && -1; }; }; -},{"./_to-index":188,"./_to-iobject":190,"./_to-length":191}],95:[function(require,module,exports){ +},{"./_to-index":189,"./_to-iobject":191,"./_to-length":192}],96:[function(require,module,exports){ // 0 -> Array#forEach // 1 -> Array#map // 2 -> Array#filter @@ -45934,7 +46537,7 @@ module.exports = function(TYPE, $create){ return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; }; }; -},{"./_array-species-create":98,"./_ctx":108,"./_iobject":128,"./_to-length":191,"./_to-object":192}],96:[function(require,module,exports){ +},{"./_array-species-create":99,"./_ctx":109,"./_iobject":129,"./_to-length":192,"./_to-object":193}],97:[function(require,module,exports){ var aFunction = require('./_a-function') , toObject = require('./_to-object') , IObject = require('./_iobject') @@ -45963,7 +46566,7 @@ module.exports = function(that, callbackfn, aLen, memo, isRight){ } return memo; }; -},{"./_a-function":86,"./_iobject":128,"./_to-length":191,"./_to-object":192}],97:[function(require,module,exports){ +},{"./_a-function":87,"./_iobject":129,"./_to-length":192,"./_to-object":193}],98:[function(require,module,exports){ var isObject = require('./_is-object') , isArray = require('./_is-array') , SPECIES = require('./_wks')('species'); @@ -45980,14 +46583,14 @@ module.exports = function(original){ } } return C === undefined ? Array : C; }; -},{"./_is-array":130,"./_is-object":132,"./_wks":200}],98:[function(require,module,exports){ +},{"./_is-array":131,"./_is-object":133,"./_wks":201}],99:[function(require,module,exports){ // 9.4.2.3 ArraySpeciesCreate(originalArray, length) var speciesConstructor = require('./_array-species-constructor'); module.exports = function(original, length){ return new (speciesConstructor(original))(length); }; -},{"./_array-species-constructor":97}],99:[function(require,module,exports){ +},{"./_array-species-constructor":98}],100:[function(require,module,exports){ 'use strict'; var aFunction = require('./_a-function') , isObject = require('./_is-object') @@ -46012,7 +46615,7 @@ module.exports = Function.bind || function bind(that /*, args... */){ if(isObject(fn.prototype))bound.prototype = fn.prototype; return bound; }; -},{"./_a-function":86,"./_invoke":127,"./_is-object":132}],100:[function(require,module,exports){ +},{"./_a-function":87,"./_invoke":128,"./_is-object":133}],101:[function(require,module,exports){ // getting tag from 19.1.3.6 Object.prototype.toString() var cof = require('./_cof') , TAG = require('./_wks')('toStringTag') @@ -46036,13 +46639,13 @@ module.exports = function(it){ // ES3 arguments fallback : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; }; -},{"./_cof":101,"./_wks":200}],101:[function(require,module,exports){ +},{"./_cof":102,"./_wks":201}],102:[function(require,module,exports){ var toString = {}.toString; module.exports = function(it){ return toString.call(it).slice(8, -1); }; -},{}],102:[function(require,module,exports){ +},{}],103:[function(require,module,exports){ 'use strict'; var dP = require('./_object-dp').f , create = require('./_object-create') @@ -46186,7 +46789,7 @@ module.exports = { setSpecies(NAME); } }; -},{"./_an-instance":89,"./_ctx":108,"./_defined":110,"./_descriptors":111,"./_for-of":120,"./_hide":123,"./_iter-define":136,"./_iter-step":138,"./_meta":145,"./_object-create":149,"./_object-dp":150,"./_redefine-all":169,"./_set-species":174}],103:[function(require,module,exports){ +},{"./_an-instance":90,"./_ctx":109,"./_defined":111,"./_descriptors":112,"./_for-of":121,"./_hide":124,"./_iter-define":137,"./_iter-step":139,"./_meta":146,"./_object-create":150,"./_object-dp":151,"./_redefine-all":170,"./_set-species":175}],104:[function(require,module,exports){ // https://github.com/DavidBruant/Map-Set.prototype.toJSON var classof = require('./_classof') , from = require('./_array-from-iterable'); @@ -46196,7 +46799,7 @@ module.exports = function(NAME){ return from(this); }; }; -},{"./_array-from-iterable":93,"./_classof":100}],104:[function(require,module,exports){ +},{"./_array-from-iterable":94,"./_classof":101}],105:[function(require,module,exports){ 'use strict'; var redefineAll = require('./_redefine-all') , getWeak = require('./_meta').getWeak @@ -46280,7 +46883,7 @@ module.exports = { }, ufstore: uncaughtFrozenStore }; -},{"./_an-instance":89,"./_an-object":90,"./_array-methods":95,"./_for-of":120,"./_has":122,"./_is-object":132,"./_meta":145,"./_redefine-all":169}],105:[function(require,module,exports){ +},{"./_an-instance":90,"./_an-object":91,"./_array-methods":96,"./_for-of":121,"./_has":123,"./_is-object":133,"./_meta":146,"./_redefine-all":170}],106:[function(require,module,exports){ 'use strict'; var global = require('./_global') , $export = require('./_export') @@ -46366,10 +46969,10 @@ module.exports = function(NAME, wrapper, methods, common, IS_MAP, IS_WEAK){ return C; }; -},{"./_an-instance":89,"./_export":115,"./_fails":117,"./_for-of":120,"./_global":121,"./_inherit-if-required":126,"./_is-object":132,"./_iter-detect":137,"./_meta":145,"./_redefine":170,"./_redefine-all":169,"./_set-to-string-tag":175}],106:[function(require,module,exports){ +},{"./_an-instance":90,"./_export":116,"./_fails":118,"./_for-of":121,"./_global":122,"./_inherit-if-required":127,"./_is-object":133,"./_iter-detect":138,"./_meta":146,"./_redefine":171,"./_redefine-all":170,"./_set-to-string-tag":176}],107:[function(require,module,exports){ var core = module.exports = {version: '2.4.0'}; if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef -},{}],107:[function(require,module,exports){ +},{}],108:[function(require,module,exports){ 'use strict'; var $defineProperty = require('./_object-dp') , createDesc = require('./_property-desc'); @@ -46378,7 +46981,7 @@ module.exports = function(object, index, value){ if(index in object)$defineProperty.f(object, index, createDesc(0, value)); else object[index] = value; }; -},{"./_object-dp":150,"./_property-desc":168}],108:[function(require,module,exports){ +},{"./_object-dp":151,"./_property-desc":169}],109:[function(require,module,exports){ // optional / simple context binding var aFunction = require('./_a-function'); module.exports = function(fn, that, length){ @@ -46399,7 +47002,7 @@ module.exports = function(fn, that, length){ return fn.apply(that, arguments); }; }; -},{"./_a-function":86}],109:[function(require,module,exports){ +},{"./_a-function":87}],110:[function(require,module,exports){ 'use strict'; var anObject = require('./_an-object') , toPrimitive = require('./_to-primitive') @@ -46409,18 +47012,18 @@ module.exports = function(hint){ if(hint !== 'string' && hint !== NUMBER && hint !== 'default')throw TypeError('Incorrect hint'); return toPrimitive(anObject(this), hint != NUMBER); }; -},{"./_an-object":90,"./_to-primitive":193}],110:[function(require,module,exports){ +},{"./_an-object":91,"./_to-primitive":194}],111:[function(require,module,exports){ // 7.2.1 RequireObjectCoercible(argument) module.exports = function(it){ if(it == undefined)throw TypeError("Can't call method on " + it); return it; }; -},{}],111:[function(require,module,exports){ +},{}],112:[function(require,module,exports){ // Thank's IE8 for his funny defineProperty module.exports = !require('./_fails')(function(){ return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7; }); -},{"./_fails":117}],112:[function(require,module,exports){ +},{"./_fails":118}],113:[function(require,module,exports){ var isObject = require('./_is-object') , document = require('./_global').document // in old IE typeof document.createElement is 'object' @@ -46428,12 +47031,12 @@ var isObject = require('./_is-object') module.exports = function(it){ return is ? document.createElement(it) : {}; }; -},{"./_global":121,"./_is-object":132}],113:[function(require,module,exports){ +},{"./_global":122,"./_is-object":133}],114:[function(require,module,exports){ // IE 8- don't enum bug keys module.exports = ( 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' ).split(','); -},{}],114:[function(require,module,exports){ +},{}],115:[function(require,module,exports){ // all enumerable object keys, includes symbols var getKeys = require('./_object-keys') , gOPS = require('./_object-gops') @@ -46449,7 +47052,7 @@ module.exports = function(it){ while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))result.push(key); } return result; }; -},{"./_object-gops":156,"./_object-keys":159,"./_object-pie":160}],115:[function(require,module,exports){ +},{"./_object-gops":157,"./_object-keys":160,"./_object-pie":161}],116:[function(require,module,exports){ var global = require('./_global') , core = require('./_core') , hide = require('./_hide') @@ -46493,7 +47096,7 @@ $export.W = 32; // wrap $export.U = 64; // safe $export.R = 128; // real proto method for `library` module.exports = $export; -},{"./_core":106,"./_ctx":108,"./_global":121,"./_hide":123,"./_redefine":170}],116:[function(require,module,exports){ +},{"./_core":107,"./_ctx":109,"./_global":122,"./_hide":124,"./_redefine":171}],117:[function(require,module,exports){ var MATCH = require('./_wks')('match'); module.exports = function(KEY){ var re = /./; @@ -46506,7 +47109,7 @@ module.exports = function(KEY){ } catch(f){ /* empty */ } } return true; }; -},{"./_wks":200}],117:[function(require,module,exports){ +},{"./_wks":201}],118:[function(require,module,exports){ module.exports = function(exec){ try { return !!exec(); @@ -46514,7 +47117,7 @@ module.exports = function(exec){ return true; } }; -},{}],118:[function(require,module,exports){ +},{}],119:[function(require,module,exports){ 'use strict'; var hide = require('./_hide') , redefine = require('./_redefine') @@ -46543,7 +47146,7 @@ module.exports = function(KEY, length, exec){ ); } }; -},{"./_defined":110,"./_fails":117,"./_hide":123,"./_redefine":170,"./_wks":200}],119:[function(require,module,exports){ +},{"./_defined":111,"./_fails":118,"./_hide":124,"./_redefine":171,"./_wks":201}],120:[function(require,module,exports){ 'use strict'; // 21.2.5.3 get RegExp.prototype.flags var anObject = require('./_an-object'); @@ -46557,7 +47160,7 @@ module.exports = function(){ if(that.sticky) result += 'y'; return result; }; -},{"./_an-object":90}],120:[function(require,module,exports){ +},{"./_an-object":91}],121:[function(require,module,exports){ var ctx = require('./_ctx') , call = require('./_iter-call') , isArrayIter = require('./_is-array-iter') @@ -46583,17 +47186,17 @@ var exports = module.exports = function(iterable, entries, fn, that, ITERATOR){ }; exports.BREAK = BREAK; exports.RETURN = RETURN; -},{"./_an-object":90,"./_ctx":108,"./_is-array-iter":129,"./_iter-call":134,"./_to-length":191,"./core.get-iterator-method":201}],121:[function(require,module,exports){ +},{"./_an-object":91,"./_ctx":109,"./_is-array-iter":130,"./_iter-call":135,"./_to-length":192,"./core.get-iterator-method":202}],122:[function(require,module,exports){ // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 var global = module.exports = typeof window != 'undefined' && window.Math == Math ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')(); if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef -},{}],122:[function(require,module,exports){ +},{}],123:[function(require,module,exports){ var hasOwnProperty = {}.hasOwnProperty; module.exports = function(it, key){ return hasOwnProperty.call(it, key); }; -},{}],123:[function(require,module,exports){ +},{}],124:[function(require,module,exports){ var dP = require('./_object-dp') , createDesc = require('./_property-desc'); module.exports = require('./_descriptors') ? function(object, key, value){ @@ -46602,13 +47205,13 @@ module.exports = require('./_descriptors') ? function(object, key, value){ object[key] = value; return object; }; -},{"./_descriptors":111,"./_object-dp":150,"./_property-desc":168}],124:[function(require,module,exports){ +},{"./_descriptors":112,"./_object-dp":151,"./_property-desc":169}],125:[function(require,module,exports){ module.exports = require('./_global').document && document.documentElement; -},{"./_global":121}],125:[function(require,module,exports){ +},{"./_global":122}],126:[function(require,module,exports){ module.exports = !require('./_descriptors') && !require('./_fails')(function(){ return Object.defineProperty(require('./_dom-create')('div'), 'a', {get: function(){ return 7; }}).a != 7; }); -},{"./_descriptors":111,"./_dom-create":112,"./_fails":117}],126:[function(require,module,exports){ +},{"./_descriptors":112,"./_dom-create":113,"./_fails":118}],127:[function(require,module,exports){ var isObject = require('./_is-object') , setPrototypeOf = require('./_set-proto').set; module.exports = function(that, target, C){ @@ -46617,7 +47220,7 @@ module.exports = function(that, target, C){ setPrototypeOf(that, P); } return that; }; -},{"./_is-object":132,"./_set-proto":173}],127:[function(require,module,exports){ +},{"./_is-object":133,"./_set-proto":174}],128:[function(require,module,exports){ // fast apply, http://jsperf.lnkit.com/fast-apply/5 module.exports = function(fn, args, that){ var un = that === undefined; @@ -46634,13 +47237,13 @@ module.exports = function(fn, args, that){ : fn.call(that, args[0], args[1], args[2], args[3]); } return fn.apply(that, args); }; -},{}],128:[function(require,module,exports){ +},{}],129:[function(require,module,exports){ // fallback for non-array-like ES3 and non-enumerable old V8 strings var cof = require('./_cof'); module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){ return cof(it) == 'String' ? it.split('') : Object(it); }; -},{"./_cof":101}],129:[function(require,module,exports){ +},{"./_cof":102}],130:[function(require,module,exports){ // check on default Array iterator var Iterators = require('./_iterators') , ITERATOR = require('./_wks')('iterator') @@ -46649,24 +47252,24 @@ var Iterators = require('./_iterators') module.exports = function(it){ return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); }; -},{"./_iterators":139,"./_wks":200}],130:[function(require,module,exports){ +},{"./_iterators":140,"./_wks":201}],131:[function(require,module,exports){ // 7.2.2 IsArray(argument) var cof = require('./_cof'); module.exports = Array.isArray || function isArray(arg){ return cof(arg) == 'Array'; }; -},{"./_cof":101}],131:[function(require,module,exports){ +},{"./_cof":102}],132:[function(require,module,exports){ // 20.1.2.3 Number.isInteger(number) var isObject = require('./_is-object') , floor = Math.floor; module.exports = function isInteger(it){ return !isObject(it) && isFinite(it) && floor(it) === it; }; -},{"./_is-object":132}],132:[function(require,module,exports){ +},{"./_is-object":133}],133:[function(require,module,exports){ module.exports = function(it){ return typeof it === 'object' ? it !== null : typeof it === 'function'; }; -},{}],133:[function(require,module,exports){ +},{}],134:[function(require,module,exports){ // 7.2.8 IsRegExp(argument) var isObject = require('./_is-object') , cof = require('./_cof') @@ -46675,7 +47278,7 @@ module.exports = function(it){ var isRegExp; return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp'); }; -},{"./_cof":101,"./_is-object":132,"./_wks":200}],134:[function(require,module,exports){ +},{"./_cof":102,"./_is-object":133,"./_wks":201}],135:[function(require,module,exports){ // call something on iterator step with safe closing on error var anObject = require('./_an-object'); module.exports = function(iterator, fn, value, entries){ @@ -46688,7 +47291,7 @@ module.exports = function(iterator, fn, value, entries){ throw e; } }; -},{"./_an-object":90}],135:[function(require,module,exports){ +},{"./_an-object":91}],136:[function(require,module,exports){ 'use strict'; var create = require('./_object-create') , descriptor = require('./_property-desc') @@ -46702,7 +47305,7 @@ module.exports = function(Constructor, NAME, next){ Constructor.prototype = create(IteratorPrototype, {next: descriptor(1, next)}); setToStringTag(Constructor, NAME + ' Iterator'); }; -},{"./_hide":123,"./_object-create":149,"./_property-desc":168,"./_set-to-string-tag":175,"./_wks":200}],136:[function(require,module,exports){ +},{"./_hide":124,"./_object-create":150,"./_property-desc":169,"./_set-to-string-tag":176,"./_wks":201}],137:[function(require,module,exports){ 'use strict'; var LIBRARY = require('./_library') , $export = require('./_export') @@ -46773,7 +47376,7 @@ module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED } return methods; }; -},{"./_export":115,"./_has":122,"./_hide":123,"./_iter-create":135,"./_iterators":139,"./_library":141,"./_object-gpo":157,"./_redefine":170,"./_set-to-string-tag":175,"./_wks":200}],137:[function(require,module,exports){ +},{"./_export":116,"./_has":123,"./_hide":124,"./_iter-create":136,"./_iterators":140,"./_library":142,"./_object-gpo":158,"./_redefine":171,"./_set-to-string-tag":176,"./_wks":201}],138:[function(require,module,exports){ var ITERATOR = require('./_wks')('iterator') , SAFE_CLOSING = false; @@ -46795,13 +47398,13 @@ module.exports = function(exec, skipClosing){ } catch(e){ /* empty */ } return safe; }; -},{"./_wks":200}],138:[function(require,module,exports){ +},{"./_wks":201}],139:[function(require,module,exports){ module.exports = function(done, value){ return {value: value, done: !!done}; }; -},{}],139:[function(require,module,exports){ -module.exports = {}; },{}],140:[function(require,module,exports){ +module.exports = {}; +},{}],141:[function(require,module,exports){ var getKeys = require('./_object-keys') , toIObject = require('./_to-iobject'); module.exports = function(object, el){ @@ -46812,9 +47415,9 @@ module.exports = function(object, el){ , key; while(length > index)if(O[key = keys[index++]] === el)return key; }; -},{"./_object-keys":159,"./_to-iobject":190}],141:[function(require,module,exports){ +},{"./_object-keys":160,"./_to-iobject":191}],142:[function(require,module,exports){ module.exports = false; -},{}],142:[function(require,module,exports){ +},{}],143:[function(require,module,exports){ // 20.2.2.14 Math.expm1(x) var $expm1 = Math.expm1; module.exports = (!$expm1 @@ -46825,17 +47428,17 @@ module.exports = (!$expm1 ) ? function expm1(x){ return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1; } : $expm1; -},{}],143:[function(require,module,exports){ +},{}],144:[function(require,module,exports){ // 20.2.2.20 Math.log1p(x) module.exports = Math.log1p || function log1p(x){ return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x); }; -},{}],144:[function(require,module,exports){ +},{}],145:[function(require,module,exports){ // 20.2.2.28 Math.sign(x) module.exports = Math.sign || function sign(x){ return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; }; -},{}],145:[function(require,module,exports){ +},{}],146:[function(require,module,exports){ var META = require('./_uid')('meta') , isObject = require('./_is-object') , has = require('./_has') @@ -46889,7 +47492,7 @@ var meta = module.exports = { getWeak: getWeak, onFreeze: onFreeze }; -},{"./_fails":117,"./_has":122,"./_is-object":132,"./_object-dp":150,"./_uid":197}],146:[function(require,module,exports){ +},{"./_fails":118,"./_has":123,"./_is-object":133,"./_object-dp":151,"./_uid":198}],147:[function(require,module,exports){ var Map = require('./es6.map') , $export = require('./_export') , shared = require('./_shared')('metadata') @@ -46941,7 +47544,7 @@ module.exports = { key: toMetaKey, exp: exp }; -},{"./_export":115,"./_shared":177,"./es6.map":233,"./es6.weak-map":339}],147:[function(require,module,exports){ +},{"./_export":116,"./_shared":178,"./es6.map":234,"./es6.weak-map":340}],148:[function(require,module,exports){ var global = require('./_global') , macrotask = require('./_task').set , Observer = global.MutationObserver || global.WebKitMutationObserver @@ -47010,7 +47613,7 @@ module.exports = function(){ } last = task; }; }; -},{"./_cof":101,"./_global":121,"./_task":187}],148:[function(require,module,exports){ +},{"./_cof":102,"./_global":122,"./_task":188}],149:[function(require,module,exports){ 'use strict'; // 19.1.2.1 Object.assign(target, source, ...) var getKeys = require('./_object-keys') @@ -47044,7 +47647,7 @@ module.exports = !$assign || require('./_fails')(function(){ while(length > j)if(isEnum.call(S, key = keys[j++]))T[key] = S[key]; } return T; } : $assign; -},{"./_fails":117,"./_iobject":128,"./_object-gops":156,"./_object-keys":159,"./_object-pie":160,"./_to-object":192}],149:[function(require,module,exports){ +},{"./_fails":118,"./_iobject":129,"./_object-gops":157,"./_object-keys":160,"./_object-pie":161,"./_to-object":193}],150:[function(require,module,exports){ // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) var anObject = require('./_an-object') , dPs = require('./_object-dps') @@ -47085,7 +47688,7 @@ module.exports = Object.create || function create(O, Properties){ } else result = createDict(); return Properties === undefined ? result : dPs(result, Properties); }; -},{"./_an-object":90,"./_dom-create":112,"./_enum-bug-keys":113,"./_html":124,"./_object-dps":151,"./_shared-key":176}],150:[function(require,module,exports){ +},{"./_an-object":91,"./_dom-create":113,"./_enum-bug-keys":114,"./_html":125,"./_object-dps":152,"./_shared-key":177}],151:[function(require,module,exports){ var anObject = require('./_an-object') , IE8_DOM_DEFINE = require('./_ie8-dom-define') , toPrimitive = require('./_to-primitive') @@ -47102,7 +47705,7 @@ exports.f = require('./_descriptors') ? Object.defineProperty : function defineP if('value' in Attributes)O[P] = Attributes.value; return O; }; -},{"./_an-object":90,"./_descriptors":111,"./_ie8-dom-define":125,"./_to-primitive":193}],151:[function(require,module,exports){ +},{"./_an-object":91,"./_descriptors":112,"./_ie8-dom-define":126,"./_to-primitive":194}],152:[function(require,module,exports){ var dP = require('./_object-dp') , anObject = require('./_an-object') , getKeys = require('./_object-keys'); @@ -47116,7 +47719,7 @@ module.exports = require('./_descriptors') ? Object.defineProperties : function while(length > i)dP.f(O, P = keys[i++], Properties[P]); return O; }; -},{"./_an-object":90,"./_descriptors":111,"./_object-dp":150,"./_object-keys":159}],152:[function(require,module,exports){ +},{"./_an-object":91,"./_descriptors":112,"./_object-dp":151,"./_object-keys":160}],153:[function(require,module,exports){ // Forced replacement prototype accessors methods module.exports = require('./_library')|| !require('./_fails')(function(){ var K = Math.random(); @@ -47124,7 +47727,7 @@ module.exports = require('./_library')|| !require('./_fails')(function(){ __defineSetter__.call(null, K, function(){ /* empty */}); delete require('./_global')[K]; }); -},{"./_fails":117,"./_global":121,"./_library":141}],153:[function(require,module,exports){ +},{"./_fails":118,"./_global":122,"./_library":142}],154:[function(require,module,exports){ var pIE = require('./_object-pie') , createDesc = require('./_property-desc') , toIObject = require('./_to-iobject') @@ -47141,7 +47744,7 @@ exports.f = require('./_descriptors') ? gOPD : function getOwnPropertyDescriptor } catch(e){ /* empty */ } if(has(O, P))return createDesc(!pIE.f.call(O, P), O[P]); }; -},{"./_descriptors":111,"./_has":122,"./_ie8-dom-define":125,"./_object-pie":160,"./_property-desc":168,"./_to-iobject":190,"./_to-primitive":193}],154:[function(require,module,exports){ +},{"./_descriptors":112,"./_has":123,"./_ie8-dom-define":126,"./_object-pie":161,"./_property-desc":169,"./_to-iobject":191,"./_to-primitive":194}],155:[function(require,module,exports){ // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window var toIObject = require('./_to-iobject') , gOPN = require('./_object-gopn').f @@ -47162,7 +47765,7 @@ module.exports.f = function getOwnPropertyNames(it){ return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it)); }; -},{"./_object-gopn":155,"./_to-iobject":190}],155:[function(require,module,exports){ +},{"./_object-gopn":156,"./_to-iobject":191}],156:[function(require,module,exports){ // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) var $keys = require('./_object-keys-internal') , hiddenKeys = require('./_enum-bug-keys').concat('length', 'prototype'); @@ -47170,9 +47773,9 @@ var $keys = require('./_object-keys-internal') exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O){ return $keys(O, hiddenKeys); }; -},{"./_enum-bug-keys":113,"./_object-keys-internal":158}],156:[function(require,module,exports){ +},{"./_enum-bug-keys":114,"./_object-keys-internal":159}],157:[function(require,module,exports){ exports.f = Object.getOwnPropertySymbols; -},{}],157:[function(require,module,exports){ +},{}],158:[function(require,module,exports){ // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) var has = require('./_has') , toObject = require('./_to-object') @@ -47186,7 +47789,7 @@ module.exports = Object.getPrototypeOf || function(O){ return O.constructor.prototype; } return O instanceof Object ? ObjectProto : null; }; -},{"./_has":122,"./_shared-key":176,"./_to-object":192}],158:[function(require,module,exports){ +},{"./_has":123,"./_shared-key":177,"./_to-object":193}],159:[function(require,module,exports){ var has = require('./_has') , toIObject = require('./_to-iobject') , arrayIndexOf = require('./_array-includes')(false) @@ -47204,7 +47807,7 @@ module.exports = function(object, names){ } return result; }; -},{"./_array-includes":94,"./_has":122,"./_shared-key":176,"./_to-iobject":190}],159:[function(require,module,exports){ +},{"./_array-includes":95,"./_has":123,"./_shared-key":177,"./_to-iobject":191}],160:[function(require,module,exports){ // 19.1.2.14 / 15.2.3.14 Object.keys(O) var $keys = require('./_object-keys-internal') , enumBugKeys = require('./_enum-bug-keys'); @@ -47212,9 +47815,9 @@ var $keys = require('./_object-keys-internal') module.exports = Object.keys || function keys(O){ return $keys(O, enumBugKeys); }; -},{"./_enum-bug-keys":113,"./_object-keys-internal":158}],160:[function(require,module,exports){ +},{"./_enum-bug-keys":114,"./_object-keys-internal":159}],161:[function(require,module,exports){ exports.f = {}.propertyIsEnumerable; -},{}],161:[function(require,module,exports){ +},{}],162:[function(require,module,exports){ // most Object methods by ES6 should accept primitives var $export = require('./_export') , core = require('./_core') @@ -47225,7 +47828,7 @@ module.exports = function(KEY, exec){ exp[KEY] = exec(fn); $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp); }; -},{"./_core":106,"./_export":115,"./_fails":117}],162:[function(require,module,exports){ +},{"./_core":107,"./_export":116,"./_fails":118}],163:[function(require,module,exports){ var getKeys = require('./_object-keys') , toIObject = require('./_to-iobject') , isEnum = require('./_object-pie').f; @@ -47242,7 +47845,7 @@ module.exports = function(isEntries){ } return result; }; }; -},{"./_object-keys":159,"./_object-pie":160,"./_to-iobject":190}],163:[function(require,module,exports){ +},{"./_object-keys":160,"./_object-pie":161,"./_to-iobject":191}],164:[function(require,module,exports){ // all object keys, includes non-enumerable and symbols var gOPN = require('./_object-gopn') , gOPS = require('./_object-gops') @@ -47253,7 +47856,7 @@ module.exports = Reflect && Reflect.ownKeys || function ownKeys(it){ , getSymbols = gOPS.f; return getSymbols ? keys.concat(getSymbols(it)) : keys; }; -},{"./_an-object":90,"./_global":121,"./_object-gopn":155,"./_object-gops":156}],164:[function(require,module,exports){ +},{"./_an-object":91,"./_global":122,"./_object-gopn":156,"./_object-gops":157}],165:[function(require,module,exports){ var $parseFloat = require('./_global').parseFloat , $trim = require('./_string-trim').trim; @@ -47262,7 +47865,7 @@ module.exports = 1 / $parseFloat(require('./_string-ws') + '-0') !== -Infinity ? , result = $parseFloat(string); return result === 0 && string.charAt(0) == '-' ? -0 : result; } : $parseFloat; -},{"./_global":121,"./_string-trim":185,"./_string-ws":186}],165:[function(require,module,exports){ +},{"./_global":122,"./_string-trim":186,"./_string-ws":187}],166:[function(require,module,exports){ var $parseInt = require('./_global').parseInt , $trim = require('./_string-trim').trim , ws = require('./_string-ws') @@ -47272,7 +47875,7 @@ module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? f var string = $trim(String(str), 3); return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10)); } : $parseInt; -},{"./_global":121,"./_string-trim":185,"./_string-ws":186}],166:[function(require,module,exports){ +},{"./_global":122,"./_string-trim":186,"./_string-ws":187}],167:[function(require,module,exports){ 'use strict'; var path = require('./_path') , invoke = require('./_invoke') @@ -47296,9 +47899,9 @@ module.exports = function(/* ...pargs */){ return invoke(fn, args, that); }; }; -},{"./_a-function":86,"./_invoke":127,"./_path":167}],167:[function(require,module,exports){ +},{"./_a-function":87,"./_invoke":128,"./_path":168}],168:[function(require,module,exports){ module.exports = require('./_global'); -},{"./_global":121}],168:[function(require,module,exports){ +},{"./_global":122}],169:[function(require,module,exports){ module.exports = function(bitmap, value){ return { enumerable : !(bitmap & 1), @@ -47307,13 +47910,13 @@ module.exports = function(bitmap, value){ value : value }; }; -},{}],169:[function(require,module,exports){ +},{}],170:[function(require,module,exports){ var redefine = require('./_redefine'); module.exports = function(target, src, safe){ for(var key in src)redefine(target, key, src[key], safe); return target; }; -},{"./_redefine":170}],170:[function(require,module,exports){ +},{"./_redefine":171}],171:[function(require,module,exports){ var global = require('./_global') , hide = require('./_hide') , has = require('./_has') @@ -47346,7 +47949,7 @@ require('./_core').inspectSource = function(it){ })(Function.prototype, TO_STRING, function toString(){ return typeof this == 'function' && this[SRC] || $toString.call(this); }); -},{"./_core":106,"./_global":121,"./_has":122,"./_hide":123,"./_uid":197}],171:[function(require,module,exports){ +},{"./_core":107,"./_global":122,"./_has":123,"./_hide":124,"./_uid":198}],172:[function(require,module,exports){ module.exports = function(regExp, replace){ var replacer = replace === Object(replace) ? function(part){ return replace[part]; @@ -47355,12 +47958,12 @@ module.exports = function(regExp, replace){ return String(it).replace(regExp, replacer); }; }; -},{}],172:[function(require,module,exports){ +},{}],173:[function(require,module,exports){ // 7.2.9 SameValue(x, y) module.exports = Object.is || function is(x, y){ return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; }; -},{}],173:[function(require,module,exports){ +},{}],174:[function(require,module,exports){ // Works with __proto__ only. Old v8 can't work with null proto objects. /* eslint-disable no-proto */ var isObject = require('./_is-object') @@ -47386,7 +47989,7 @@ module.exports = { }({}, false) : undefined), check: check }; -},{"./_an-object":90,"./_ctx":108,"./_is-object":132,"./_object-gopd":153}],174:[function(require,module,exports){ +},{"./_an-object":91,"./_ctx":109,"./_is-object":133,"./_object-gopd":154}],175:[function(require,module,exports){ 'use strict'; var global = require('./_global') , dP = require('./_object-dp') @@ -47400,7 +48003,7 @@ module.exports = function(KEY){ get: function(){ return this; } }); }; -},{"./_descriptors":111,"./_global":121,"./_object-dp":150,"./_wks":200}],175:[function(require,module,exports){ +},{"./_descriptors":112,"./_global":122,"./_object-dp":151,"./_wks":201}],176:[function(require,module,exports){ var def = require('./_object-dp').f , has = require('./_has') , TAG = require('./_wks')('toStringTag'); @@ -47408,20 +48011,20 @@ var def = require('./_object-dp').f module.exports = function(it, tag, stat){ if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag}); }; -},{"./_has":122,"./_object-dp":150,"./_wks":200}],176:[function(require,module,exports){ +},{"./_has":123,"./_object-dp":151,"./_wks":201}],177:[function(require,module,exports){ var shared = require('./_shared')('keys') , uid = require('./_uid'); module.exports = function(key){ return shared[key] || (shared[key] = uid(key)); }; -},{"./_shared":177,"./_uid":197}],177:[function(require,module,exports){ +},{"./_shared":178,"./_uid":198}],178:[function(require,module,exports){ var global = require('./_global') , SHARED = '__core-js_shared__' , store = global[SHARED] || (global[SHARED] = {}); module.exports = function(key){ return store[key] || (store[key] = {}); }; -},{"./_global":121}],178:[function(require,module,exports){ +},{"./_global":122}],179:[function(require,module,exports){ // 7.3.20 SpeciesConstructor(O, defaultConstructor) var anObject = require('./_an-object') , aFunction = require('./_a-function') @@ -47430,7 +48033,7 @@ module.exports = function(O, D){ var C = anObject(O).constructor, S; return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); }; -},{"./_a-function":86,"./_an-object":90,"./_wks":200}],179:[function(require,module,exports){ +},{"./_a-function":87,"./_an-object":91,"./_wks":201}],180:[function(require,module,exports){ var fails = require('./_fails'); module.exports = function(method, arg){ @@ -47438,7 +48041,7 @@ module.exports = function(method, arg){ arg ? method.call(null, function(){}, 1) : method.call(null); }); }; -},{"./_fails":117}],180:[function(require,module,exports){ +},{"./_fails":118}],181:[function(require,module,exports){ var toInteger = require('./_to-integer') , defined = require('./_defined'); // true -> String#at @@ -47456,7 +48059,7 @@ module.exports = function(TO_STRING){ : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; }; }; -},{"./_defined":110,"./_to-integer":189}],181:[function(require,module,exports){ +},{"./_defined":111,"./_to-integer":190}],182:[function(require,module,exports){ // helper for String#{startsWith, endsWith, includes} var isRegExp = require('./_is-regexp') , defined = require('./_defined'); @@ -47465,7 +48068,7 @@ module.exports = function(that, searchString, NAME){ if(isRegExp(searchString))throw TypeError('String#' + NAME + " doesn't accept regex!"); return String(defined(that)); }; -},{"./_defined":110,"./_is-regexp":133}],182:[function(require,module,exports){ +},{"./_defined":111,"./_is-regexp":134}],183:[function(require,module,exports){ var $export = require('./_export') , fails = require('./_fails') , defined = require('./_defined') @@ -47485,7 +48088,7 @@ module.exports = function(NAME, exec){ return test !== test.toLowerCase() || test.split('"').length > 3; }), 'String', O); }; -},{"./_defined":110,"./_export":115,"./_fails":117}],183:[function(require,module,exports){ +},{"./_defined":111,"./_export":116,"./_fails":118}],184:[function(require,module,exports){ // https://github.com/tc39/proposal-string-pad-start-end var toLength = require('./_to-length') , repeat = require('./_string-repeat') @@ -47503,7 +48106,7 @@ module.exports = function(that, maxLength, fillString, left){ return left ? stringFiller + S : S + stringFiller; }; -},{"./_defined":110,"./_string-repeat":184,"./_to-length":191}],184:[function(require,module,exports){ +},{"./_defined":111,"./_string-repeat":185,"./_to-length":192}],185:[function(require,module,exports){ 'use strict'; var toInteger = require('./_to-integer') , defined = require('./_defined'); @@ -47516,7 +48119,7 @@ module.exports = function repeat(count){ for(;n > 0; (n >>>= 1) && (str += str))if(n & 1)res += str; return res; }; -},{"./_defined":110,"./_to-integer":189}],185:[function(require,module,exports){ +},{"./_defined":111,"./_to-integer":190}],186:[function(require,module,exports){ var $export = require('./_export') , defined = require('./_defined') , fails = require('./_fails') @@ -47547,10 +48150,10 @@ var trim = exporter.trim = function(string, TYPE){ }; module.exports = exporter; -},{"./_defined":110,"./_export":115,"./_fails":117,"./_string-ws":186}],186:[function(require,module,exports){ +},{"./_defined":111,"./_export":116,"./_fails":118,"./_string-ws":187}],187:[function(require,module,exports){ module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; -},{}],187:[function(require,module,exports){ +},{}],188:[function(require,module,exports){ var ctx = require('./_ctx') , invoke = require('./_invoke') , html = require('./_html') @@ -47626,7 +48229,7 @@ module.exports = { set: setTask, clear: clearTask }; -},{"./_cof":101,"./_ctx":108,"./_dom-create":112,"./_global":121,"./_html":124,"./_invoke":127}],188:[function(require,module,exports){ +},{"./_cof":102,"./_ctx":109,"./_dom-create":113,"./_global":122,"./_html":125,"./_invoke":128}],189:[function(require,module,exports){ var toInteger = require('./_to-integer') , max = Math.max , min = Math.min; @@ -47634,34 +48237,34 @@ module.exports = function(index, length){ index = toInteger(index); return index < 0 ? max(index + length, 0) : min(index, length); }; -},{"./_to-integer":189}],189:[function(require,module,exports){ +},{"./_to-integer":190}],190:[function(require,module,exports){ // 7.1.4 ToInteger var ceil = Math.ceil , floor = Math.floor; module.exports = function(it){ return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); }; -},{}],190:[function(require,module,exports){ +},{}],191:[function(require,module,exports){ // to indexed object, toObject with fallback for non-array-like ES3 strings var IObject = require('./_iobject') , defined = require('./_defined'); module.exports = function(it){ return IObject(defined(it)); }; -},{"./_defined":110,"./_iobject":128}],191:[function(require,module,exports){ +},{"./_defined":111,"./_iobject":129}],192:[function(require,module,exports){ // 7.1.15 ToLength var toInteger = require('./_to-integer') , min = Math.min; module.exports = function(it){ return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 }; -},{"./_to-integer":189}],192:[function(require,module,exports){ +},{"./_to-integer":190}],193:[function(require,module,exports){ // 7.1.13 ToObject(argument) var defined = require('./_defined'); module.exports = function(it){ return Object(defined(it)); }; -},{"./_defined":110}],193:[function(require,module,exports){ +},{"./_defined":111}],194:[function(require,module,exports){ // 7.1.1 ToPrimitive(input [, PreferredType]) var isObject = require('./_is-object'); // instead of the ES6 spec version, we didn't implement @@toPrimitive case @@ -47674,7 +48277,7 @@ module.exports = function(it, S){ if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; throw TypeError("Can't convert object to primitive value"); }; -},{"./_is-object":132}],194:[function(require,module,exports){ +},{"./_is-object":133}],195:[function(require,module,exports){ 'use strict'; if(require('./_descriptors')){ var LIBRARY = require('./_library') @@ -48156,7 +48759,7 @@ if(require('./_descriptors')){ if(!LIBRARY && !CORRECT_ITER_NAME)hide(TypedArrayPrototype, ITERATOR, $iterator); }; } else module.exports = function(){ /* empty */ }; -},{"./_an-instance":89,"./_array-copy-within":91,"./_array-fill":92,"./_array-includes":94,"./_array-methods":95,"./_classof":100,"./_ctx":108,"./_descriptors":111,"./_export":115,"./_fails":117,"./_global":121,"./_has":122,"./_hide":123,"./_is-array-iter":129,"./_is-integer":131,"./_is-object":132,"./_iter-detect":137,"./_iterators":139,"./_library":141,"./_object-create":149,"./_object-dp":150,"./_object-gopd":153,"./_object-gopn":155,"./_object-gpo":157,"./_property-desc":168,"./_redefine-all":169,"./_same-value":172,"./_set-species":174,"./_species-constructor":178,"./_to-index":188,"./_to-integer":189,"./_to-length":191,"./_to-object":192,"./_to-primitive":193,"./_typed":196,"./_typed-buffer":195,"./_uid":197,"./_wks":200,"./core.get-iterator-method":201,"./core.is-iterable":202,"./es6.array.iterator":214}],195:[function(require,module,exports){ +},{"./_an-instance":90,"./_array-copy-within":92,"./_array-fill":93,"./_array-includes":95,"./_array-methods":96,"./_classof":101,"./_ctx":109,"./_descriptors":112,"./_export":116,"./_fails":118,"./_global":122,"./_has":123,"./_hide":124,"./_is-array-iter":130,"./_is-integer":132,"./_is-object":133,"./_iter-detect":138,"./_iterators":140,"./_library":142,"./_object-create":150,"./_object-dp":151,"./_object-gopd":154,"./_object-gopn":156,"./_object-gpo":158,"./_property-desc":169,"./_redefine-all":170,"./_same-value":173,"./_set-species":175,"./_species-constructor":179,"./_to-index":189,"./_to-integer":190,"./_to-length":192,"./_to-object":193,"./_to-primitive":194,"./_typed":197,"./_typed-buffer":196,"./_uid":198,"./_wks":201,"./core.get-iterator-method":202,"./core.is-iterable":203,"./es6.array.iterator":215}],196:[function(require,module,exports){ 'use strict'; var global = require('./_global') , DESCRIPTORS = require('./_descriptors') @@ -48432,7 +49035,7 @@ setToStringTag($DataView, DATA_VIEW); hide($DataView[PROTOTYPE], $typed.VIEW, true); exports[ARRAY_BUFFER] = $ArrayBuffer; exports[DATA_VIEW] = $DataView; -},{"./_an-instance":89,"./_array-fill":92,"./_descriptors":111,"./_fails":117,"./_global":121,"./_hide":123,"./_library":141,"./_object-dp":150,"./_object-gopn":155,"./_redefine-all":169,"./_set-to-string-tag":175,"./_to-integer":189,"./_to-length":191,"./_typed":196}],196:[function(require,module,exports){ +},{"./_an-instance":90,"./_array-fill":93,"./_descriptors":112,"./_fails":118,"./_global":122,"./_hide":124,"./_library":142,"./_object-dp":151,"./_object-gopn":156,"./_redefine-all":170,"./_set-to-string-tag":176,"./_to-integer":190,"./_to-length":192,"./_typed":197}],197:[function(require,module,exports){ var global = require('./_global') , hide = require('./_hide') , uid = require('./_uid') @@ -48459,13 +49062,13 @@ module.exports = { TYPED: TYPED, VIEW: VIEW }; -},{"./_global":121,"./_hide":123,"./_uid":197}],197:[function(require,module,exports){ +},{"./_global":122,"./_hide":124,"./_uid":198}],198:[function(require,module,exports){ var id = 0 , px = Math.random(); module.exports = function(key){ return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); }; -},{}],198:[function(require,module,exports){ +},{}],199:[function(require,module,exports){ var global = require('./_global') , core = require('./_core') , LIBRARY = require('./_library') @@ -48475,9 +49078,9 @@ module.exports = function(name){ var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); if(name.charAt(0) != '_' && !(name in $Symbol))defineProperty($Symbol, name, {value: wksExt.f(name)}); }; -},{"./_core":106,"./_global":121,"./_library":141,"./_object-dp":150,"./_wks-ext":199}],199:[function(require,module,exports){ +},{"./_core":107,"./_global":122,"./_library":142,"./_object-dp":151,"./_wks-ext":200}],200:[function(require,module,exports){ exports.f = require('./_wks'); -},{"./_wks":200}],200:[function(require,module,exports){ +},{"./_wks":201}],201:[function(require,module,exports){ var store = require('./_shared')('wks') , uid = require('./_uid') , Symbol = require('./_global').Symbol @@ -48489,7 +49092,7 @@ var $exports = module.exports = function(name){ }; $exports.store = store; -},{"./_global":121,"./_shared":177,"./_uid":197}],201:[function(require,module,exports){ +},{"./_global":122,"./_shared":178,"./_uid":198}],202:[function(require,module,exports){ var classof = require('./_classof') , ITERATOR = require('./_wks')('iterator') , Iterators = require('./_iterators'); @@ -48498,7 +49101,7 @@ module.exports = require('./_core').getIteratorMethod = function(it){ || it['@@iterator'] || Iterators[classof(it)]; }; -},{"./_classof":100,"./_core":106,"./_iterators":139,"./_wks":200}],202:[function(require,module,exports){ +},{"./_classof":101,"./_core":107,"./_iterators":140,"./_wks":201}],203:[function(require,module,exports){ var classof = require('./_classof') , ITERATOR = require('./_wks')('iterator') , Iterators = require('./_iterators'); @@ -48508,21 +49111,21 @@ module.exports = require('./_core').isIterable = function(it){ || '@@iterator' in O || Iterators.hasOwnProperty(classof(O)); }; -},{"./_classof":100,"./_core":106,"./_iterators":139,"./_wks":200}],203:[function(require,module,exports){ +},{"./_classof":101,"./_core":107,"./_iterators":140,"./_wks":201}],204:[function(require,module,exports){ // https://github.com/benjamingr/RexExp.escape var $export = require('./_export') , $re = require('./_replacer')(/[\\^$*+?.()|[\]{}]/g, '\\$&'); $export($export.S, 'RegExp', {escape: function escape(it){ return $re(it); }}); -},{"./_export":115,"./_replacer":171}],204:[function(require,module,exports){ +},{"./_export":116,"./_replacer":172}],205:[function(require,module,exports){ // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) var $export = require('./_export'); $export($export.P, 'Array', {copyWithin: require('./_array-copy-within')}); require('./_add-to-unscopables')('copyWithin'); -},{"./_add-to-unscopables":88,"./_array-copy-within":91,"./_export":115}],205:[function(require,module,exports){ +},{"./_add-to-unscopables":89,"./_array-copy-within":92,"./_export":116}],206:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $every = require('./_array-methods')(4); @@ -48533,14 +49136,14 @@ $export($export.P + $export.F * !require('./_strict-method')([].every, true), 'A return $every(this, callbackfn, arguments[1]); } }); -},{"./_array-methods":95,"./_export":115,"./_strict-method":179}],206:[function(require,module,exports){ +},{"./_array-methods":96,"./_export":116,"./_strict-method":180}],207:[function(require,module,exports){ // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) var $export = require('./_export'); $export($export.P, 'Array', {fill: require('./_array-fill')}); require('./_add-to-unscopables')('fill'); -},{"./_add-to-unscopables":88,"./_array-fill":92,"./_export":115}],207:[function(require,module,exports){ +},{"./_add-to-unscopables":89,"./_array-fill":93,"./_export":116}],208:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $filter = require('./_array-methods')(2); @@ -48551,7 +49154,7 @@ $export($export.P + $export.F * !require('./_strict-method')([].filter, true), ' return $filter(this, callbackfn, arguments[1]); } }); -},{"./_array-methods":95,"./_export":115,"./_strict-method":179}],208:[function(require,module,exports){ +},{"./_array-methods":96,"./_export":116,"./_strict-method":180}],209:[function(require,module,exports){ 'use strict'; // 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined) var $export = require('./_export') @@ -48566,7 +49169,7 @@ $export($export.P + $export.F * forced, 'Array', { } }); require('./_add-to-unscopables')(KEY); -},{"./_add-to-unscopables":88,"./_array-methods":95,"./_export":115}],209:[function(require,module,exports){ +},{"./_add-to-unscopables":89,"./_array-methods":96,"./_export":116}],210:[function(require,module,exports){ 'use strict'; // 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined) var $export = require('./_export') @@ -48581,7 +49184,7 @@ $export($export.P + $export.F * forced, 'Array', { } }); require('./_add-to-unscopables')(KEY); -},{"./_add-to-unscopables":88,"./_array-methods":95,"./_export":115}],210:[function(require,module,exports){ +},{"./_add-to-unscopables":89,"./_array-methods":96,"./_export":116}],211:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $forEach = require('./_array-methods')(0) @@ -48593,7 +49196,7 @@ $export($export.P + $export.F * !STRICT, 'Array', { return $forEach(this, callbackfn, arguments[1]); } }); -},{"./_array-methods":95,"./_export":115,"./_strict-method":179}],211:[function(require,module,exports){ +},{"./_array-methods":96,"./_export":116,"./_strict-method":180}],212:[function(require,module,exports){ 'use strict'; var ctx = require('./_ctx') , $export = require('./_export') @@ -48632,7 +49235,7 @@ $export($export.S + $export.F * !require('./_iter-detect')(function(iter){ Array } }); -},{"./_create-property":107,"./_ctx":108,"./_export":115,"./_is-array-iter":129,"./_iter-call":134,"./_iter-detect":137,"./_to-length":191,"./_to-object":192,"./core.get-iterator-method":201}],212:[function(require,module,exports){ +},{"./_create-property":108,"./_ctx":109,"./_export":116,"./_is-array-iter":130,"./_iter-call":135,"./_iter-detect":138,"./_to-length":192,"./_to-object":193,"./core.get-iterator-method":202}],213:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $indexOf = require('./_array-includes')(false) @@ -48648,12 +49251,12 @@ $export($export.P + $export.F * (NEGATIVE_ZERO || !require('./_strict-method')($ : $indexOf(this, searchElement, arguments[1]); } }); -},{"./_array-includes":94,"./_export":115,"./_strict-method":179}],213:[function(require,module,exports){ +},{"./_array-includes":95,"./_export":116,"./_strict-method":180}],214:[function(require,module,exports){ // 22.1.2.2 / 15.4.3.2 Array.isArray(arg) var $export = require('./_export'); $export($export.S, 'Array', {isArray: require('./_is-array')}); -},{"./_export":115,"./_is-array":130}],214:[function(require,module,exports){ +},{"./_export":116,"./_is-array":131}],215:[function(require,module,exports){ 'use strict'; var addToUnscopables = require('./_add-to-unscopables') , step = require('./_iter-step') @@ -48688,7 +49291,7 @@ Iterators.Arguments = Iterators.Array; addToUnscopables('keys'); addToUnscopables('values'); addToUnscopables('entries'); -},{"./_add-to-unscopables":88,"./_iter-define":136,"./_iter-step":138,"./_iterators":139,"./_to-iobject":190}],215:[function(require,module,exports){ +},{"./_add-to-unscopables":89,"./_iter-define":137,"./_iter-step":139,"./_iterators":140,"./_to-iobject":191}],216:[function(require,module,exports){ 'use strict'; // 22.1.3.13 Array.prototype.join(separator) var $export = require('./_export') @@ -48701,7 +49304,7 @@ $export($export.P + $export.F * (require('./_iobject') != Object || !require('./ return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator); } }); -},{"./_export":115,"./_iobject":128,"./_strict-method":179,"./_to-iobject":190}],216:[function(require,module,exports){ +},{"./_export":116,"./_iobject":129,"./_strict-method":180,"./_to-iobject":191}],217:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , toIObject = require('./_to-iobject') @@ -48724,7 +49327,7 @@ $export($export.P + $export.F * (NEGATIVE_ZERO || !require('./_strict-method')($ return -1; } }); -},{"./_export":115,"./_strict-method":179,"./_to-integer":189,"./_to-iobject":190,"./_to-length":191}],217:[function(require,module,exports){ +},{"./_export":116,"./_strict-method":180,"./_to-integer":190,"./_to-iobject":191,"./_to-length":192}],218:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $map = require('./_array-methods')(1); @@ -48735,7 +49338,7 @@ $export($export.P + $export.F * !require('./_strict-method')([].map, true), 'Arr return $map(this, callbackfn, arguments[1]); } }); -},{"./_array-methods":95,"./_export":115,"./_strict-method":179}],218:[function(require,module,exports){ +},{"./_array-methods":96,"./_export":116,"./_strict-method":180}],219:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , createProperty = require('./_create-property'); @@ -48755,7 +49358,7 @@ $export($export.S + $export.F * require('./_fails')(function(){ return result; } }); -},{"./_create-property":107,"./_export":115,"./_fails":117}],219:[function(require,module,exports){ +},{"./_create-property":108,"./_export":116,"./_fails":118}],220:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $reduce = require('./_array-reduce'); @@ -48766,7 +49369,7 @@ $export($export.P + $export.F * !require('./_strict-method')([].reduceRight, tru return $reduce(this, callbackfn, arguments.length, arguments[1], true); } }); -},{"./_array-reduce":96,"./_export":115,"./_strict-method":179}],220:[function(require,module,exports){ +},{"./_array-reduce":97,"./_export":116,"./_strict-method":180}],221:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $reduce = require('./_array-reduce'); @@ -48777,7 +49380,7 @@ $export($export.P + $export.F * !require('./_strict-method')([].reduce, true), ' return $reduce(this, callbackfn, arguments.length, arguments[1], false); } }); -},{"./_array-reduce":96,"./_export":115,"./_strict-method":179}],221:[function(require,module,exports){ +},{"./_array-reduce":97,"./_export":116,"./_strict-method":180}],222:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , html = require('./_html') @@ -48806,7 +49409,7 @@ $export($export.P + $export.F * require('./_fails')(function(){ return cloned; } }); -},{"./_cof":101,"./_export":115,"./_fails":117,"./_html":124,"./_to-index":188,"./_to-length":191}],222:[function(require,module,exports){ +},{"./_cof":102,"./_export":116,"./_fails":118,"./_html":125,"./_to-index":189,"./_to-length":192}],223:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $some = require('./_array-methods')(3); @@ -48817,7 +49420,7 @@ $export($export.P + $export.F * !require('./_strict-method')([].some, true), 'Ar return $some(this, callbackfn, arguments[1]); } }); -},{"./_array-methods":95,"./_export":115,"./_strict-method":179}],223:[function(require,module,exports){ +},{"./_array-methods":96,"./_export":116,"./_strict-method":180}],224:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , aFunction = require('./_a-function') @@ -48841,14 +49444,14 @@ $export($export.P + $export.F * (fails(function(){ : $sort.call(toObject(this), aFunction(comparefn)); } }); -},{"./_a-function":86,"./_export":115,"./_fails":117,"./_strict-method":179,"./_to-object":192}],224:[function(require,module,exports){ +},{"./_a-function":87,"./_export":116,"./_fails":118,"./_strict-method":180,"./_to-object":193}],225:[function(require,module,exports){ require('./_set-species')('Array'); -},{"./_set-species":174}],225:[function(require,module,exports){ +},{"./_set-species":175}],226:[function(require,module,exports){ // 20.3.3.1 / 15.9.4.4 Date.now() var $export = require('./_export'); $export($export.S, 'Date', {now: function(){ return new Date().getTime(); }}); -},{"./_export":115}],226:[function(require,module,exports){ +},{"./_export":116}],227:[function(require,module,exports){ 'use strict'; // 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() var $export = require('./_export') @@ -48877,7 +49480,7 @@ $export($export.P + $export.F * (fails(function(){ ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z'; } }); -},{"./_export":115,"./_fails":117}],227:[function(require,module,exports){ +},{"./_export":116,"./_fails":118}],228:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , toObject = require('./_to-object') @@ -48892,12 +49495,12 @@ $export($export.P + $export.F * require('./_fails')(function(){ return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString(); } }); -},{"./_export":115,"./_fails":117,"./_to-object":192,"./_to-primitive":193}],228:[function(require,module,exports){ +},{"./_export":116,"./_fails":118,"./_to-object":193,"./_to-primitive":194}],229:[function(require,module,exports){ var TO_PRIMITIVE = require('./_wks')('toPrimitive') , proto = Date.prototype; if(!(TO_PRIMITIVE in proto))require('./_hide')(proto, TO_PRIMITIVE, require('./_date-to-primitive')); -},{"./_date-to-primitive":109,"./_hide":123,"./_wks":200}],229:[function(require,module,exports){ +},{"./_date-to-primitive":110,"./_hide":124,"./_wks":201}],230:[function(require,module,exports){ var DateProto = Date.prototype , INVALID_DATE = 'Invalid Date' , TO_STRING = 'toString' @@ -48909,12 +49512,12 @@ if(new Date(NaN) + '' != INVALID_DATE){ return value === value ? $toString.call(this) : INVALID_DATE; }); } -},{"./_redefine":170}],230:[function(require,module,exports){ +},{"./_redefine":171}],231:[function(require,module,exports){ // 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...) var $export = require('./_export'); $export($export.P, 'Function', {bind: require('./_bind')}); -},{"./_bind":99,"./_export":115}],231:[function(require,module,exports){ +},{"./_bind":100,"./_export":116}],232:[function(require,module,exports){ 'use strict'; var isObject = require('./_is-object') , getPrototypeOf = require('./_object-gpo') @@ -48928,7 +49531,7 @@ if(!(HAS_INSTANCE in FunctionProto))require('./_object-dp').f(FunctionProto, HAS while(O = getPrototypeOf(O))if(this.prototype === O)return true; return false; }}); -},{"./_is-object":132,"./_object-dp":150,"./_object-gpo":157,"./_wks":200}],232:[function(require,module,exports){ +},{"./_is-object":133,"./_object-dp":151,"./_object-gpo":158,"./_wks":201}],233:[function(require,module,exports){ var dP = require('./_object-dp').f , createDesc = require('./_property-desc') , has = require('./_has') @@ -48954,7 +49557,7 @@ NAME in FProto || require('./_descriptors') && dP(FProto, NAME, { } } }); -},{"./_descriptors":111,"./_has":122,"./_object-dp":150,"./_property-desc":168}],233:[function(require,module,exports){ +},{"./_descriptors":112,"./_has":123,"./_object-dp":151,"./_property-desc":169}],234:[function(require,module,exports){ 'use strict'; var strong = require('./_collection-strong'); @@ -48972,7 +49575,7 @@ module.exports = require('./_collection')('Map', function(get){ return strong.def(this, key === 0 ? 0 : key, value); } }, strong, true); -},{"./_collection":105,"./_collection-strong":102}],234:[function(require,module,exports){ +},{"./_collection":106,"./_collection-strong":103}],235:[function(require,module,exports){ // 20.2.2.3 Math.acosh(x) var $export = require('./_export') , log1p = require('./_math-log1p') @@ -48991,7 +49594,7 @@ $export($export.S + $export.F * !($acosh : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1)); } }); -},{"./_export":115,"./_math-log1p":143}],235:[function(require,module,exports){ +},{"./_export":116,"./_math-log1p":144}],236:[function(require,module,exports){ // 20.2.2.5 Math.asinh(x) var $export = require('./_export') , $asinh = Math.asinh; @@ -49002,7 +49605,7 @@ function asinh(x){ // Tor Browser bug: Math.asinh(0) -> -0 $export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', {asinh: asinh}); -},{"./_export":115}],236:[function(require,module,exports){ +},{"./_export":116}],237:[function(require,module,exports){ // 20.2.2.7 Math.atanh(x) var $export = require('./_export') , $atanh = Math.atanh; @@ -49013,7 +49616,7 @@ $export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', { return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2; } }); -},{"./_export":115}],237:[function(require,module,exports){ +},{"./_export":116}],238:[function(require,module,exports){ // 20.2.2.9 Math.cbrt(x) var $export = require('./_export') , sign = require('./_math-sign'); @@ -49023,7 +49626,7 @@ $export($export.S, 'Math', { return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3); } }); -},{"./_export":115,"./_math-sign":144}],238:[function(require,module,exports){ +},{"./_export":116,"./_math-sign":145}],239:[function(require,module,exports){ // 20.2.2.11 Math.clz32(x) var $export = require('./_export'); @@ -49032,7 +49635,7 @@ $export($export.S, 'Math', { return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32; } }); -},{"./_export":115}],239:[function(require,module,exports){ +},{"./_export":116}],240:[function(require,module,exports){ // 20.2.2.12 Math.cosh(x) var $export = require('./_export') , exp = Math.exp; @@ -49042,13 +49645,13 @@ $export($export.S, 'Math', { return (exp(x = +x) + exp(-x)) / 2; } }); -},{"./_export":115}],240:[function(require,module,exports){ +},{"./_export":116}],241:[function(require,module,exports){ // 20.2.2.14 Math.expm1(x) var $export = require('./_export') , $expm1 = require('./_math-expm1'); $export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', {expm1: $expm1}); -},{"./_export":115,"./_math-expm1":142}],241:[function(require,module,exports){ +},{"./_export":116,"./_math-expm1":143}],242:[function(require,module,exports){ // 20.2.2.16 Math.fround(x) var $export = require('./_export') , sign = require('./_math-sign') @@ -49075,7 +49678,7 @@ $export($export.S, 'Math', { return $sign * result; } }); -},{"./_export":115,"./_math-sign":144}],242:[function(require,module,exports){ +},{"./_export":116,"./_math-sign":145}],243:[function(require,module,exports){ // 20.2.2.17 Math.hypot([value1[, value2[, … ]]]) var $export = require('./_export') , abs = Math.abs; @@ -49101,7 +49704,7 @@ $export($export.S, 'Math', { return larg === Infinity ? Infinity : larg * Math.sqrt(sum); } }); -},{"./_export":115}],243:[function(require,module,exports){ +},{"./_export":116}],244:[function(require,module,exports){ // 20.2.2.18 Math.imul(x, y) var $export = require('./_export') , $imul = Math.imul; @@ -49119,7 +49722,7 @@ $export($export.S + $export.F * require('./_fails')(function(){ return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0); } }); -},{"./_export":115,"./_fails":117}],244:[function(require,module,exports){ +},{"./_export":116,"./_fails":118}],245:[function(require,module,exports){ // 20.2.2.21 Math.log10(x) var $export = require('./_export'); @@ -49128,12 +49731,12 @@ $export($export.S, 'Math', { return Math.log(x) / Math.LN10; } }); -},{"./_export":115}],245:[function(require,module,exports){ +},{"./_export":116}],246:[function(require,module,exports){ // 20.2.2.20 Math.log1p(x) var $export = require('./_export'); $export($export.S, 'Math', {log1p: require('./_math-log1p')}); -},{"./_export":115,"./_math-log1p":143}],246:[function(require,module,exports){ +},{"./_export":116,"./_math-log1p":144}],247:[function(require,module,exports){ // 20.2.2.22 Math.log2(x) var $export = require('./_export'); @@ -49142,12 +49745,12 @@ $export($export.S, 'Math', { return Math.log(x) / Math.LN2; } }); -},{"./_export":115}],247:[function(require,module,exports){ +},{"./_export":116}],248:[function(require,module,exports){ // 20.2.2.28 Math.sign(x) var $export = require('./_export'); $export($export.S, 'Math', {sign: require('./_math-sign')}); -},{"./_export":115,"./_math-sign":144}],248:[function(require,module,exports){ +},{"./_export":116,"./_math-sign":145}],249:[function(require,module,exports){ // 20.2.2.30 Math.sinh(x) var $export = require('./_export') , expm1 = require('./_math-expm1') @@ -49163,7 +49766,7 @@ $export($export.S + $export.F * require('./_fails')(function(){ : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2); } }); -},{"./_export":115,"./_fails":117,"./_math-expm1":142}],249:[function(require,module,exports){ +},{"./_export":116,"./_fails":118,"./_math-expm1":143}],250:[function(require,module,exports){ // 20.2.2.33 Math.tanh(x) var $export = require('./_export') , expm1 = require('./_math-expm1') @@ -49176,7 +49779,7 @@ $export($export.S, 'Math', { return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x)); } }); -},{"./_export":115,"./_math-expm1":142}],250:[function(require,module,exports){ +},{"./_export":116,"./_math-expm1":143}],251:[function(require,module,exports){ // 20.2.2.34 Math.trunc(x) var $export = require('./_export'); @@ -49185,7 +49788,7 @@ $export($export.S, 'Math', { return (it > 0 ? Math.floor : Math.ceil)(it); } }); -},{"./_export":115}],251:[function(require,module,exports){ +},{"./_export":116}],252:[function(require,module,exports){ 'use strict'; var global = require('./_global') , has = require('./_has') @@ -49255,12 +49858,12 @@ if(!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')){ proto.constructor = $Number; require('./_redefine')(global, NUMBER, $Number); } -},{"./_cof":101,"./_descriptors":111,"./_fails":117,"./_global":121,"./_has":122,"./_inherit-if-required":126,"./_object-create":149,"./_object-dp":150,"./_object-gopd":153,"./_object-gopn":155,"./_redefine":170,"./_string-trim":185,"./_to-primitive":193}],252:[function(require,module,exports){ +},{"./_cof":102,"./_descriptors":112,"./_fails":118,"./_global":122,"./_has":123,"./_inherit-if-required":127,"./_object-create":150,"./_object-dp":151,"./_object-gopd":154,"./_object-gopn":156,"./_redefine":171,"./_string-trim":186,"./_to-primitive":194}],253:[function(require,module,exports){ // 20.1.2.1 Number.EPSILON var $export = require('./_export'); $export($export.S, 'Number', {EPSILON: Math.pow(2, -52)}); -},{"./_export":115}],253:[function(require,module,exports){ +},{"./_export":116}],254:[function(require,module,exports){ // 20.1.2.2 Number.isFinite(number) var $export = require('./_export') , _isFinite = require('./_global').isFinite; @@ -49270,12 +49873,12 @@ $export($export.S, 'Number', { return typeof it == 'number' && _isFinite(it); } }); -},{"./_export":115,"./_global":121}],254:[function(require,module,exports){ +},{"./_export":116,"./_global":122}],255:[function(require,module,exports){ // 20.1.2.3 Number.isInteger(number) var $export = require('./_export'); $export($export.S, 'Number', {isInteger: require('./_is-integer')}); -},{"./_export":115,"./_is-integer":131}],255:[function(require,module,exports){ +},{"./_export":116,"./_is-integer":132}],256:[function(require,module,exports){ // 20.1.2.4 Number.isNaN(number) var $export = require('./_export'); @@ -49284,7 +49887,7 @@ $export($export.S, 'Number', { return number != number; } }); -},{"./_export":115}],256:[function(require,module,exports){ +},{"./_export":116}],257:[function(require,module,exports){ // 20.1.2.5 Number.isSafeInteger(number) var $export = require('./_export') , isInteger = require('./_is-integer') @@ -49295,27 +49898,27 @@ $export($export.S, 'Number', { return isInteger(number) && abs(number) <= 0x1fffffffffffff; } }); -},{"./_export":115,"./_is-integer":131}],257:[function(require,module,exports){ +},{"./_export":116,"./_is-integer":132}],258:[function(require,module,exports){ // 20.1.2.6 Number.MAX_SAFE_INTEGER var $export = require('./_export'); $export($export.S, 'Number', {MAX_SAFE_INTEGER: 0x1fffffffffffff}); -},{"./_export":115}],258:[function(require,module,exports){ +},{"./_export":116}],259:[function(require,module,exports){ // 20.1.2.10 Number.MIN_SAFE_INTEGER var $export = require('./_export'); $export($export.S, 'Number', {MIN_SAFE_INTEGER: -0x1fffffffffffff}); -},{"./_export":115}],259:[function(require,module,exports){ +},{"./_export":116}],260:[function(require,module,exports){ var $export = require('./_export') , $parseFloat = require('./_parse-float'); // 20.1.2.12 Number.parseFloat(string) $export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', {parseFloat: $parseFloat}); -},{"./_export":115,"./_parse-float":164}],260:[function(require,module,exports){ +},{"./_export":116,"./_parse-float":165}],261:[function(require,module,exports){ var $export = require('./_export') , $parseInt = require('./_parse-int'); // 20.1.2.13 Number.parseInt(string, radix) $export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', {parseInt: $parseInt}); -},{"./_export":115,"./_parse-int":165}],261:[function(require,module,exports){ +},{"./_export":116,"./_parse-int":166}],262:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , anInstance = require('./_an-instance') @@ -49430,7 +50033,7 @@ $export($export.P + $export.F * (!!$toFixed && ( } return m; } }); -},{"./_a-number-value":87,"./_an-instance":89,"./_export":115,"./_fails":117,"./_string-repeat":184,"./_to-integer":189}],262:[function(require,module,exports){ +},{"./_a-number-value":88,"./_an-instance":90,"./_export":116,"./_fails":118,"./_string-repeat":185,"./_to-integer":190}],263:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $fails = require('./_fails') @@ -49449,24 +50052,24 @@ $export($export.P + $export.F * ($fails(function(){ return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision); } }); -},{"./_a-number-value":87,"./_export":115,"./_fails":117}],263:[function(require,module,exports){ +},{"./_a-number-value":88,"./_export":116,"./_fails":118}],264:[function(require,module,exports){ // 19.1.3.1 Object.assign(target, source) var $export = require('./_export'); $export($export.S + $export.F, 'Object', {assign: require('./_object-assign')}); -},{"./_export":115,"./_object-assign":148}],264:[function(require,module,exports){ +},{"./_export":116,"./_object-assign":149}],265:[function(require,module,exports){ var $export = require('./_export') // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) $export($export.S, 'Object', {create: require('./_object-create')}); -},{"./_export":115,"./_object-create":149}],265:[function(require,module,exports){ +},{"./_export":116,"./_object-create":150}],266:[function(require,module,exports){ var $export = require('./_export'); // 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) $export($export.S + $export.F * !require('./_descriptors'), 'Object', {defineProperties: require('./_object-dps')}); -},{"./_descriptors":111,"./_export":115,"./_object-dps":151}],266:[function(require,module,exports){ +},{"./_descriptors":112,"./_export":116,"./_object-dps":152}],267:[function(require,module,exports){ var $export = require('./_export'); // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) $export($export.S + $export.F * !require('./_descriptors'), 'Object', {defineProperty: require('./_object-dp').f}); -},{"./_descriptors":111,"./_export":115,"./_object-dp":150}],267:[function(require,module,exports){ +},{"./_descriptors":112,"./_export":116,"./_object-dp":151}],268:[function(require,module,exports){ // 19.1.2.5 Object.freeze(O) var isObject = require('./_is-object') , meta = require('./_meta').onFreeze; @@ -49476,7 +50079,7 @@ require('./_object-sap')('freeze', function($freeze){ return $freeze && isObject(it) ? $freeze(meta(it)) : it; }; }); -},{"./_is-object":132,"./_meta":145,"./_object-sap":161}],268:[function(require,module,exports){ +},{"./_is-object":133,"./_meta":146,"./_object-sap":162}],269:[function(require,module,exports){ // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) var toIObject = require('./_to-iobject') , $getOwnPropertyDescriptor = require('./_object-gopd').f; @@ -49486,12 +50089,12 @@ require('./_object-sap')('getOwnPropertyDescriptor', function(){ return $getOwnPropertyDescriptor(toIObject(it), key); }; }); -},{"./_object-gopd":153,"./_object-sap":161,"./_to-iobject":190}],269:[function(require,module,exports){ +},{"./_object-gopd":154,"./_object-sap":162,"./_to-iobject":191}],270:[function(require,module,exports){ // 19.1.2.7 Object.getOwnPropertyNames(O) require('./_object-sap')('getOwnPropertyNames', function(){ return require('./_object-gopn-ext').f; }); -},{"./_object-gopn-ext":154,"./_object-sap":161}],270:[function(require,module,exports){ +},{"./_object-gopn-ext":155,"./_object-sap":162}],271:[function(require,module,exports){ // 19.1.2.9 Object.getPrototypeOf(O) var toObject = require('./_to-object') , $getPrototypeOf = require('./_object-gpo'); @@ -49501,7 +50104,7 @@ require('./_object-sap')('getPrototypeOf', function(){ return $getPrototypeOf(toObject(it)); }; }); -},{"./_object-gpo":157,"./_object-sap":161,"./_to-object":192}],271:[function(require,module,exports){ +},{"./_object-gpo":158,"./_object-sap":162,"./_to-object":193}],272:[function(require,module,exports){ // 19.1.2.11 Object.isExtensible(O) var isObject = require('./_is-object'); @@ -49510,7 +50113,7 @@ require('./_object-sap')('isExtensible', function($isExtensible){ return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false; }; }); -},{"./_is-object":132,"./_object-sap":161}],272:[function(require,module,exports){ +},{"./_is-object":133,"./_object-sap":162}],273:[function(require,module,exports){ // 19.1.2.12 Object.isFrozen(O) var isObject = require('./_is-object'); @@ -49519,7 +50122,7 @@ require('./_object-sap')('isFrozen', function($isFrozen){ return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true; }; }); -},{"./_is-object":132,"./_object-sap":161}],273:[function(require,module,exports){ +},{"./_is-object":133,"./_object-sap":162}],274:[function(require,module,exports){ // 19.1.2.13 Object.isSealed(O) var isObject = require('./_is-object'); @@ -49528,11 +50131,11 @@ require('./_object-sap')('isSealed', function($isSealed){ return isObject(it) ? $isSealed ? $isSealed(it) : false : true; }; }); -},{"./_is-object":132,"./_object-sap":161}],274:[function(require,module,exports){ +},{"./_is-object":133,"./_object-sap":162}],275:[function(require,module,exports){ // 19.1.3.10 Object.is(value1, value2) var $export = require('./_export'); $export($export.S, 'Object', {is: require('./_same-value')}); -},{"./_export":115,"./_same-value":172}],275:[function(require,module,exports){ +},{"./_export":116,"./_same-value":173}],276:[function(require,module,exports){ // 19.1.2.14 Object.keys(O) var toObject = require('./_to-object') , $keys = require('./_object-keys'); @@ -49542,7 +50145,7 @@ require('./_object-sap')('keys', function(){ return $keys(toObject(it)); }; }); -},{"./_object-keys":159,"./_object-sap":161,"./_to-object":192}],276:[function(require,module,exports){ +},{"./_object-keys":160,"./_object-sap":162,"./_to-object":193}],277:[function(require,module,exports){ // 19.1.2.15 Object.preventExtensions(O) var isObject = require('./_is-object') , meta = require('./_meta').onFreeze; @@ -49552,7 +50155,7 @@ require('./_object-sap')('preventExtensions', function($preventExtensions){ return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it; }; }); -},{"./_is-object":132,"./_meta":145,"./_object-sap":161}],277:[function(require,module,exports){ +},{"./_is-object":133,"./_meta":146,"./_object-sap":162}],278:[function(require,module,exports){ // 19.1.2.17 Object.seal(O) var isObject = require('./_is-object') , meta = require('./_meta').onFreeze; @@ -49562,11 +50165,11 @@ require('./_object-sap')('seal', function($seal){ return $seal && isObject(it) ? $seal(meta(it)) : it; }; }); -},{"./_is-object":132,"./_meta":145,"./_object-sap":161}],278:[function(require,module,exports){ +},{"./_is-object":133,"./_meta":146,"./_object-sap":162}],279:[function(require,module,exports){ // 19.1.3.19 Object.setPrototypeOf(O, proto) var $export = require('./_export'); $export($export.S, 'Object', {setPrototypeOf: require('./_set-proto').set}); -},{"./_export":115,"./_set-proto":173}],279:[function(require,module,exports){ +},{"./_export":116,"./_set-proto":174}],280:[function(require,module,exports){ 'use strict'; // 19.1.3.6 Object.prototype.toString() var classof = require('./_classof') @@ -49577,17 +50180,17 @@ if(test + '' != '[object z]'){ return '[object ' + classof(this) + ']'; }, true); } -},{"./_classof":100,"./_redefine":170,"./_wks":200}],280:[function(require,module,exports){ +},{"./_classof":101,"./_redefine":171,"./_wks":201}],281:[function(require,module,exports){ var $export = require('./_export') , $parseFloat = require('./_parse-float'); // 18.2.4 parseFloat(string) $export($export.G + $export.F * (parseFloat != $parseFloat), {parseFloat: $parseFloat}); -},{"./_export":115,"./_parse-float":164}],281:[function(require,module,exports){ +},{"./_export":116,"./_parse-float":165}],282:[function(require,module,exports){ var $export = require('./_export') , $parseInt = require('./_parse-int'); // 18.2.5 parseInt(string, radix) $export($export.G + $export.F * (parseInt != $parseInt), {parseInt: $parseInt}); -},{"./_export":115,"./_parse-int":165}],282:[function(require,module,exports){ +},{"./_export":116,"./_parse-int":166}],283:[function(require,module,exports){ 'use strict'; var LIBRARY = require('./_library') , global = require('./_global') @@ -49889,7 +50492,7 @@ $export($export.S + $export.F * !(USE_NATIVE && require('./_iter-detect')(functi return capability.promise; } }); -},{"./_a-function":86,"./_an-instance":89,"./_an-object":90,"./_classof":100,"./_core":106,"./_ctx":108,"./_export":115,"./_for-of":120,"./_global":121,"./_is-object":132,"./_iter-detect":137,"./_library":141,"./_microtask":147,"./_redefine-all":169,"./_set-proto":173,"./_set-species":174,"./_set-to-string-tag":175,"./_species-constructor":178,"./_task":187,"./_wks":200}],283:[function(require,module,exports){ +},{"./_a-function":87,"./_an-instance":90,"./_an-object":91,"./_classof":101,"./_core":107,"./_ctx":109,"./_export":116,"./_for-of":121,"./_global":122,"./_is-object":133,"./_iter-detect":138,"./_library":142,"./_microtask":148,"./_redefine-all":170,"./_set-proto":174,"./_set-species":175,"./_set-to-string-tag":176,"./_species-constructor":179,"./_task":188,"./_wks":201}],284:[function(require,module,exports){ // 26.1.1 Reflect.apply(target, thisArgument, argumentsList) var $export = require('./_export') , aFunction = require('./_a-function') @@ -49901,7 +50504,7 @@ $export($export.S, 'Reflect', { return _apply.call(aFunction(target), thisArgument, anObject(argumentsList)); } }); -},{"./_a-function":86,"./_an-object":90,"./_export":115}],284:[function(require,module,exports){ +},{"./_a-function":87,"./_an-object":91,"./_export":116}],285:[function(require,module,exports){ // 26.1.2 Reflect.construct(target, argumentsList [, newTarget]) var $export = require('./_export') , create = require('./_object-create') @@ -49941,7 +50544,7 @@ $export($export.S + $export.F * require('./_fails')(function(){ return isObject(result) ? result : instance; } }); -},{"./_a-function":86,"./_an-object":90,"./_bind":99,"./_export":115,"./_fails":117,"./_is-object":132,"./_object-create":149}],285:[function(require,module,exports){ +},{"./_a-function":87,"./_an-object":91,"./_bind":100,"./_export":116,"./_fails":118,"./_is-object":133,"./_object-create":150}],286:[function(require,module,exports){ // 26.1.3 Reflect.defineProperty(target, propertyKey, attributes) var dP = require('./_object-dp') , $export = require('./_export') @@ -49964,7 +50567,7 @@ $export($export.S + $export.F * require('./_fails')(function(){ } } }); -},{"./_an-object":90,"./_export":115,"./_fails":117,"./_object-dp":150,"./_to-primitive":193}],286:[function(require,module,exports){ +},{"./_an-object":91,"./_export":116,"./_fails":118,"./_object-dp":151,"./_to-primitive":194}],287:[function(require,module,exports){ // 26.1.4 Reflect.deleteProperty(target, propertyKey) var $export = require('./_export') , gOPD = require('./_object-gopd').f @@ -49976,7 +50579,7 @@ $export($export.S, 'Reflect', { return desc && !desc.configurable ? false : delete target[propertyKey]; } }); -},{"./_an-object":90,"./_export":115,"./_object-gopd":153}],287:[function(require,module,exports){ +},{"./_an-object":91,"./_export":116,"./_object-gopd":154}],288:[function(require,module,exports){ 'use strict'; // 26.1.5 Reflect.enumerate(target) var $export = require('./_export') @@ -50003,7 +50606,7 @@ $export($export.S, 'Reflect', { return new Enumerate(target); } }); -},{"./_an-object":90,"./_export":115,"./_iter-create":135}],288:[function(require,module,exports){ +},{"./_an-object":91,"./_export":116,"./_iter-create":136}],289:[function(require,module,exports){ // 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey) var gOPD = require('./_object-gopd') , $export = require('./_export') @@ -50014,7 +50617,7 @@ $export($export.S, 'Reflect', { return gOPD.f(anObject(target), propertyKey); } }); -},{"./_an-object":90,"./_export":115,"./_object-gopd":153}],289:[function(require,module,exports){ +},{"./_an-object":91,"./_export":116,"./_object-gopd":154}],290:[function(require,module,exports){ // 26.1.8 Reflect.getPrototypeOf(target) var $export = require('./_export') , getProto = require('./_object-gpo') @@ -50025,7 +50628,7 @@ $export($export.S, 'Reflect', { return getProto(anObject(target)); } }); -},{"./_an-object":90,"./_export":115,"./_object-gpo":157}],290:[function(require,module,exports){ +},{"./_an-object":91,"./_export":116,"./_object-gpo":158}],291:[function(require,module,exports){ // 26.1.6 Reflect.get(target, propertyKey [, receiver]) var gOPD = require('./_object-gopd') , getPrototypeOf = require('./_object-gpo') @@ -50047,7 +50650,7 @@ function get(target, propertyKey/*, receiver*/){ } $export($export.S, 'Reflect', {get: get}); -},{"./_an-object":90,"./_export":115,"./_has":122,"./_is-object":132,"./_object-gopd":153,"./_object-gpo":157}],291:[function(require,module,exports){ +},{"./_an-object":91,"./_export":116,"./_has":123,"./_is-object":133,"./_object-gopd":154,"./_object-gpo":158}],292:[function(require,module,exports){ // 26.1.9 Reflect.has(target, propertyKey) var $export = require('./_export'); @@ -50056,7 +50659,7 @@ $export($export.S, 'Reflect', { return propertyKey in target; } }); -},{"./_export":115}],292:[function(require,module,exports){ +},{"./_export":116}],293:[function(require,module,exports){ // 26.1.10 Reflect.isExtensible(target) var $export = require('./_export') , anObject = require('./_an-object') @@ -50068,12 +50671,12 @@ $export($export.S, 'Reflect', { return $isExtensible ? $isExtensible(target) : true; } }); -},{"./_an-object":90,"./_export":115}],293:[function(require,module,exports){ +},{"./_an-object":91,"./_export":116}],294:[function(require,module,exports){ // 26.1.11 Reflect.ownKeys(target) var $export = require('./_export'); $export($export.S, 'Reflect', {ownKeys: require('./_own-keys')}); -},{"./_export":115,"./_own-keys":163}],294:[function(require,module,exports){ +},{"./_export":116,"./_own-keys":164}],295:[function(require,module,exports){ // 26.1.12 Reflect.preventExtensions(target) var $export = require('./_export') , anObject = require('./_an-object') @@ -50090,7 +50693,7 @@ $export($export.S, 'Reflect', { } } }); -},{"./_an-object":90,"./_export":115}],295:[function(require,module,exports){ +},{"./_an-object":91,"./_export":116}],296:[function(require,module,exports){ // 26.1.14 Reflect.setPrototypeOf(target, proto) var $export = require('./_export') , setProto = require('./_set-proto'); @@ -50106,7 +50709,7 @@ if(setProto)$export($export.S, 'Reflect', { } } }); -},{"./_export":115,"./_set-proto":173}],296:[function(require,module,exports){ +},{"./_export":116,"./_set-proto":174}],297:[function(require,module,exports){ // 26.1.13 Reflect.set(target, propertyKey, V [, receiver]) var dP = require('./_object-dp') , gOPD = require('./_object-gopd') @@ -50138,7 +50741,7 @@ function set(target, propertyKey, V/*, receiver*/){ } $export($export.S, 'Reflect', {set: set}); -},{"./_an-object":90,"./_export":115,"./_has":122,"./_is-object":132,"./_object-dp":150,"./_object-gopd":153,"./_object-gpo":157,"./_property-desc":168}],297:[function(require,module,exports){ +},{"./_an-object":91,"./_export":116,"./_has":123,"./_is-object":133,"./_object-dp":151,"./_object-gopd":154,"./_object-gpo":158,"./_property-desc":169}],298:[function(require,module,exports){ var global = require('./_global') , inheritIfRequired = require('./_inherit-if-required') , dP = require('./_object-dp').f @@ -50182,13 +50785,13 @@ if(require('./_descriptors') && (!CORRECT_NEW || require('./_fails')(function(){ } require('./_set-species')('RegExp'); -},{"./_descriptors":111,"./_fails":117,"./_flags":119,"./_global":121,"./_inherit-if-required":126,"./_is-regexp":133,"./_object-dp":150,"./_object-gopn":155,"./_redefine":170,"./_set-species":174,"./_wks":200}],298:[function(require,module,exports){ +},{"./_descriptors":112,"./_fails":118,"./_flags":120,"./_global":122,"./_inherit-if-required":127,"./_is-regexp":134,"./_object-dp":151,"./_object-gopn":156,"./_redefine":171,"./_set-species":175,"./_wks":201}],299:[function(require,module,exports){ // 21.2.5.3 get RegExp.prototype.flags() if(require('./_descriptors') && /./g.flags != 'g')require('./_object-dp').f(RegExp.prototype, 'flags', { configurable: true, get: require('./_flags') }); -},{"./_descriptors":111,"./_flags":119,"./_object-dp":150}],299:[function(require,module,exports){ +},{"./_descriptors":112,"./_flags":120,"./_object-dp":151}],300:[function(require,module,exports){ // @@match logic require('./_fix-re-wks')('match', 1, function(defined, MATCH, $match){ // 21.1.3.11 String.prototype.match(regexp) @@ -50199,7 +50802,7 @@ require('./_fix-re-wks')('match', 1, function(defined, MATCH, $match){ return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O)); }, $match]; }); -},{"./_fix-re-wks":118}],300:[function(require,module,exports){ +},{"./_fix-re-wks":119}],301:[function(require,module,exports){ // @@replace logic require('./_fix-re-wks')('replace', 2, function(defined, REPLACE, $replace){ // 21.1.3.14 String.prototype.replace(searchValue, replaceValue) @@ -50212,7 +50815,7 @@ require('./_fix-re-wks')('replace', 2, function(defined, REPLACE, $replace){ : $replace.call(String(O), searchValue, replaceValue); }, $replace]; }); -},{"./_fix-re-wks":118}],301:[function(require,module,exports){ +},{"./_fix-re-wks":119}],302:[function(require,module,exports){ // @@search logic require('./_fix-re-wks')('search', 1, function(defined, SEARCH, $search){ // 21.1.3.15 String.prototype.search(regexp) @@ -50223,7 +50826,7 @@ require('./_fix-re-wks')('search', 1, function(defined, SEARCH, $search){ return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O)); }, $search]; }); -},{"./_fix-re-wks":118}],302:[function(require,module,exports){ +},{"./_fix-re-wks":119}],303:[function(require,module,exports){ // @@split logic require('./_fix-re-wks')('split', 2, function(defined, SPLIT, $split){ 'use strict'; @@ -50294,7 +50897,7 @@ require('./_fix-re-wks')('split', 2, function(defined, SPLIT, $split){ return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit); }, $split]; }); -},{"./_fix-re-wks":118,"./_is-regexp":133}],303:[function(require,module,exports){ +},{"./_fix-re-wks":119,"./_is-regexp":134}],304:[function(require,module,exports){ 'use strict'; require('./es6.regexp.flags'); var anObject = require('./_an-object') @@ -50320,7 +50923,7 @@ if(require('./_fails')(function(){ return $toString.call({source: 'a', flags: 'b return $toString.call(this); }); } -},{"./_an-object":90,"./_descriptors":111,"./_fails":117,"./_flags":119,"./_redefine":170,"./es6.regexp.flags":298}],304:[function(require,module,exports){ +},{"./_an-object":91,"./_descriptors":112,"./_fails":118,"./_flags":120,"./_redefine":171,"./es6.regexp.flags":299}],305:[function(require,module,exports){ 'use strict'; var strong = require('./_collection-strong'); @@ -50333,7 +50936,7 @@ module.exports = require('./_collection')('Set', function(get){ return strong.def(this, value = value === 0 ? 0 : value, value); } }, strong); -},{"./_collection":105,"./_collection-strong":102}],305:[function(require,module,exports){ +},{"./_collection":106,"./_collection-strong":103}],306:[function(require,module,exports){ 'use strict'; // B.2.3.2 String.prototype.anchor(name) require('./_string-html')('anchor', function(createHTML){ @@ -50341,7 +50944,7 @@ require('./_string-html')('anchor', function(createHTML){ return createHTML(this, 'a', 'name', name); } }); -},{"./_string-html":182}],306:[function(require,module,exports){ +},{"./_string-html":183}],307:[function(require,module,exports){ 'use strict'; // B.2.3.3 String.prototype.big() require('./_string-html')('big', function(createHTML){ @@ -50349,7 +50952,7 @@ require('./_string-html')('big', function(createHTML){ return createHTML(this, 'big', '', ''); } }); -},{"./_string-html":182}],307:[function(require,module,exports){ +},{"./_string-html":183}],308:[function(require,module,exports){ 'use strict'; // B.2.3.4 String.prototype.blink() require('./_string-html')('blink', function(createHTML){ @@ -50357,7 +50960,7 @@ require('./_string-html')('blink', function(createHTML){ return createHTML(this, 'blink', '', ''); } }); -},{"./_string-html":182}],308:[function(require,module,exports){ +},{"./_string-html":183}],309:[function(require,module,exports){ 'use strict'; // B.2.3.5 String.prototype.bold() require('./_string-html')('bold', function(createHTML){ @@ -50365,7 +50968,7 @@ require('./_string-html')('bold', function(createHTML){ return createHTML(this, 'b', '', ''); } }); -},{"./_string-html":182}],309:[function(require,module,exports){ +},{"./_string-html":183}],310:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $at = require('./_string-at')(false); @@ -50375,7 +50978,7 @@ $export($export.P, 'String', { return $at(this, pos); } }); -},{"./_export":115,"./_string-at":180}],310:[function(require,module,exports){ +},{"./_export":116,"./_string-at":181}],311:[function(require,module,exports){ // 21.1.3.6 String.prototype.endsWith(searchString [, endPosition]) 'use strict'; var $export = require('./_export') @@ -50396,7 +50999,7 @@ $export($export.P + $export.F * require('./_fails-is-regexp')(ENDS_WITH), 'Strin : that.slice(end - search.length, end) === search; } }); -},{"./_export":115,"./_fails-is-regexp":116,"./_string-context":181,"./_to-length":191}],311:[function(require,module,exports){ +},{"./_export":116,"./_fails-is-regexp":117,"./_string-context":182,"./_to-length":192}],312:[function(require,module,exports){ 'use strict'; // B.2.3.6 String.prototype.fixed() require('./_string-html')('fixed', function(createHTML){ @@ -50404,7 +51007,7 @@ require('./_string-html')('fixed', function(createHTML){ return createHTML(this, 'tt', '', ''); } }); -},{"./_string-html":182}],312:[function(require,module,exports){ +},{"./_string-html":183}],313:[function(require,module,exports){ 'use strict'; // B.2.3.7 String.prototype.fontcolor(color) require('./_string-html')('fontcolor', function(createHTML){ @@ -50412,7 +51015,7 @@ require('./_string-html')('fontcolor', function(createHTML){ return createHTML(this, 'font', 'color', color); } }); -},{"./_string-html":182}],313:[function(require,module,exports){ +},{"./_string-html":183}],314:[function(require,module,exports){ 'use strict'; // B.2.3.8 String.prototype.fontsize(size) require('./_string-html')('fontsize', function(createHTML){ @@ -50420,7 +51023,7 @@ require('./_string-html')('fontsize', function(createHTML){ return createHTML(this, 'font', 'size', size); } }); -},{"./_string-html":182}],314:[function(require,module,exports){ +},{"./_string-html":183}],315:[function(require,module,exports){ var $export = require('./_export') , toIndex = require('./_to-index') , fromCharCode = String.fromCharCode @@ -50444,7 +51047,7 @@ $export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1) } return res.join(''); } }); -},{"./_export":115,"./_to-index":188}],315:[function(require,module,exports){ +},{"./_export":116,"./_to-index":189}],316:[function(require,module,exports){ // 21.1.3.7 String.prototype.includes(searchString, position = 0) 'use strict'; var $export = require('./_export') @@ -50457,7 +51060,7 @@ $export($export.P + $export.F * require('./_fails-is-regexp')(INCLUDES), 'String .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined); } }); -},{"./_export":115,"./_fails-is-regexp":116,"./_string-context":181}],316:[function(require,module,exports){ +},{"./_export":116,"./_fails-is-regexp":117,"./_string-context":182}],317:[function(require,module,exports){ 'use strict'; // B.2.3.9 String.prototype.italics() require('./_string-html')('italics', function(createHTML){ @@ -50465,7 +51068,7 @@ require('./_string-html')('italics', function(createHTML){ return createHTML(this, 'i', '', ''); } }); -},{"./_string-html":182}],317:[function(require,module,exports){ +},{"./_string-html":183}],318:[function(require,module,exports){ 'use strict'; var $at = require('./_string-at')(true); @@ -50483,7 +51086,7 @@ require('./_iter-define')(String, 'String', function(iterated){ this._i += point.length; return {value: point, done: false}; }); -},{"./_iter-define":136,"./_string-at":180}],318:[function(require,module,exports){ +},{"./_iter-define":137,"./_string-at":181}],319:[function(require,module,exports){ 'use strict'; // B.2.3.10 String.prototype.link(url) require('./_string-html')('link', function(createHTML){ @@ -50491,7 +51094,7 @@ require('./_string-html')('link', function(createHTML){ return createHTML(this, 'a', 'href', url); } }); -},{"./_string-html":182}],319:[function(require,module,exports){ +},{"./_string-html":183}],320:[function(require,module,exports){ var $export = require('./_export') , toIObject = require('./_to-iobject') , toLength = require('./_to-length'); @@ -50510,14 +51113,14 @@ $export($export.S, 'String', { } return res.join(''); } }); -},{"./_export":115,"./_to-iobject":190,"./_to-length":191}],320:[function(require,module,exports){ +},{"./_export":116,"./_to-iobject":191,"./_to-length":192}],321:[function(require,module,exports){ var $export = require('./_export'); $export($export.P, 'String', { // 21.1.3.13 String.prototype.repeat(count) repeat: require('./_string-repeat') }); -},{"./_export":115,"./_string-repeat":184}],321:[function(require,module,exports){ +},{"./_export":116,"./_string-repeat":185}],322:[function(require,module,exports){ 'use strict'; // B.2.3.11 String.prototype.small() require('./_string-html')('small', function(createHTML){ @@ -50525,7 +51128,7 @@ require('./_string-html')('small', function(createHTML){ return createHTML(this, 'small', '', ''); } }); -},{"./_string-html":182}],322:[function(require,module,exports){ +},{"./_string-html":183}],323:[function(require,module,exports){ // 21.1.3.18 String.prototype.startsWith(searchString [, position ]) 'use strict'; var $export = require('./_export') @@ -50544,7 +51147,7 @@ $export($export.P + $export.F * require('./_fails-is-regexp')(STARTS_WITH), 'Str : that.slice(index, index + search.length) === search; } }); -},{"./_export":115,"./_fails-is-regexp":116,"./_string-context":181,"./_to-length":191}],323:[function(require,module,exports){ +},{"./_export":116,"./_fails-is-regexp":117,"./_string-context":182,"./_to-length":192}],324:[function(require,module,exports){ 'use strict'; // B.2.3.12 String.prototype.strike() require('./_string-html')('strike', function(createHTML){ @@ -50552,7 +51155,7 @@ require('./_string-html')('strike', function(createHTML){ return createHTML(this, 'strike', '', ''); } }); -},{"./_string-html":182}],324:[function(require,module,exports){ +},{"./_string-html":183}],325:[function(require,module,exports){ 'use strict'; // B.2.3.13 String.prototype.sub() require('./_string-html')('sub', function(createHTML){ @@ -50560,7 +51163,7 @@ require('./_string-html')('sub', function(createHTML){ return createHTML(this, 'sub', '', ''); } }); -},{"./_string-html":182}],325:[function(require,module,exports){ +},{"./_string-html":183}],326:[function(require,module,exports){ 'use strict'; // B.2.3.14 String.prototype.sup() require('./_string-html')('sup', function(createHTML){ @@ -50568,7 +51171,7 @@ require('./_string-html')('sup', function(createHTML){ return createHTML(this, 'sup', '', ''); } }); -},{"./_string-html":182}],326:[function(require,module,exports){ +},{"./_string-html":183}],327:[function(require,module,exports){ 'use strict'; // 21.1.3.25 String.prototype.trim() require('./_string-trim')('trim', function($trim){ @@ -50576,7 +51179,7 @@ require('./_string-trim')('trim', function($trim){ return $trim(this, 3); }; }); -},{"./_string-trim":185}],327:[function(require,module,exports){ +},{"./_string-trim":186}],328:[function(require,module,exports){ 'use strict'; // ECMAScript 6 symbols shim var global = require('./_global') @@ -50812,7 +51415,7 @@ setToStringTag($Symbol, 'Symbol'); setToStringTag(Math, 'Math', true); // 24.3.3 JSON[@@toStringTag] setToStringTag(global.JSON, 'JSON', true); -},{"./_an-object":90,"./_descriptors":111,"./_enum-keys":114,"./_export":115,"./_fails":117,"./_global":121,"./_has":122,"./_hide":123,"./_is-array":130,"./_keyof":140,"./_library":141,"./_meta":145,"./_object-create":149,"./_object-dp":150,"./_object-gopd":153,"./_object-gopn":155,"./_object-gopn-ext":154,"./_object-gops":156,"./_object-keys":159,"./_object-pie":160,"./_property-desc":168,"./_redefine":170,"./_set-to-string-tag":175,"./_shared":177,"./_to-iobject":190,"./_to-primitive":193,"./_uid":197,"./_wks":200,"./_wks-define":198,"./_wks-ext":199}],328:[function(require,module,exports){ +},{"./_an-object":91,"./_descriptors":112,"./_enum-keys":115,"./_export":116,"./_fails":118,"./_global":122,"./_has":123,"./_hide":124,"./_is-array":131,"./_keyof":141,"./_library":142,"./_meta":146,"./_object-create":150,"./_object-dp":151,"./_object-gopd":154,"./_object-gopn":156,"./_object-gopn-ext":155,"./_object-gops":157,"./_object-keys":160,"./_object-pie":161,"./_property-desc":169,"./_redefine":171,"./_set-to-string-tag":176,"./_shared":178,"./_to-iobject":191,"./_to-primitive":194,"./_uid":198,"./_wks":201,"./_wks-define":199,"./_wks-ext":200}],329:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $typed = require('./_typed') @@ -50860,66 +51463,66 @@ $export($export.P + $export.U + $export.F * require('./_fails')(function(){ }); require('./_set-species')(ARRAY_BUFFER); -},{"./_an-object":90,"./_export":115,"./_fails":117,"./_global":121,"./_is-object":132,"./_set-species":174,"./_species-constructor":178,"./_to-index":188,"./_to-length":191,"./_typed":196,"./_typed-buffer":195,"./_wks":200}],329:[function(require,module,exports){ +},{"./_an-object":91,"./_export":116,"./_fails":118,"./_global":122,"./_is-object":133,"./_set-species":175,"./_species-constructor":179,"./_to-index":189,"./_to-length":192,"./_typed":197,"./_typed-buffer":196,"./_wks":201}],330:[function(require,module,exports){ var $export = require('./_export'); $export($export.G + $export.W + $export.F * !require('./_typed').ABV, { DataView: require('./_typed-buffer').DataView }); -},{"./_export":115,"./_typed":196,"./_typed-buffer":195}],330:[function(require,module,exports){ +},{"./_export":116,"./_typed":197,"./_typed-buffer":196}],331:[function(require,module,exports){ require('./_typed-array')('Float32', 4, function(init){ return function Float32Array(data, byteOffset, length){ return init(this, data, byteOffset, length); }; }); -},{"./_typed-array":194}],331:[function(require,module,exports){ +},{"./_typed-array":195}],332:[function(require,module,exports){ require('./_typed-array')('Float64', 8, function(init){ return function Float64Array(data, byteOffset, length){ return init(this, data, byteOffset, length); }; }); -},{"./_typed-array":194}],332:[function(require,module,exports){ +},{"./_typed-array":195}],333:[function(require,module,exports){ require('./_typed-array')('Int16', 2, function(init){ return function Int16Array(data, byteOffset, length){ return init(this, data, byteOffset, length); }; }); -},{"./_typed-array":194}],333:[function(require,module,exports){ +},{"./_typed-array":195}],334:[function(require,module,exports){ require('./_typed-array')('Int32', 4, function(init){ return function Int32Array(data, byteOffset, length){ return init(this, data, byteOffset, length); }; }); -},{"./_typed-array":194}],334:[function(require,module,exports){ +},{"./_typed-array":195}],335:[function(require,module,exports){ require('./_typed-array')('Int8', 1, function(init){ return function Int8Array(data, byteOffset, length){ return init(this, data, byteOffset, length); }; }); -},{"./_typed-array":194}],335:[function(require,module,exports){ +},{"./_typed-array":195}],336:[function(require,module,exports){ require('./_typed-array')('Uint16', 2, function(init){ return function Uint16Array(data, byteOffset, length){ return init(this, data, byteOffset, length); }; }); -},{"./_typed-array":194}],336:[function(require,module,exports){ +},{"./_typed-array":195}],337:[function(require,module,exports){ require('./_typed-array')('Uint32', 4, function(init){ return function Uint32Array(data, byteOffset, length){ return init(this, data, byteOffset, length); }; }); -},{"./_typed-array":194}],337:[function(require,module,exports){ +},{"./_typed-array":195}],338:[function(require,module,exports){ require('./_typed-array')('Uint8', 1, function(init){ return function Uint8Array(data, byteOffset, length){ return init(this, data, byteOffset, length); }; }); -},{"./_typed-array":194}],338:[function(require,module,exports){ +},{"./_typed-array":195}],339:[function(require,module,exports){ require('./_typed-array')('Uint8', 1, function(init){ return function Uint8ClampedArray(data, byteOffset, length){ return init(this, data, byteOffset, length); }; }, true); -},{"./_typed-array":194}],339:[function(require,module,exports){ +},{"./_typed-array":195}],340:[function(require,module,exports){ 'use strict'; var each = require('./_array-methods')(0) , redefine = require('./_redefine') @@ -50977,7 +51580,7 @@ if(new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7){ }); }); } -},{"./_array-methods":95,"./_collection":105,"./_collection-weak":104,"./_has":122,"./_is-object":132,"./_meta":145,"./_object-assign":148,"./_redefine":170}],340:[function(require,module,exports){ +},{"./_array-methods":96,"./_collection":106,"./_collection-weak":105,"./_has":123,"./_is-object":133,"./_meta":146,"./_object-assign":149,"./_redefine":171}],341:[function(require,module,exports){ 'use strict'; var weak = require('./_collection-weak'); @@ -50990,7 +51593,7 @@ require('./_collection')('WeakSet', function(get){ return weak.def(this, value, true); } }, weak, false, true); -},{"./_collection":105,"./_collection-weak":104}],341:[function(require,module,exports){ +},{"./_collection":106,"./_collection-weak":105}],342:[function(require,module,exports){ 'use strict'; // https://github.com/tc39/Array.prototype.includes var $export = require('./_export') @@ -51003,7 +51606,7 @@ $export($export.P, 'Array', { }); require('./_add-to-unscopables')('includes'); -},{"./_add-to-unscopables":88,"./_array-includes":94,"./_export":115}],342:[function(require,module,exports){ +},{"./_add-to-unscopables":89,"./_array-includes":95,"./_export":116}],343:[function(require,module,exports){ // https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask var $export = require('./_export') , microtask = require('./_microtask')() @@ -51016,7 +51619,7 @@ $export($export.G, { microtask(domain ? domain.bind(fn) : fn); } }); -},{"./_cof":101,"./_export":115,"./_global":121,"./_microtask":147}],343:[function(require,module,exports){ +},{"./_cof":102,"./_export":116,"./_global":122,"./_microtask":148}],344:[function(require,module,exports){ // https://github.com/ljharb/proposal-is-error var $export = require('./_export') , cof = require('./_cof'); @@ -51026,12 +51629,12 @@ $export($export.S, 'Error', { return cof(it) === 'Error'; } }); -},{"./_cof":101,"./_export":115}],344:[function(require,module,exports){ +},{"./_cof":102,"./_export":116}],345:[function(require,module,exports){ // https://github.com/DavidBruant/Map-Set.prototype.toJSON var $export = require('./_export'); $export($export.P + $export.R, 'Map', {toJSON: require('./_collection-to-json')('Map')}); -},{"./_collection-to-json":103,"./_export":115}],345:[function(require,module,exports){ +},{"./_collection-to-json":104,"./_export":116}],346:[function(require,module,exports){ // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 var $export = require('./_export'); @@ -51043,7 +51646,7 @@ $export($export.S, 'Math', { return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0; } }); -},{"./_export":115}],346:[function(require,module,exports){ +},{"./_export":116}],347:[function(require,module,exports){ // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 var $export = require('./_export'); @@ -51060,7 +51663,7 @@ $export($export.S, 'Math', { return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16); } }); -},{"./_export":115}],347:[function(require,module,exports){ +},{"./_export":116}],348:[function(require,module,exports){ // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 var $export = require('./_export'); @@ -51072,7 +51675,7 @@ $export($export.S, 'Math', { return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0; } }); -},{"./_export":115}],348:[function(require,module,exports){ +},{"./_export":116}],349:[function(require,module,exports){ // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 var $export = require('./_export'); @@ -51089,7 +51692,7 @@ $export($export.S, 'Math', { return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16); } }); -},{"./_export":115}],349:[function(require,module,exports){ +},{"./_export":116}],350:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , toObject = require('./_to-object') @@ -51102,7 +51705,7 @@ require('./_descriptors') && $export($export.P + require('./_object-forced-pam') $defineProperty.f(toObject(this), P, {get: aFunction(getter), enumerable: true, configurable: true}); } }); -},{"./_a-function":86,"./_descriptors":111,"./_export":115,"./_object-dp":150,"./_object-forced-pam":152,"./_to-object":192}],350:[function(require,module,exports){ +},{"./_a-function":87,"./_descriptors":112,"./_export":116,"./_object-dp":151,"./_object-forced-pam":153,"./_to-object":193}],351:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , toObject = require('./_to-object') @@ -51115,7 +51718,7 @@ require('./_descriptors') && $export($export.P + require('./_object-forced-pam') $defineProperty.f(toObject(this), P, {set: aFunction(setter), enumerable: true, configurable: true}); } }); -},{"./_a-function":86,"./_descriptors":111,"./_export":115,"./_object-dp":150,"./_object-forced-pam":152,"./_to-object":192}],351:[function(require,module,exports){ +},{"./_a-function":87,"./_descriptors":112,"./_export":116,"./_object-dp":151,"./_object-forced-pam":153,"./_to-object":193}],352:[function(require,module,exports){ // https://github.com/tc39/proposal-object-values-entries var $export = require('./_export') , $entries = require('./_object-to-array')(true); @@ -51125,7 +51728,7 @@ $export($export.S, 'Object', { return $entries(it); } }); -},{"./_export":115,"./_object-to-array":162}],352:[function(require,module,exports){ +},{"./_export":116,"./_object-to-array":163}],353:[function(require,module,exports){ // https://github.com/tc39/proposal-object-getownpropertydescriptors var $export = require('./_export') , ownKeys = require('./_own-keys') @@ -51145,7 +51748,7 @@ $export($export.S, 'Object', { return result; } }); -},{"./_create-property":107,"./_export":115,"./_object-gopd":153,"./_own-keys":163,"./_to-iobject":190}],353:[function(require,module,exports){ +},{"./_create-property":108,"./_export":116,"./_object-gopd":154,"./_own-keys":164,"./_to-iobject":191}],354:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , toObject = require('./_to-object') @@ -51164,7 +51767,7 @@ require('./_descriptors') && $export($export.P + require('./_object-forced-pam') } while(O = getPrototypeOf(O)); } }); -},{"./_descriptors":111,"./_export":115,"./_object-forced-pam":152,"./_object-gopd":153,"./_object-gpo":157,"./_to-object":192,"./_to-primitive":193}],354:[function(require,module,exports){ +},{"./_descriptors":112,"./_export":116,"./_object-forced-pam":153,"./_object-gopd":154,"./_object-gpo":158,"./_to-object":193,"./_to-primitive":194}],355:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , toObject = require('./_to-object') @@ -51183,7 +51786,7 @@ require('./_descriptors') && $export($export.P + require('./_object-forced-pam') } while(O = getPrototypeOf(O)); } }); -},{"./_descriptors":111,"./_export":115,"./_object-forced-pam":152,"./_object-gopd":153,"./_object-gpo":157,"./_to-object":192,"./_to-primitive":193}],355:[function(require,module,exports){ +},{"./_descriptors":112,"./_export":116,"./_object-forced-pam":153,"./_object-gopd":154,"./_object-gpo":158,"./_to-object":193,"./_to-primitive":194}],356:[function(require,module,exports){ // https://github.com/tc39/proposal-object-values-entries var $export = require('./_export') , $values = require('./_object-to-array')(false); @@ -51193,7 +51796,7 @@ $export($export.S, 'Object', { return $values(it); } }); -},{"./_export":115,"./_object-to-array":162}],356:[function(require,module,exports){ +},{"./_export":116,"./_object-to-array":163}],357:[function(require,module,exports){ 'use strict'; // https://github.com/zenparsing/es-observable var $export = require('./_export') @@ -51393,7 +51996,7 @@ hide($Observable.prototype, OBSERVABLE, function(){ return this; }); $export($export.G, {Observable: $Observable}); require('./_set-species')('Observable'); -},{"./_a-function":86,"./_an-instance":89,"./_an-object":90,"./_core":106,"./_export":115,"./_for-of":120,"./_global":121,"./_hide":123,"./_microtask":147,"./_redefine-all":169,"./_set-species":174,"./_wks":200}],357:[function(require,module,exports){ +},{"./_a-function":87,"./_an-instance":90,"./_an-object":91,"./_core":107,"./_export":116,"./_for-of":121,"./_global":122,"./_hide":124,"./_microtask":148,"./_redefine-all":170,"./_set-species":175,"./_wks":201}],358:[function(require,module,exports){ var metadata = require('./_metadata') , anObject = require('./_an-object') , toMetaKey = metadata.key @@ -51402,7 +52005,7 @@ var metadata = require('./_metadata') metadata.exp({defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey){ ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey)); }}); -},{"./_an-object":90,"./_metadata":146}],358:[function(require,module,exports){ +},{"./_an-object":91,"./_metadata":147}],359:[function(require,module,exports){ var metadata = require('./_metadata') , anObject = require('./_an-object') , toMetaKey = metadata.key @@ -51418,7 +52021,7 @@ metadata.exp({deleteMetadata: function deleteMetadata(metadataKey, target /*, ta targetMetadata['delete'](targetKey); return !!targetMetadata.size || store['delete'](target); }}); -},{"./_an-object":90,"./_metadata":146}],359:[function(require,module,exports){ +},{"./_an-object":91,"./_metadata":147}],360:[function(require,module,exports){ var Set = require('./es6.set') , from = require('./_array-from-iterable') , metadata = require('./_metadata') @@ -51438,7 +52041,7 @@ var ordinaryMetadataKeys = function(O, P){ metadata.exp({getMetadataKeys: function getMetadataKeys(target /*, targetKey */){ return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); }}); -},{"./_an-object":90,"./_array-from-iterable":93,"./_metadata":146,"./_object-gpo":157,"./es6.set":304}],360:[function(require,module,exports){ +},{"./_an-object":91,"./_array-from-iterable":94,"./_metadata":147,"./_object-gpo":158,"./es6.set":305}],361:[function(require,module,exports){ var metadata = require('./_metadata') , anObject = require('./_an-object') , getPrototypeOf = require('./_object-gpo') @@ -51456,7 +52059,7 @@ var ordinaryGetMetadata = function(MetadataKey, O, P){ metadata.exp({getMetadata: function getMetadata(metadataKey, target /*, targetKey */){ return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); }}); -},{"./_an-object":90,"./_metadata":146,"./_object-gpo":157}],361:[function(require,module,exports){ +},{"./_an-object":91,"./_metadata":147,"./_object-gpo":158}],362:[function(require,module,exports){ var metadata = require('./_metadata') , anObject = require('./_an-object') , ordinaryOwnMetadataKeys = metadata.keys @@ -51465,7 +52068,7 @@ var metadata = require('./_metadata') metadata.exp({getOwnMetadataKeys: function getOwnMetadataKeys(target /*, targetKey */){ return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); }}); -},{"./_an-object":90,"./_metadata":146}],362:[function(require,module,exports){ +},{"./_an-object":91,"./_metadata":147}],363:[function(require,module,exports){ var metadata = require('./_metadata') , anObject = require('./_an-object') , ordinaryGetOwnMetadata = metadata.get @@ -51475,7 +52078,7 @@ metadata.exp({getOwnMetadata: function getOwnMetadata(metadataKey, target /*, ta return ordinaryGetOwnMetadata(metadataKey, anObject(target) , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); }}); -},{"./_an-object":90,"./_metadata":146}],363:[function(require,module,exports){ +},{"./_an-object":91,"./_metadata":147}],364:[function(require,module,exports){ var metadata = require('./_metadata') , anObject = require('./_an-object') , getPrototypeOf = require('./_object-gpo') @@ -51492,7 +52095,7 @@ var ordinaryHasMetadata = function(MetadataKey, O, P){ metadata.exp({hasMetadata: function hasMetadata(metadataKey, target /*, targetKey */){ return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); }}); -},{"./_an-object":90,"./_metadata":146,"./_object-gpo":157}],364:[function(require,module,exports){ +},{"./_an-object":91,"./_metadata":147,"./_object-gpo":158}],365:[function(require,module,exports){ var metadata = require('./_metadata') , anObject = require('./_an-object') , ordinaryHasOwnMetadata = metadata.has @@ -51502,7 +52105,7 @@ metadata.exp({hasOwnMetadata: function hasOwnMetadata(metadataKey, target /*, ta return ordinaryHasOwnMetadata(metadataKey, anObject(target) , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); }}); -},{"./_an-object":90,"./_metadata":146}],365:[function(require,module,exports){ +},{"./_an-object":91,"./_metadata":147}],366:[function(require,module,exports){ var metadata = require('./_metadata') , anObject = require('./_an-object') , aFunction = require('./_a-function') @@ -51518,12 +52121,12 @@ metadata.exp({metadata: function metadata(metadataKey, metadataValue){ ); }; }}); -},{"./_a-function":86,"./_an-object":90,"./_metadata":146}],366:[function(require,module,exports){ +},{"./_a-function":87,"./_an-object":91,"./_metadata":147}],367:[function(require,module,exports){ // https://github.com/DavidBruant/Map-Set.prototype.toJSON var $export = require('./_export'); $export($export.P + $export.R, 'Set', {toJSON: require('./_collection-to-json')('Set')}); -},{"./_collection-to-json":103,"./_export":115}],367:[function(require,module,exports){ +},{"./_collection-to-json":104,"./_export":116}],368:[function(require,module,exports){ 'use strict'; // https://github.com/mathiasbynens/String.prototype.at var $export = require('./_export') @@ -51534,7 +52137,7 @@ $export($export.P, 'String', { return $at(this, pos); } }); -},{"./_export":115,"./_string-at":180}],368:[function(require,module,exports){ +},{"./_export":116,"./_string-at":181}],369:[function(require,module,exports){ 'use strict'; // https://tc39.github.io/String.prototype.matchAll/ var $export = require('./_export') @@ -51565,7 +52168,7 @@ $export($export.P, 'String', { return new $RegExpStringIterator(rx, S); } }); -},{"./_defined":110,"./_export":115,"./_flags":119,"./_is-regexp":133,"./_iter-create":135,"./_to-length":191}],369:[function(require,module,exports){ +},{"./_defined":111,"./_export":116,"./_flags":120,"./_is-regexp":134,"./_iter-create":136,"./_to-length":192}],370:[function(require,module,exports){ 'use strict'; // https://github.com/tc39/proposal-string-pad-start-end var $export = require('./_export') @@ -51576,7 +52179,7 @@ $export($export.P, 'String', { return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false); } }); -},{"./_export":115,"./_string-pad":183}],370:[function(require,module,exports){ +},{"./_export":116,"./_string-pad":184}],371:[function(require,module,exports){ 'use strict'; // https://github.com/tc39/proposal-string-pad-start-end var $export = require('./_export') @@ -51587,7 +52190,7 @@ $export($export.P, 'String', { return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true); } }); -},{"./_export":115,"./_string-pad":183}],371:[function(require,module,exports){ +},{"./_export":116,"./_string-pad":184}],372:[function(require,module,exports){ 'use strict'; // https://github.com/sebmarkbage/ecmascript-string-left-right-trim require('./_string-trim')('trimLeft', function($trim){ @@ -51595,7 +52198,7 @@ require('./_string-trim')('trimLeft', function($trim){ return $trim(this, 1); }; }, 'trimStart'); -},{"./_string-trim":185}],372:[function(require,module,exports){ +},{"./_string-trim":186}],373:[function(require,module,exports){ 'use strict'; // https://github.com/sebmarkbage/ecmascript-string-left-right-trim require('./_string-trim')('trimRight', function($trim){ @@ -51603,16 +52206,16 @@ require('./_string-trim')('trimRight', function($trim){ return $trim(this, 2); }; }, 'trimEnd'); -},{"./_string-trim":185}],373:[function(require,module,exports){ +},{"./_string-trim":186}],374:[function(require,module,exports){ require('./_wks-define')('asyncIterator'); -},{"./_wks-define":198}],374:[function(require,module,exports){ +},{"./_wks-define":199}],375:[function(require,module,exports){ require('./_wks-define')('observable'); -},{"./_wks-define":198}],375:[function(require,module,exports){ +},{"./_wks-define":199}],376:[function(require,module,exports){ // https://github.com/ljharb/proposal-global var $export = require('./_export'); $export($export.S, 'System', {global: require('./_global')}); -},{"./_export":115,"./_global":121}],376:[function(require,module,exports){ +},{"./_export":116,"./_global":122}],377:[function(require,module,exports){ var $iterators = require('./es6.array.iterator') , redefine = require('./_redefine') , global = require('./_global') @@ -51635,14 +52238,14 @@ for(var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList' for(key in $iterators)if(!proto[key])redefine(proto, key, $iterators[key], true); } } -},{"./_global":121,"./_hide":123,"./_iterators":139,"./_redefine":170,"./_wks":200,"./es6.array.iterator":214}],377:[function(require,module,exports){ +},{"./_global":122,"./_hide":124,"./_iterators":140,"./_redefine":171,"./_wks":201,"./es6.array.iterator":215}],378:[function(require,module,exports){ var $export = require('./_export') , $task = require('./_task'); $export($export.G + $export.B, { setImmediate: $task.set, clearImmediate: $task.clear }); -},{"./_export":115,"./_task":187}],378:[function(require,module,exports){ +},{"./_export":116,"./_task":188}],379:[function(require,module,exports){ // ie9- setTimeout & setInterval additional parameters fix var global = require('./_global') , $export = require('./_export') @@ -51663,7 +52266,7 @@ $export($export.G + $export.B + $export.F * MSIE, { setTimeout: wrap(global.setTimeout), setInterval: wrap(global.setInterval) }); -},{"./_export":115,"./_global":121,"./_invoke":127,"./_partial":166}],379:[function(require,module,exports){ +},{"./_export":116,"./_global":122,"./_invoke":128,"./_partial":167}],380:[function(require,module,exports){ require('./modules/es6.symbol'); require('./modules/es6.object.create'); require('./modules/es6.object.define-property'); @@ -51840,7 +52443,7 @@ require('./modules/web.timers'); require('./modules/web.immediate'); require('./modules/web.dom.iterable'); module.exports = require('./modules/_core'); -},{"./modules/_core":106,"./modules/es6.array.copy-within":204,"./modules/es6.array.every":205,"./modules/es6.array.fill":206,"./modules/es6.array.filter":207,"./modules/es6.array.find":209,"./modules/es6.array.find-index":208,"./modules/es6.array.for-each":210,"./modules/es6.array.from":211,"./modules/es6.array.index-of":212,"./modules/es6.array.is-array":213,"./modules/es6.array.iterator":214,"./modules/es6.array.join":215,"./modules/es6.array.last-index-of":216,"./modules/es6.array.map":217,"./modules/es6.array.of":218,"./modules/es6.array.reduce":220,"./modules/es6.array.reduce-right":219,"./modules/es6.array.slice":221,"./modules/es6.array.some":222,"./modules/es6.array.sort":223,"./modules/es6.array.species":224,"./modules/es6.date.now":225,"./modules/es6.date.to-iso-string":226,"./modules/es6.date.to-json":227,"./modules/es6.date.to-primitive":228,"./modules/es6.date.to-string":229,"./modules/es6.function.bind":230,"./modules/es6.function.has-instance":231,"./modules/es6.function.name":232,"./modules/es6.map":233,"./modules/es6.math.acosh":234,"./modules/es6.math.asinh":235,"./modules/es6.math.atanh":236,"./modules/es6.math.cbrt":237,"./modules/es6.math.clz32":238,"./modules/es6.math.cosh":239,"./modules/es6.math.expm1":240,"./modules/es6.math.fround":241,"./modules/es6.math.hypot":242,"./modules/es6.math.imul":243,"./modules/es6.math.log10":244,"./modules/es6.math.log1p":245,"./modules/es6.math.log2":246,"./modules/es6.math.sign":247,"./modules/es6.math.sinh":248,"./modules/es6.math.tanh":249,"./modules/es6.math.trunc":250,"./modules/es6.number.constructor":251,"./modules/es6.number.epsilon":252,"./modules/es6.number.is-finite":253,"./modules/es6.number.is-integer":254,"./modules/es6.number.is-nan":255,"./modules/es6.number.is-safe-integer":256,"./modules/es6.number.max-safe-integer":257,"./modules/es6.number.min-safe-integer":258,"./modules/es6.number.parse-float":259,"./modules/es6.number.parse-int":260,"./modules/es6.number.to-fixed":261,"./modules/es6.number.to-precision":262,"./modules/es6.object.assign":263,"./modules/es6.object.create":264,"./modules/es6.object.define-properties":265,"./modules/es6.object.define-property":266,"./modules/es6.object.freeze":267,"./modules/es6.object.get-own-property-descriptor":268,"./modules/es6.object.get-own-property-names":269,"./modules/es6.object.get-prototype-of":270,"./modules/es6.object.is":274,"./modules/es6.object.is-extensible":271,"./modules/es6.object.is-frozen":272,"./modules/es6.object.is-sealed":273,"./modules/es6.object.keys":275,"./modules/es6.object.prevent-extensions":276,"./modules/es6.object.seal":277,"./modules/es6.object.set-prototype-of":278,"./modules/es6.object.to-string":279,"./modules/es6.parse-float":280,"./modules/es6.parse-int":281,"./modules/es6.promise":282,"./modules/es6.reflect.apply":283,"./modules/es6.reflect.construct":284,"./modules/es6.reflect.define-property":285,"./modules/es6.reflect.delete-property":286,"./modules/es6.reflect.enumerate":287,"./modules/es6.reflect.get":290,"./modules/es6.reflect.get-own-property-descriptor":288,"./modules/es6.reflect.get-prototype-of":289,"./modules/es6.reflect.has":291,"./modules/es6.reflect.is-extensible":292,"./modules/es6.reflect.own-keys":293,"./modules/es6.reflect.prevent-extensions":294,"./modules/es6.reflect.set":296,"./modules/es6.reflect.set-prototype-of":295,"./modules/es6.regexp.constructor":297,"./modules/es6.regexp.flags":298,"./modules/es6.regexp.match":299,"./modules/es6.regexp.replace":300,"./modules/es6.regexp.search":301,"./modules/es6.regexp.split":302,"./modules/es6.regexp.to-string":303,"./modules/es6.set":304,"./modules/es6.string.anchor":305,"./modules/es6.string.big":306,"./modules/es6.string.blink":307,"./modules/es6.string.bold":308,"./modules/es6.string.code-point-at":309,"./modules/es6.string.ends-with":310,"./modules/es6.string.fixed":311,"./modules/es6.string.fontcolor":312,"./modules/es6.string.fontsize":313,"./modules/es6.string.from-code-point":314,"./modules/es6.string.includes":315,"./modules/es6.string.italics":316,"./modules/es6.string.iterator":317,"./modules/es6.string.link":318,"./modules/es6.string.raw":319,"./modules/es6.string.repeat":320,"./modules/es6.string.small":321,"./modules/es6.string.starts-with":322,"./modules/es6.string.strike":323,"./modules/es6.string.sub":324,"./modules/es6.string.sup":325,"./modules/es6.string.trim":326,"./modules/es6.symbol":327,"./modules/es6.typed.array-buffer":328,"./modules/es6.typed.data-view":329,"./modules/es6.typed.float32-array":330,"./modules/es6.typed.float64-array":331,"./modules/es6.typed.int16-array":332,"./modules/es6.typed.int32-array":333,"./modules/es6.typed.int8-array":334,"./modules/es6.typed.uint16-array":335,"./modules/es6.typed.uint32-array":336,"./modules/es6.typed.uint8-array":337,"./modules/es6.typed.uint8-clamped-array":338,"./modules/es6.weak-map":339,"./modules/es6.weak-set":340,"./modules/es7.array.includes":341,"./modules/es7.asap":342,"./modules/es7.error.is-error":343,"./modules/es7.map.to-json":344,"./modules/es7.math.iaddh":345,"./modules/es7.math.imulh":346,"./modules/es7.math.isubh":347,"./modules/es7.math.umulh":348,"./modules/es7.object.define-getter":349,"./modules/es7.object.define-setter":350,"./modules/es7.object.entries":351,"./modules/es7.object.get-own-property-descriptors":352,"./modules/es7.object.lookup-getter":353,"./modules/es7.object.lookup-setter":354,"./modules/es7.object.values":355,"./modules/es7.observable":356,"./modules/es7.reflect.define-metadata":357,"./modules/es7.reflect.delete-metadata":358,"./modules/es7.reflect.get-metadata":360,"./modules/es7.reflect.get-metadata-keys":359,"./modules/es7.reflect.get-own-metadata":362,"./modules/es7.reflect.get-own-metadata-keys":361,"./modules/es7.reflect.has-metadata":363,"./modules/es7.reflect.has-own-metadata":364,"./modules/es7.reflect.metadata":365,"./modules/es7.set.to-json":366,"./modules/es7.string.at":367,"./modules/es7.string.match-all":368,"./modules/es7.string.pad-end":369,"./modules/es7.string.pad-start":370,"./modules/es7.string.trim-left":371,"./modules/es7.string.trim-right":372,"./modules/es7.symbol.async-iterator":373,"./modules/es7.symbol.observable":374,"./modules/es7.system.global":375,"./modules/web.dom.iterable":376,"./modules/web.immediate":377,"./modules/web.timers":378}],380:[function(require,module,exports){ +},{"./modules/_core":107,"./modules/es6.array.copy-within":205,"./modules/es6.array.every":206,"./modules/es6.array.fill":207,"./modules/es6.array.filter":208,"./modules/es6.array.find":210,"./modules/es6.array.find-index":209,"./modules/es6.array.for-each":211,"./modules/es6.array.from":212,"./modules/es6.array.index-of":213,"./modules/es6.array.is-array":214,"./modules/es6.array.iterator":215,"./modules/es6.array.join":216,"./modules/es6.array.last-index-of":217,"./modules/es6.array.map":218,"./modules/es6.array.of":219,"./modules/es6.array.reduce":221,"./modules/es6.array.reduce-right":220,"./modules/es6.array.slice":222,"./modules/es6.array.some":223,"./modules/es6.array.sort":224,"./modules/es6.array.species":225,"./modules/es6.date.now":226,"./modules/es6.date.to-iso-string":227,"./modules/es6.date.to-json":228,"./modules/es6.date.to-primitive":229,"./modules/es6.date.to-string":230,"./modules/es6.function.bind":231,"./modules/es6.function.has-instance":232,"./modules/es6.function.name":233,"./modules/es6.map":234,"./modules/es6.math.acosh":235,"./modules/es6.math.asinh":236,"./modules/es6.math.atanh":237,"./modules/es6.math.cbrt":238,"./modules/es6.math.clz32":239,"./modules/es6.math.cosh":240,"./modules/es6.math.expm1":241,"./modules/es6.math.fround":242,"./modules/es6.math.hypot":243,"./modules/es6.math.imul":244,"./modules/es6.math.log10":245,"./modules/es6.math.log1p":246,"./modules/es6.math.log2":247,"./modules/es6.math.sign":248,"./modules/es6.math.sinh":249,"./modules/es6.math.tanh":250,"./modules/es6.math.trunc":251,"./modules/es6.number.constructor":252,"./modules/es6.number.epsilon":253,"./modules/es6.number.is-finite":254,"./modules/es6.number.is-integer":255,"./modules/es6.number.is-nan":256,"./modules/es6.number.is-safe-integer":257,"./modules/es6.number.max-safe-integer":258,"./modules/es6.number.min-safe-integer":259,"./modules/es6.number.parse-float":260,"./modules/es6.number.parse-int":261,"./modules/es6.number.to-fixed":262,"./modules/es6.number.to-precision":263,"./modules/es6.object.assign":264,"./modules/es6.object.create":265,"./modules/es6.object.define-properties":266,"./modules/es6.object.define-property":267,"./modules/es6.object.freeze":268,"./modules/es6.object.get-own-property-descriptor":269,"./modules/es6.object.get-own-property-names":270,"./modules/es6.object.get-prototype-of":271,"./modules/es6.object.is":275,"./modules/es6.object.is-extensible":272,"./modules/es6.object.is-frozen":273,"./modules/es6.object.is-sealed":274,"./modules/es6.object.keys":276,"./modules/es6.object.prevent-extensions":277,"./modules/es6.object.seal":278,"./modules/es6.object.set-prototype-of":279,"./modules/es6.object.to-string":280,"./modules/es6.parse-float":281,"./modules/es6.parse-int":282,"./modules/es6.promise":283,"./modules/es6.reflect.apply":284,"./modules/es6.reflect.construct":285,"./modules/es6.reflect.define-property":286,"./modules/es6.reflect.delete-property":287,"./modules/es6.reflect.enumerate":288,"./modules/es6.reflect.get":291,"./modules/es6.reflect.get-own-property-descriptor":289,"./modules/es6.reflect.get-prototype-of":290,"./modules/es6.reflect.has":292,"./modules/es6.reflect.is-extensible":293,"./modules/es6.reflect.own-keys":294,"./modules/es6.reflect.prevent-extensions":295,"./modules/es6.reflect.set":297,"./modules/es6.reflect.set-prototype-of":296,"./modules/es6.regexp.constructor":298,"./modules/es6.regexp.flags":299,"./modules/es6.regexp.match":300,"./modules/es6.regexp.replace":301,"./modules/es6.regexp.search":302,"./modules/es6.regexp.split":303,"./modules/es6.regexp.to-string":304,"./modules/es6.set":305,"./modules/es6.string.anchor":306,"./modules/es6.string.big":307,"./modules/es6.string.blink":308,"./modules/es6.string.bold":309,"./modules/es6.string.code-point-at":310,"./modules/es6.string.ends-with":311,"./modules/es6.string.fixed":312,"./modules/es6.string.fontcolor":313,"./modules/es6.string.fontsize":314,"./modules/es6.string.from-code-point":315,"./modules/es6.string.includes":316,"./modules/es6.string.italics":317,"./modules/es6.string.iterator":318,"./modules/es6.string.link":319,"./modules/es6.string.raw":320,"./modules/es6.string.repeat":321,"./modules/es6.string.small":322,"./modules/es6.string.starts-with":323,"./modules/es6.string.strike":324,"./modules/es6.string.sub":325,"./modules/es6.string.sup":326,"./modules/es6.string.trim":327,"./modules/es6.symbol":328,"./modules/es6.typed.array-buffer":329,"./modules/es6.typed.data-view":330,"./modules/es6.typed.float32-array":331,"./modules/es6.typed.float64-array":332,"./modules/es6.typed.int16-array":333,"./modules/es6.typed.int32-array":334,"./modules/es6.typed.int8-array":335,"./modules/es6.typed.uint16-array":336,"./modules/es6.typed.uint32-array":337,"./modules/es6.typed.uint8-array":338,"./modules/es6.typed.uint8-clamped-array":339,"./modules/es6.weak-map":340,"./modules/es6.weak-set":341,"./modules/es7.array.includes":342,"./modules/es7.asap":343,"./modules/es7.error.is-error":344,"./modules/es7.map.to-json":345,"./modules/es7.math.iaddh":346,"./modules/es7.math.imulh":347,"./modules/es7.math.isubh":348,"./modules/es7.math.umulh":349,"./modules/es7.object.define-getter":350,"./modules/es7.object.define-setter":351,"./modules/es7.object.entries":352,"./modules/es7.object.get-own-property-descriptors":353,"./modules/es7.object.lookup-getter":354,"./modules/es7.object.lookup-setter":355,"./modules/es7.object.values":356,"./modules/es7.observable":357,"./modules/es7.reflect.define-metadata":358,"./modules/es7.reflect.delete-metadata":359,"./modules/es7.reflect.get-metadata":361,"./modules/es7.reflect.get-metadata-keys":360,"./modules/es7.reflect.get-own-metadata":363,"./modules/es7.reflect.get-own-metadata-keys":362,"./modules/es7.reflect.has-metadata":364,"./modules/es7.reflect.has-own-metadata":365,"./modules/es7.reflect.metadata":366,"./modules/es7.set.to-json":367,"./modules/es7.string.at":368,"./modules/es7.string.match-all":369,"./modules/es7.string.pad-end":370,"./modules/es7.string.pad-start":371,"./modules/es7.string.trim-left":372,"./modules/es7.string.trim-right":373,"./modules/es7.symbol.async-iterator":374,"./modules/es7.symbol.observable":375,"./modules/es7.system.global":376,"./modules/web.dom.iterable":377,"./modules/web.immediate":378,"./modules/web.timers":379}],381:[function(require,module,exports){ (function (Buffer){ // Copyright Joyent, Inc. and other Node contributors. // @@ -51951,7 +52554,7 @@ function objectToString(o) { } }).call(this,{"isBuffer":require("../../is-buffer/index.js")}) -},{"../../is-buffer/index.js":429}],381:[function(require,module,exports){ +},{"../../is-buffer/index.js":430}],382:[function(require,module,exports){ (function (Buffer){ var elliptic = require('elliptic'); var BN = require('bn.js'); @@ -52077,7 +52680,7 @@ function formatReturnValue(bn, enc, len) { } }).call(this,require("buffer").Buffer) -},{"bn.js":53,"buffer":83,"elliptic":397}],382:[function(require,module,exports){ +},{"bn.js":54,"buffer":84,"elliptic":398}],383:[function(require,module,exports){ (function (Buffer){ 'use strict'; var inherits = require('inherits') @@ -52133,7 +52736,7 @@ module.exports = function createHash (alg) { } }).call(this,require("buffer").Buffer) -},{"./md5":384,"buffer":83,"cipher-base":84,"inherits":428,"ripemd160":461,"sha.js":470}],383:[function(require,module,exports){ +},{"./md5":385,"buffer":84,"cipher-base":85,"inherits":429,"ripemd160":461,"sha.js":470}],384:[function(require,module,exports){ (function (Buffer){ 'use strict'; var intSize = 4; @@ -52170,7 +52773,7 @@ function hash(buf, fn, hashSize, bigEndian) { } exports.hash = hash; }).call(this,require("buffer").Buffer) -},{"buffer":83}],384:[function(require,module,exports){ +},{"buffer":84}],385:[function(require,module,exports){ 'use strict'; /* * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message @@ -52327,7 +52930,7 @@ function bit_rol(num, cnt) module.exports = function md5(buf) { return helpers.hash(buf, core_md5, 16); }; -},{"./helpers":383}],385:[function(require,module,exports){ +},{"./helpers":384}],386:[function(require,module,exports){ (function (Buffer){ 'use strict'; var createHash = require('create-hash/browser'); @@ -52399,7 +53002,7 @@ module.exports = function createHmac(alg, key) { } }).call(this,require("buffer").Buffer) -},{"buffer":83,"create-hash/browser":382,"inherits":428,"stream":477}],386:[function(require,module,exports){ +},{"buffer":84,"create-hash/browser":383,"inherits":429,"stream":477}],387:[function(require,module,exports){ 'use strict' exports.randomBytes = exports.rng = exports.pseudoRandomBytes = exports.prng = require('randombytes') @@ -52478,7 +53081,7 @@ var publicEncrypt = require('public-encrypt') } }) -},{"browserify-cipher":71,"browserify-sign":77,"browserify-sign/algos":76,"create-ecdh":381,"create-hash":382,"create-hmac":385,"diffie-hellman":393,"pbkdf2":440,"public-encrypt":443,"randombytes":449}],387:[function(require,module,exports){ +},{"browserify-cipher":72,"browserify-sign":78,"browserify-sign/algos":77,"create-ecdh":382,"create-hash":383,"create-hmac":386,"diffie-hellman":394,"pbkdf2":441,"public-encrypt":444,"randombytes":450}],388:[function(require,module,exports){ 'use strict'; exports.utils = require('./des/utils'); @@ -52487,7 +53090,7 @@ exports.DES = require('./des/des'); exports.CBC = require('./des/cbc'); exports.EDE = require('./des/ede'); -},{"./des/cbc":388,"./des/cipher":389,"./des/des":390,"./des/ede":391,"./des/utils":392}],388:[function(require,module,exports){ +},{"./des/cbc":389,"./des/cipher":390,"./des/des":391,"./des/ede":392,"./des/utils":393}],389:[function(require,module,exports){ 'use strict'; var assert = require('minimalistic-assert'); @@ -52554,7 +53157,7 @@ proto._update = function _update(inp, inOff, out, outOff) { } }; -},{"inherits":428,"minimalistic-assert":435}],389:[function(require,module,exports){ +},{"inherits":429,"minimalistic-assert":436}],390:[function(require,module,exports){ 'use strict'; var assert = require('minimalistic-assert'); @@ -52697,7 +53300,7 @@ Cipher.prototype._finalDecrypt = function _finalDecrypt() { return this._unpad(out); }; -},{"minimalistic-assert":435}],390:[function(require,module,exports){ +},{"minimalistic-assert":436}],391:[function(require,module,exports){ 'use strict'; var assert = require('minimalistic-assert'); @@ -52842,7 +53445,7 @@ DES.prototype._decrypt = function _decrypt(state, lStart, rStart, out, off) { utils.rip(l, r, out, off); }; -},{"../des":387,"inherits":428,"minimalistic-assert":435}],391:[function(require,module,exports){ +},{"../des":388,"inherits":429,"minimalistic-assert":436}],392:[function(require,module,exports){ 'use strict'; var assert = require('minimalistic-assert'); @@ -52899,7 +53502,7 @@ EDE.prototype._update = function _update(inp, inOff, out, outOff) { EDE.prototype._pad = DES.prototype._pad; EDE.prototype._unpad = DES.prototype._unpad; -},{"../des":387,"inherits":428,"minimalistic-assert":435}],392:[function(require,module,exports){ +},{"../des":388,"inherits":429,"minimalistic-assert":436}],393:[function(require,module,exports){ 'use strict'; exports.readUInt32BE = function readUInt32BE(bytes, off) { @@ -53157,7 +53760,7 @@ exports.padSplit = function padSplit(num, size, group) { return out.join(' '); }; -},{}],393:[function(require,module,exports){ +},{}],394:[function(require,module,exports){ (function (Buffer){ var generatePrime = require('./lib/generatePrime') var primes = require('./lib/primes.json') @@ -53203,7 +53806,7 @@ exports.DiffieHellmanGroup = exports.createDiffieHellmanGroup = exports.getDiffi exports.createDiffieHellman = exports.DiffieHellman = createDiffieHellman }).call(this,require("buffer").Buffer) -},{"./lib/dh":394,"./lib/generatePrime":395,"./lib/primes.json":396,"buffer":83}],394:[function(require,module,exports){ +},{"./lib/dh":395,"./lib/generatePrime":396,"./lib/primes.json":397,"buffer":84}],395:[function(require,module,exports){ (function (Buffer){ var BN = require('bn.js'); var MillerRabin = require('miller-rabin'); @@ -53371,7 +53974,7 @@ function formatReturnValue(bn, enc) { } }).call(this,require("buffer").Buffer) -},{"./generatePrime":395,"bn.js":53,"buffer":83,"miller-rabin":434,"randombytes":449}],395:[function(require,module,exports){ +},{"./generatePrime":396,"bn.js":54,"buffer":84,"miller-rabin":435,"randombytes":450}],396:[function(require,module,exports){ var randomBytes = require('randombytes'); module.exports = findPrime; findPrime.simpleSieve = simpleSieve; @@ -53478,7 +54081,7 @@ function findPrime(bits, gen) { } -},{"bn.js":53,"miller-rabin":434,"randombytes":449}],396:[function(require,module,exports){ +},{"bn.js":54,"miller-rabin":435,"randombytes":450}],397:[function(require,module,exports){ module.exports={ "modp1": { "gen": "02", @@ -53513,7 +54116,7 @@ module.exports={ "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff" } } -},{}],397:[function(require,module,exports){ +},{}],398:[function(require,module,exports){ 'use strict'; var elliptic = exports; @@ -53529,7 +54132,7 @@ elliptic.curves = require('./elliptic/curves'); elliptic.ec = require('./elliptic/ec'); elliptic.eddsa = require('./elliptic/eddsa'); -},{"../package.json":413,"./elliptic/curve":400,"./elliptic/curves":403,"./elliptic/ec":404,"./elliptic/eddsa":407,"./elliptic/hmac-drbg":410,"./elliptic/utils":412,"brorand":54}],398:[function(require,module,exports){ +},{"../package.json":414,"./elliptic/curve":401,"./elliptic/curves":404,"./elliptic/ec":405,"./elliptic/eddsa":408,"./elliptic/hmac-drbg":411,"./elliptic/utils":413,"brorand":55}],399:[function(require,module,exports){ 'use strict'; var BN = require('bn.js'); @@ -53882,7 +54485,7 @@ BasePoint.prototype.dblp = function dblp(k) { return r; }; -},{"../../elliptic":397,"bn.js":53}],399:[function(require,module,exports){ +},{"../../elliptic":398,"bn.js":54}],400:[function(require,module,exports){ 'use strict'; var curve = require('../curve'); @@ -54294,7 +54897,7 @@ Point.prototype.eq = function eq(other) { Point.prototype.toP = Point.prototype.normalize; Point.prototype.mixedAdd = Point.prototype.add; -},{"../../elliptic":397,"../curve":400,"bn.js":53,"inherits":428}],400:[function(require,module,exports){ +},{"../../elliptic":398,"../curve":401,"bn.js":54,"inherits":429}],401:[function(require,module,exports){ 'use strict'; var curve = exports; @@ -54304,7 +54907,7 @@ curve.short = require('./short'); curve.mont = require('./mont'); curve.edwards = require('./edwards'); -},{"./base":398,"./edwards":399,"./mont":401,"./short":402}],401:[function(require,module,exports){ +},{"./base":399,"./edwards":400,"./mont":402,"./short":403}],402:[function(require,module,exports){ 'use strict'; var curve = require('../curve'); @@ -54482,7 +55085,7 @@ Point.prototype.getX = function getX() { return this.x.fromRed(); }; -},{"../../elliptic":397,"../curve":400,"bn.js":53,"inherits":428}],402:[function(require,module,exports){ +},{"../../elliptic":398,"../curve":401,"bn.js":54,"inherits":429}],403:[function(require,module,exports){ 'use strict'; var curve = require('../curve'); @@ -55393,7 +55996,7 @@ JPoint.prototype.isInfinity = function isInfinity() { return this.z.cmpn(0) === 0; }; -},{"../../elliptic":397,"../curve":400,"bn.js":53,"inherits":428}],403:[function(require,module,exports){ +},{"../../elliptic":398,"../curve":401,"bn.js":54,"inherits":429}],404:[function(require,module,exports){ 'use strict'; var curves = exports; @@ -55600,7 +56203,7 @@ defineCurve('secp256k1', { ] }); -},{"../elliptic":397,"./precomputed/secp256k1":411,"hash.js":420}],404:[function(require,module,exports){ +},{"../elliptic":398,"./precomputed/secp256k1":412,"hash.js":421}],405:[function(require,module,exports){ 'use strict'; var BN = require('bn.js'); @@ -55824,7 +56427,7 @@ EC.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) { throw new Error('Unable to find valid recovery factor'); }; -},{"../../elliptic":397,"./key":405,"./signature":406,"bn.js":53}],405:[function(require,module,exports){ +},{"../../elliptic":398,"./key":406,"./signature":407,"bn.js":54}],406:[function(require,module,exports){ 'use strict'; var BN = require('bn.js'); @@ -55933,7 +56536,7 @@ KeyPair.prototype.inspect = function inspect() { ' pub: ' + (this.pub && this.pub.inspect()) + ' >'; }; -},{"bn.js":53}],406:[function(require,module,exports){ +},{"bn.js":54}],407:[function(require,module,exports){ 'use strict'; var BN = require('bn.js'); @@ -56070,7 +56673,7 @@ Signature.prototype.toDER = function toDER(enc) { return utils.encode(res, enc); }; -},{"../../elliptic":397,"bn.js":53}],407:[function(require,module,exports){ +},{"../../elliptic":398,"bn.js":54}],408:[function(require,module,exports){ 'use strict'; var hash = require('hash.js'); @@ -56190,7 +56793,7 @@ EDDSA.prototype.isPoint = function isPoint(val) { return val instanceof this.pointClass; }; -},{"../../elliptic":397,"./key":408,"./signature":409,"hash.js":420}],408:[function(require,module,exports){ +},{"../../elliptic":398,"./key":409,"./signature":410,"hash.js":421}],409:[function(require,module,exports){ 'use strict'; var elliptic = require('../../elliptic'); @@ -56288,7 +56891,7 @@ KeyPair.prototype.getPublic = function getPublic(enc) { module.exports = KeyPair; -},{"../../elliptic":397}],409:[function(require,module,exports){ +},{"../../elliptic":398}],410:[function(require,module,exports){ 'use strict'; var BN = require('bn.js'); @@ -56356,7 +56959,7 @@ Signature.prototype.toHex = function toHex() { module.exports = Signature; -},{"../../elliptic":397,"bn.js":53}],410:[function(require,module,exports){ +},{"../../elliptic":398,"bn.js":54}],411:[function(require,module,exports){ 'use strict'; var hash = require('hash.js'); @@ -56472,7 +57075,7 @@ HmacDRBG.prototype.generate = function generate(len, enc, add, addEnc) { return utils.encode(res, enc); }; -},{"../elliptic":397,"hash.js":420}],411:[function(require,module,exports){ +},{"../elliptic":398,"hash.js":421}],412:[function(require,module,exports){ module.exports = { doubles: { step: 4, @@ -57254,7 +57857,7 @@ module.exports = { } }; -},{}],412:[function(require,module,exports){ +},{}],413:[function(require,module,exports){ 'use strict'; var utils = exports; @@ -57428,12 +58031,12 @@ function intFromLE(bytes) { utils.intFromLE = intFromLE; -},{"bn.js":53}],413:[function(require,module,exports){ +},{"bn.js":54}],414:[function(require,module,exports){ module.exports={ "_args": [ [ "elliptic@^6.0.0", - "/Volumes/Macintosh HD/Users/TayTay/Documents/Dropbox/local-dev/etherwallet/node_modules/browserify-sign" + "C:\\Users\\Kosala\\Documents\\GitHub\\etherwallet\\node_modules\\browserify-sign" ] ], "_from": "elliptic@>=6.0.0 <7.0.0", @@ -57469,7 +58072,7 @@ module.exports={ "_shasum": "dce82efbf176eefa7495d4be3e8b9f5b5694b295", "_shrinkwrap": null, "_spec": "elliptic@^6.0.0", - "_where": "/Volumes/Macintosh HD/Users/TayTay/Documents/Dropbox/local-dev/etherwallet/node_modules/browserify-sign", + "_where": "C:\\Users\\Kosala\\Documents\\GitHub\\etherwallet\\node_modules\\browserify-sign", "author": { "email": "fedor@indutny.com", "name": "Fedor Indutny" @@ -57541,7 +58144,7 @@ module.exports={ "version": "6.2.7" } -},{}],414:[function(require,module,exports){ +},{}],415:[function(require,module,exports){ module.exports={ "genesisGasLimit": { "v": 5000, @@ -57774,10 +58377,10 @@ module.exports={ } } -},{}],415:[function(require,module,exports){ +},{}],416:[function(require,module,exports){ module.exports = require('./params.json') -},{"./params.json":414}],416:[function(require,module,exports){ +},{"./params.json":415}],417:[function(require,module,exports){ (function (global,Buffer){ const ethUtil = require('ethereumjs-util') const fees = require('ethereum-common/params') @@ -58037,7 +58640,7 @@ Transaction.prototype.validate = function (stringError) { } }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer) -},{"buffer":83,"ethereum-common/params":415,"ethereumjs-util":417}],417:[function(require,module,exports){ +},{"buffer":84,"ethereum-common/params":416,"ethereumjs-util":418}],418:[function(require,module,exports){ (function (Buffer){ const SHA3 = require('keccakjs') const secp256k1 = require('secp256k1') @@ -58706,7 +59309,7 @@ exports.defineProperties = function (self, fields, data) { } }).call(this,require("buffer").Buffer) -},{"assert":48,"bn.js":53,"buffer":83,"create-hash":382,"keccakjs":432,"rlp":462,"secp256k1":464}],418:[function(require,module,exports){ +},{"assert":48,"bn.js":54,"buffer":84,"create-hash":383,"keccakjs":433,"rlp":462,"secp256k1":464}],419:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -59006,7 +59609,7 @@ function isUndefined(arg) { return arg === void 0; } -},{}],419:[function(require,module,exports){ +},{}],420:[function(require,module,exports){ (function (Buffer){ var md5 = require('create-hash/md5') module.exports = EVP_BytesToKey @@ -59078,7 +59681,7 @@ function EVP_BytesToKey (password, salt, keyLen, ivLen) { } }).call(this,require("buffer").Buffer) -},{"buffer":83,"create-hash/md5":384}],420:[function(require,module,exports){ +},{"buffer":84,"create-hash/md5":385}],421:[function(require,module,exports){ var hash = exports; hash.utils = require('./hash/utils'); @@ -59095,7 +59698,7 @@ hash.sha384 = hash.sha.sha384; hash.sha512 = hash.sha.sha512; hash.ripemd160 = hash.ripemd.ripemd160; -},{"./hash/common":421,"./hash/hmac":422,"./hash/ripemd":423,"./hash/sha":424,"./hash/utils":425}],421:[function(require,module,exports){ +},{"./hash/common":422,"./hash/hmac":423,"./hash/ripemd":424,"./hash/sha":425,"./hash/utils":426}],422:[function(require,module,exports){ var hash = require('../hash'); var utils = hash.utils; var assert = utils.assert; @@ -59188,7 +59791,7 @@ BlockHash.prototype._pad = function pad() { return res; }; -},{"../hash":420}],422:[function(require,module,exports){ +},{"../hash":421}],423:[function(require,module,exports){ var hmac = exports; var hash = require('../hash'); @@ -59238,7 +59841,7 @@ Hmac.prototype.digest = function digest(enc) { return this.outer.digest(enc); }; -},{"../hash":420}],423:[function(require,module,exports){ +},{"../hash":421}],424:[function(require,module,exports){ var hash = require('../hash'); var utils = hash.utils; @@ -59384,7 +59987,7 @@ var sh = [ 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 ]; -},{"../hash":420}],424:[function(require,module,exports){ +},{"../hash":421}],425:[function(require,module,exports){ var hash = require('../hash'); var utils = hash.utils; var assert = utils.assert; @@ -59950,7 +60553,7 @@ function g1_512_lo(xh, xl) { return r; } -},{"../hash":420}],425:[function(require,module,exports){ +},{"../hash":421}],426:[function(require,module,exports){ var utils = exports; var inherits = require('inherits'); @@ -60209,7 +60812,7 @@ function shr64_lo(ah, al, num) { }; exports.shr64_lo = shr64_lo; -},{"inherits":428}],426:[function(require,module,exports){ +},{"inherits":429}],427:[function(require,module,exports){ exports.read = function (buffer, offset, isLE, mLen, nBytes) { var e, m var eLen = nBytes * 8 - mLen - 1 @@ -60295,7 +60898,7 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { buffer[offset + i - d] |= s * 128 } -},{}],427:[function(require,module,exports){ +},{}],428:[function(require,module,exports){ var indexOf = [].indexOf; @@ -60306,7 +60909,7 @@ module.exports = function(arr, obj){ } return -1; }; -},{}],428:[function(require,module,exports){ +},{}],429:[function(require,module,exports){ if (typeof Object.create === 'function') { // implementation from standard node.js 'util' module module.exports = function inherits(ctor, superCtor) { @@ -60331,7 +60934,7 @@ if (typeof Object.create === 'function') { } } -},{}],429:[function(require,module,exports){ +},{}],430:[function(require,module,exports){ /** * Determine if an object is Buffer * @@ -60350,14 +60953,14 @@ module.exports = function (obj) { )) } -},{}],430:[function(require,module,exports){ +},{}],431:[function(require,module,exports){ var toString = {}.toString; module.exports = Array.isArray || function (arr) { return toString.call(arr) == '[object Array]'; }; -},{}],431:[function(require,module,exports){ +},{}],432:[function(require,module,exports){ (function (global){ /* * js-sha3 v0.3.1 @@ -60793,10 +61396,10 @@ module.exports = Array.isArray || function (arr) { }(this)); }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],432:[function(require,module,exports){ +},{}],433:[function(require,module,exports){ module.exports = require('browserify-sha3').SHA3Hash -},{"browserify-sha3":75}],433:[function(require,module,exports){ +},{"browserify-sha3":76}],434:[function(require,module,exports){ (function (global){ /** * marked - a markdown parser @@ -62085,7 +62688,7 @@ if (typeof module !== 'undefined' && typeof exports === 'object') { }()); }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],434:[function(require,module,exports){ +},{}],435:[function(require,module,exports){ var bn = require('bn.js'); var brorand = require('brorand'); @@ -62200,7 +62803,7 @@ MillerRabin.prototype.getDivisor = function getDivisor(n, k) { return false; }; -},{"bn.js":53,"brorand":54}],435:[function(require,module,exports){ +},{"bn.js":54,"brorand":55}],436:[function(require,module,exports){ module.exports = assert; function assert(val, msg) { @@ -62213,7 +62816,7 @@ assert.equal = function assertEqual(l, r, msg) { throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r)); }; -},{}],436:[function(require,module,exports){ +},{}],437:[function(require,module,exports){ module.exports={"2.16.840.1.101.3.4.1.1": "aes-128-ecb", "2.16.840.1.101.3.4.1.2": "aes-128-cbc", "2.16.840.1.101.3.4.1.3": "aes-128-ofb", @@ -62227,7 +62830,7 @@ module.exports={"2.16.840.1.101.3.4.1.1": "aes-128-ecb", "2.16.840.1.101.3.4.1.43": "aes-256-ofb", "2.16.840.1.101.3.4.1.44": "aes-256-cfb" } -},{}],437:[function(require,module,exports){ +},{}],438:[function(require,module,exports){ // from https://github.com/indutny/self-signed/blob/gh-pages/lib/asn1.js // Fedor, you are amazing. @@ -62346,7 +62949,7 @@ exports.signature = asn1.define('signature', function () { ) }) -},{"asn1.js":34}],438:[function(require,module,exports){ +},{"asn1.js":34}],439:[function(require,module,exports){ (function (Buffer){ // adapted from https://github.com/apatil/pemstrip var findProc = /Proc-Type: 4,ENCRYPTED\r?\nDEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)\r?\n\r?\n([0-9A-z\n\r\+\/\=]+)\r?\n/m @@ -62380,7 +62983,7 @@ module.exports = function (okey, password) { } }).call(this,require("buffer").Buffer) -},{"browserify-aes":58,"buffer":83,"evp_bytestokey":419}],439:[function(require,module,exports){ +},{"browserify-aes":59,"buffer":84,"evp_bytestokey":420}],440:[function(require,module,exports){ (function (Buffer){ var asn1 = require('./asn1') var aesid = require('./aesid.json') @@ -62485,7 +63088,7 @@ function decrypt (data, password) { } }).call(this,require("buffer").Buffer) -},{"./aesid.json":436,"./asn1":437,"./fixProc":438,"browserify-aes":58,"buffer":83,"pbkdf2":440}],440:[function(require,module,exports){ +},{"./aesid.json":437,"./asn1":438,"./fixProc":439,"browserify-aes":59,"buffer":84,"pbkdf2":441}],441:[function(require,module,exports){ (function (Buffer){ var createHmac = require('create-hmac') var MAX_ALLOC = Math.pow(2, 30) - 1 // default in iojs @@ -62569,7 +63172,7 @@ function pbkdf2Sync (password, salt, iterations, keylen, digest) { } }).call(this,require("buffer").Buffer) -},{"buffer":83,"create-hmac":385}],441:[function(require,module,exports){ +},{"buffer":84,"create-hmac":386}],442:[function(require,module,exports){ (function (process){ 'use strict'; @@ -62616,7 +63219,7 @@ function nextTick(fn, arg1, arg2, arg3) { } }).call(this,require('_process')) -},{"_process":442}],442:[function(require,module,exports){ +},{"_process":443}],443:[function(require,module,exports){ // shim for using process in browser var process = module.exports = {}; @@ -62712,7 +63315,7 @@ process.chdir = function (dir) { }; process.umask = function() { return 0; }; -},{}],443:[function(require,module,exports){ +},{}],444:[function(require,module,exports){ exports.publicEncrypt = require('./publicEncrypt'); exports.privateDecrypt = require('./privateDecrypt'); @@ -62723,7 +63326,7 @@ exports.privateEncrypt = function privateEncrypt(key, buf) { exports.publicDecrypt = function publicDecrypt(key, buf) { return exports.privateDecrypt(key, buf, true); }; -},{"./privateDecrypt":445,"./publicEncrypt":446}],444:[function(require,module,exports){ +},{"./privateDecrypt":446,"./publicEncrypt":447}],445:[function(require,module,exports){ (function (Buffer){ var createHash = require('create-hash'); module.exports = function (seed, len) { @@ -62742,7 +63345,7 @@ function i2ops(c) { return out; } }).call(this,require("buffer").Buffer) -},{"buffer":83,"create-hash":382}],445:[function(require,module,exports){ +},{"buffer":84,"create-hash":383}],446:[function(require,module,exports){ (function (Buffer){ var parseKeys = require('parse-asn1'); var mgf = require('./mgf'); @@ -62853,7 +63456,7 @@ function compare(a, b){ return dif; } }).call(this,require("buffer").Buffer) -},{"./mgf":444,"./withPublic":447,"./xor":448,"bn.js":53,"browserify-rsa":74,"buffer":83,"create-hash":382,"parse-asn1":439}],446:[function(require,module,exports){ +},{"./mgf":445,"./withPublic":448,"./xor":449,"bn.js":54,"browserify-rsa":75,"buffer":84,"create-hash":383,"parse-asn1":440}],447:[function(require,module,exports){ (function (Buffer){ var parseKeys = require('parse-asn1'); var randomBytes = require('randombytes'); @@ -62927,2506 +63530,1834 @@ function pkcs1(key, msg, reverse){ if (reverse) { ps = new Buffer(k - mLen - 3); ps.fill(0xff); - } else { - ps = nonZero(k - mLen - 3); - } - return new bn(Buffer.concat([new Buffer([0, reverse?1:2]), ps, new Buffer([0]), msg], k)); -} -function nonZero(len, crypto) { - var out = new Buffer(len); - var i = 0; - var cache = randomBytes(len*2); - var cur = 0; - var num; - while (i < len) { - if (cur === cache.length) { - cache = randomBytes(len*2); - cur = 0; - } - num = cache[cur++]; - if (num) { - out[i++] = num; - } - } - return out; -} -}).call(this,require("buffer").Buffer) -},{"./mgf":444,"./withPublic":447,"./xor":448,"bn.js":53,"browserify-rsa":74,"buffer":83,"create-hash":382,"parse-asn1":439,"randombytes":449}],447:[function(require,module,exports){ -(function (Buffer){ -var bn = require('bn.js'); -function withPublic(paddedMsg, key) { - return new Buffer(paddedMsg - .toRed(bn.mont(key.modulus)) - .redPow(new bn(key.publicExponent)) - .fromRed() - .toArray()); -} - -module.exports = withPublic; -}).call(this,require("buffer").Buffer) -},{"bn.js":53,"buffer":83}],448:[function(require,module,exports){ -module.exports = function xor(a, b) { - var len = a.length; - var i = -1; - while (++i < len) { - a[i] ^= b[i]; - } - return a -}; -},{}],449:[function(require,module,exports){ -(function (process,global,Buffer){ -'use strict' - -function oldBrowser () { - throw new Error('secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11') -} - -var crypto = global.crypto || global.msCrypto - -if (crypto && crypto.getRandomValues) { - module.exports = randomBytes -} else { - module.exports = oldBrowser -} - -function randomBytes (size, cb) { - // phantomjs needs to throw - if (size > 65536) throw new Error('requested too many random bytes') - // in case browserify isn't using the Uint8Array version - var rawBytes = new global.Uint8Array(size) - - // This will not work in older browsers. - // See https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues - if (size > 0) { // getRandomValues fails on IE if size == 0 - crypto.getRandomValues(rawBytes) - } - // phantomjs doesn't like a buffer being passed here - var bytes = new Buffer(rawBytes.buffer) - - if (typeof cb === 'function') { - return process.nextTick(function () { - cb(null, bytes) - }) - } - - return bytes -} - -}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer) -},{"_process":442,"buffer":83}],450:[function(require,module,exports){ -module.exports = require("./lib/_stream_duplex.js") - -},{"./lib/_stream_duplex.js":451}],451:[function(require,module,exports){ -// a duplex stream is just a stream that is both readable and writable. -// Since JS doesn't have multiple prototypal inheritance, this class -// prototypally inherits from Readable, and then parasitically from -// Writable. - -'use strict'; - -/**/ - -var objectKeys = Object.keys || function (obj) { - var keys = []; - for (var key in obj) { - keys.push(key); - }return keys; -}; -/**/ - -module.exports = Duplex; - -/**/ -var processNextTick = require('process-nextick-args'); -/**/ - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -var Readable = require('./_stream_readable'); -var Writable = require('./_stream_writable'); - -util.inherits(Duplex, Readable); - -var keys = objectKeys(Writable.prototype); -for (var v = 0; v < keys.length; v++) { - var method = keys[v]; - if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; -} - -function Duplex(options) { - if (!(this instanceof Duplex)) return new Duplex(options); - - Readable.call(this, options); - Writable.call(this, options); - - if (options && options.readable === false) this.readable = false; - - if (options && options.writable === false) this.writable = false; - - this.allowHalfOpen = true; - if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; - - this.once('end', onend); -} - -// the no-half-open enforcer -function onend() { - // if we allow half-open state, or if the writable side ended, - // then we're ok. - if (this.allowHalfOpen || this._writableState.ended) return; - - // no more data can be written. - // But allow more writes to happen in this tick. - processNextTick(onEndNT, this); -} - -function onEndNT(self) { - self.end(); -} - -function forEach(xs, f) { - for (var i = 0, l = xs.length; i < l; i++) { - f(xs[i], i); - } -} -},{"./_stream_readable":453,"./_stream_writable":455,"core-util-is":380,"inherits":428,"process-nextick-args":441}],452:[function(require,module,exports){ -// a passthrough stream. -// basically just the most minimal sort of Transform stream. -// Every written chunk gets output as-is. - -'use strict'; - -module.exports = PassThrough; - -var Transform = require('./_stream_transform'); - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -util.inherits(PassThrough, Transform); - -function PassThrough(options) { - if (!(this instanceof PassThrough)) return new PassThrough(options); - - Transform.call(this, options); -} - -PassThrough.prototype._transform = function (chunk, encoding, cb) { - cb(null, chunk); -}; -},{"./_stream_transform":454,"core-util-is":380,"inherits":428}],453:[function(require,module,exports){ -(function (process){ -'use strict'; - -module.exports = Readable; - -/**/ -var processNextTick = require('process-nextick-args'); -/**/ - -/**/ -var isArray = require('isarray'); -/**/ - -Readable.ReadableState = ReadableState; - -/**/ -var EE = require('events').EventEmitter; - -var EElistenerCount = function (emitter, type) { - return emitter.listeners(type).length; -}; -/**/ - -/**/ -var Stream; -(function () { - try { - Stream = require('st' + 'ream'); - } catch (_) {} finally { - if (!Stream) Stream = require('events').EventEmitter; - } -})(); -/**/ - -var Buffer = require('buffer').Buffer; -/**/ -var bufferShim = require('buffer-shims'); -/**/ - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -/**/ -var debugUtil = require('util'); -var debug = void 0; -if (debugUtil && debugUtil.debuglog) { - debug = debugUtil.debuglog('stream'); -} else { - debug = function () {}; -} -/**/ - -var StringDecoder; - -util.inherits(Readable, Stream); - -var hasPrependListener = typeof EE.prototype.prependListener === 'function'; - -function prependListener(emitter, event, fn) { - if (hasPrependListener) return emitter.prependListener(event, fn); - - // This is a brutally ugly hack to make sure that our error handler - // is attached before any userland ones. NEVER DO THIS. This is here - // only because this code needs to continue to work with older versions - // of Node.js that do not include the prependListener() method. The goal - // is to eventually remove this hack. - if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; -} - -var Duplex; -function ReadableState(options, stream) { - Duplex = Duplex || require('./_stream_duplex'); - - options = options || {}; - - // object stream flag. Used to make read(n) ignore n and to - // make all the buffer merging and length checks go away - this.objectMode = !!options.objectMode; - - if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode; - - // the point at which it stops calling _read() to fill the buffer - // Note: 0 is a valid value, means "don't call _read preemptively ever" - var hwm = options.highWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; - - // cast to ints. - this.highWaterMark = ~ ~this.highWaterMark; - - this.buffer = []; - this.length = 0; - this.pipes = null; - this.pipesCount = 0; - this.flowing = null; - this.ended = false; - this.endEmitted = false; - this.reading = false; - - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; - - // whenever we return null, then we set a flag to say - // that we're awaiting a 'readable' event emission. - this.needReadable = false; - this.emittedReadable = false; - this.readableListening = false; - this.resumeScheduled = false; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // when piping, we only care about 'readable' events that happen - // after read()ing all the bytes and not getting any pushback. - this.ranOut = false; - - // the number of writers that are awaiting a drain event in .pipe()s - this.awaitDrain = 0; - - // if true, a maybeReadMore has been scheduled - this.readingMore = false; - - this.decoder = null; - this.encoding = null; - if (options.encoding) { - if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; - this.decoder = new StringDecoder(options.encoding); - this.encoding = options.encoding; - } -} - -var Duplex; -function Readable(options) { - Duplex = Duplex || require('./_stream_duplex'); - - if (!(this instanceof Readable)) return new Readable(options); - - this._readableState = new ReadableState(options, this); - - // legacy - this.readable = true; - - if (options && typeof options.read === 'function') this._read = options.read; - - Stream.call(this); -} - -// Manually shove something into the read() buffer. -// This returns true if the highWaterMark has not been hit yet, -// similar to how Writable.write() returns true if you should -// write() some more. -Readable.prototype.push = function (chunk, encoding) { - var state = this._readableState; - - if (!state.objectMode && typeof chunk === 'string') { - encoding = encoding || state.defaultEncoding; - if (encoding !== state.encoding) { - chunk = bufferShim.from(chunk, encoding); - encoding = ''; - } - } - - return readableAddChunk(this, state, chunk, encoding, false); -}; - -// Unshift should *always* be something directly out of read() -Readable.prototype.unshift = function (chunk) { - var state = this._readableState; - return readableAddChunk(this, state, chunk, '', true); -}; - -Readable.prototype.isPaused = function () { - return this._readableState.flowing === false; -}; - -function readableAddChunk(stream, state, chunk, encoding, addToFront) { - var er = chunkInvalid(state, chunk); - if (er) { - stream.emit('error', er); - } else if (chunk === null) { - state.reading = false; - onEofChunk(stream, state); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (state.ended && !addToFront) { - var e = new Error('stream.push() after EOF'); - stream.emit('error', e); - } else if (state.endEmitted && addToFront) { - var _e = new Error('stream.unshift() after end event'); - stream.emit('error', _e); - } else { - var skipAdd; - if (state.decoder && !addToFront && !encoding) { - chunk = state.decoder.write(chunk); - skipAdd = !state.objectMode && chunk.length === 0; - } - - if (!addToFront) state.reading = false; - - // Don't add to the buffer if we've decoded to an empty string chunk and - // we're not in object mode - if (!skipAdd) { - // if we want the data now, just emit it. - if (state.flowing && state.length === 0 && !state.sync) { - stream.emit('data', chunk); - stream.read(0); - } else { - // update the buffer info. - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); - - if (state.needReadable) emitReadable(stream); - } - } - - maybeReadMore(stream, state); - } - } else if (!addToFront) { - state.reading = false; - } - - return needMoreData(state); -} - -// if it's past the high water mark, we can push in some more. -// Also, if we have no data yet, we can stand some -// more bytes. This is to work around cases where hwm=0, -// such as the repl. Also, if the push() triggered a -// readable event, and the user called read(largeNumber) such that -// needReadable was set, then we ought to push more, so that another -// 'readable' event will be triggered. -function needMoreData(state) { - return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); -} - -// backwards compatibility. -Readable.prototype.setEncoding = function (enc) { - if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; - this._readableState.decoder = new StringDecoder(enc); - this._readableState.encoding = enc; - return this; -}; - -// Don't raise the hwm > 8MB -var MAX_HWM = 0x800000; -function computeNewHighWaterMark(n) { - if (n >= MAX_HWM) { - n = MAX_HWM; - } else { - // Get the next highest power of 2 - n--; - n |= n >>> 1; - n |= n >>> 2; - n |= n >>> 4; - n |= n >>> 8; - n |= n >>> 16; - n++; + } else { + ps = nonZero(k - mLen - 3); } - return n; + return new bn(Buffer.concat([new Buffer([0, reverse?1:2]), ps, new Buffer([0]), msg], k)); } - -function howMuchToRead(n, state) { - if (state.length === 0 && state.ended) return 0; - - if (state.objectMode) return n === 0 ? 0 : 1; - - if (n === null || isNaN(n)) { - // only flow one buffer at a time - if (state.flowing && state.buffer.length) return state.buffer[0].length;else return state.length; +function nonZero(len, crypto) { + var out = new Buffer(len); + var i = 0; + var cache = randomBytes(len*2); + var cur = 0; + var num; + while (i < len) { + if (cur === cache.length) { + cache = randomBytes(len*2); + cur = 0; + } + num = cache[cur++]; + if (num) { + out[i++] = num; + } } + return out; +} +}).call(this,require("buffer").Buffer) +},{"./mgf":445,"./withPublic":448,"./xor":449,"bn.js":54,"browserify-rsa":75,"buffer":84,"create-hash":383,"parse-asn1":440,"randombytes":450}],448:[function(require,module,exports){ +(function (Buffer){ +var bn = require('bn.js'); +function withPublic(paddedMsg, key) { + return new Buffer(paddedMsg + .toRed(bn.mont(key.modulus)) + .redPow(new bn(key.publicExponent)) + .fromRed() + .toArray()); +} - if (n <= 0) return 0; +module.exports = withPublic; +}).call(this,require("buffer").Buffer) +},{"bn.js":54,"buffer":84}],449:[function(require,module,exports){ +module.exports = function xor(a, b) { + var len = a.length; + var i = -1; + while (++i < len) { + a[i] ^= b[i]; + } + return a +}; +},{}],450:[function(require,module,exports){ +(function (process,global,Buffer){ +'use strict' - // If we're asking for more than the target buffer level, - // then raise the water mark. Bump up to the next highest - // power of 2, to prevent increasing it excessively in tiny - // amounts. - if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); +function oldBrowser () { + throw new Error('secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11') +} - // don't have that much. return null, unless we've ended. - if (n > state.length) { - if (!state.ended) { - state.needReadable = true; - return 0; - } else { - return state.length; - } - } +var crypto = global.crypto || global.msCrypto - return n; +if (crypto && crypto.getRandomValues) { + module.exports = randomBytes +} else { + module.exports = oldBrowser } -// you can override either this method, or the async _read(n) below. -Readable.prototype.read = function (n) { - debug('read', n); - var state = this._readableState; - var nOrig = n; +function randomBytes (size, cb) { + // phantomjs needs to throw + if (size > 65536) throw new Error('requested too many random bytes') + // in case browserify isn't using the Uint8Array version + var rawBytes = new global.Uint8Array(size) - if (typeof n !== 'number' || n > 0) state.emittedReadable = false; + // This will not work in older browsers. + // See https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues + if (size > 0) { // getRandomValues fails on IE if size == 0 + crypto.getRandomValues(rawBytes) + } + // phantomjs doesn't like a buffer being passed here + var bytes = new Buffer(rawBytes.buffer) - // if we're doing read(0) to trigger a readable event, but we - // already have a bunch of data in the buffer, then just trigger - // the 'readable' event and move on. - if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { - debug('read: emitReadable', state.length, state.ended); - if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); - return null; + if (typeof cb === 'function') { + return process.nextTick(function () { + cb(null, bytes) + }) } - n = howMuchToRead(n, state); + return bytes +} - // if we've ended, and we're now clear, then finish it up. - if (n === 0 && state.ended) { - if (state.length === 0) endReadable(this); - return null; - } +}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer) +},{"_process":443,"buffer":84}],451:[function(require,module,exports){ +module.exports = require("./lib/_stream_duplex.js") - // All the actual chunk generation logic needs to be - // *below* the call to _read. The reason is that in certain - // synthetic stream cases, such as passthrough streams, _read - // may be a completely synchronous operation which may change - // the state of the read buffer, providing enough data when - // before there was *not* enough. - // - // So, the steps are: - // 1. Figure out what the state of things will be after we do - // a read from the buffer. - // - // 2. If that resulting state will trigger a _read, then call _read. - // Note that this may be asynchronous, or synchronous. Yes, it is - // deeply ugly to write APIs this way, but that still doesn't mean - // that the Readable class should behave improperly, as streams are - // designed to be sync/async agnostic. - // Take note if the _read call is sync or async (ie, if the read call - // has returned yet), so that we know whether or not it's safe to emit - // 'readable' etc. - // - // 3. Actually pull the requested chunks out of the buffer and return. +},{"./lib/_stream_duplex.js":452}],452:[function(require,module,exports){ +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. - // if we need a readable event, then we need to do some reading. - var doRead = state.needReadable; - debug('need readable', doRead); +'use strict'; - // if we currently have less than the highWaterMark, then also read some - if (state.length === 0 || state.length - n < state.highWaterMark) { - doRead = true; - debug('length less than watermark', doRead); - } +/**/ - // however, if we've ended, then there's no point, and if we're already - // reading, then it's unnecessary. - if (state.ended || state.reading) { - doRead = false; - debug('reading or ended', doRead); - } +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) { + keys.push(key); + }return keys; +}; +/**/ - if (doRead) { - debug('do read'); - state.reading = true; - state.sync = true; - // if the length is currently zero, then we *need* a readable event. - if (state.length === 0) state.needReadable = true; - // call internal read method - this._read(state.highWaterMark); - state.sync = false; - } +module.exports = Duplex; - // If _read pushed data synchronously, then `reading` will be false, - // and we need to re-evaluate how much data we can return to the user. - if (doRead && !state.reading) n = howMuchToRead(nOrig, state); +/**/ +var processNextTick = require('process-nextick-args'); +/**/ - var ret; - if (n > 0) ret = fromList(n, state);else ret = null; +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ - if (ret === null) { - state.needReadable = true; - n = 0; - } +var Readable = require('./_stream_readable'); +var Writable = require('./_stream_writable'); - state.length -= n; +util.inherits(Duplex, Readable); - // If we have nothing in the buffer, then we want to know - // as soon as we *do* get something into the buffer. - if (state.length === 0 && !state.ended) state.needReadable = true; +var keys = objectKeys(Writable.prototype); +for (var v = 0; v < keys.length; v++) { + var method = keys[v]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; +} - // If we tried to read() past the EOF, then emit end on the next tick. - if (nOrig !== n && state.ended && state.length === 0) endReadable(this); +function Duplex(options) { + if (!(this instanceof Duplex)) return new Duplex(options); - if (ret !== null) this.emit('data', ret); + Readable.call(this, options); + Writable.call(this, options); - return ret; -}; + if (options && options.readable === false) this.readable = false; -function chunkInvalid(state, chunk) { - var er = null; - if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - return er; -} + if (options && options.writable === false) this.writable = false; -function onEofChunk(stream, state) { - if (state.ended) return; - if (state.decoder) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; - } - } - state.ended = true; + this.allowHalfOpen = true; + if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; - // emit 'readable' now to make sure it gets picked up. - emitReadable(stream); + this.once('end', onend); } -// Don't emit readable right away in sync mode, because this can trigger -// another read() call => stack overflow. This way, it might trigger -// a nextTick recursion warning, but that's not so bad. -function emitReadable(stream) { - var state = stream._readableState; - state.needReadable = false; - if (!state.emittedReadable) { - debug('emitReadable', state.flowing); - state.emittedReadable = true; - if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream); - } -} +// the no-half-open enforcer +function onend() { + // if we allow half-open state, or if the writable side ended, + // then we're ok. + if (this.allowHalfOpen || this._writableState.ended) return; -function emitReadable_(stream) { - debug('emit readable'); - stream.emit('readable'); - flow(stream); + // no more data can be written. + // But allow more writes to happen in this tick. + processNextTick(onEndNT, this); } -// at this point, the user has presumably seen the 'readable' event, -// and called read() to consume some data. that may have triggered -// in turn another _read(n) call, in which case reading = true if -// it's in progress. -// However, if we're not ended, or reading, and the length < hwm, -// then go ahead and try to read some more preemptively. -function maybeReadMore(stream, state) { - if (!state.readingMore) { - state.readingMore = true; - processNextTick(maybeReadMore_, stream, state); - } +function onEndNT(self) { + self.end(); } -function maybeReadMore_(stream, state) { - var len = state.length; - while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { - debug('maybeReadMore read 0'); - stream.read(0); - if (len === state.length) - // didn't get any data, stop spinning. - break;else len = state.length; +function forEach(xs, f) { + for (var i = 0, l = xs.length; i < l; i++) { + f(xs[i], i); } - state.readingMore = false; } +},{"./_stream_readable":454,"./_stream_writable":456,"core-util-is":381,"inherits":429,"process-nextick-args":442}],453:[function(require,module,exports){ +// a passthrough stream. +// basically just the most minimal sort of Transform stream. +// Every written chunk gets output as-is. -// abstract method. to be overridden in specific implementation classes. -// call cb(er, data) where data is <= n in length. -// for virtual (non-string, non-buffer) streams, "length" is somewhat -// arbitrary, and perhaps not very meaningful. -Readable.prototype._read = function (n) { - this.emit('error', new Error('not implemented')); -}; - -Readable.prototype.pipe = function (dest, pipeOpts) { - var src = this; - var state = this._readableState; +'use strict'; - switch (state.pipesCount) { - case 0: - state.pipes = dest; - break; - case 1: - state.pipes = [state.pipes, dest]; - break; - default: - state.pipes.push(dest); - break; - } - state.pipesCount += 1; - debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); +module.exports = PassThrough; - var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; +var Transform = require('./_stream_transform'); - var endFn = doEnd ? onend : cleanup; - if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn); +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ - dest.on('unpipe', onunpipe); - function onunpipe(readable) { - debug('onunpipe'); - if (readable === src) { - cleanup(); - } - } +util.inherits(PassThrough, Transform); - function onend() { - debug('onend'); - dest.end(); - } +function PassThrough(options) { + if (!(this instanceof PassThrough)) return new PassThrough(options); - // when the dest drains, it reduces the awaitDrain counter - // on the source. This would be more elegant with a .once() - // handler in flow(), but adding and removing repeatedly is - // too slow. - var ondrain = pipeOnDrain(src); - dest.on('drain', ondrain); + Transform.call(this, options); +} - var cleanedUp = false; - function cleanup() { - debug('cleanup'); - // cleanup event handlers once the pipe is broken - dest.removeListener('close', onclose); - dest.removeListener('finish', onfinish); - dest.removeListener('drain', ondrain); - dest.removeListener('error', onerror); - dest.removeListener('unpipe', onunpipe); - src.removeListener('end', onend); - src.removeListener('end', cleanup); - src.removeListener('data', ondata); +PassThrough.prototype._transform = function (chunk, encoding, cb) { + cb(null, chunk); +}; +},{"./_stream_transform":455,"core-util-is":381,"inherits":429}],454:[function(require,module,exports){ +(function (process){ +'use strict'; - cleanedUp = true; +module.exports = Readable; - // if the reader is waiting for a drain event from this - // specific writer, then it would cause it to never start - // flowing again. - // So, if this is awaiting a drain, then we just call it now. - // If we don't know, then assume that we are waiting for one. - if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); - } +/**/ +var processNextTick = require('process-nextick-args'); +/**/ - src.on('data', ondata); - function ondata(chunk) { - debug('ondata'); - var ret = dest.write(chunk); - if (false === ret) { - // If the user unpiped during `dest.write()`, it is possible - // to get stuck in a permanently paused state if that write - // also returned false. - // => Check whether `dest` is still a piping destination. - if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { - debug('false write response, pause', src._readableState.awaitDrain); - src._readableState.awaitDrain++; - } - src.pause(); - } - } +/**/ +var isArray = require('isarray'); +/**/ - // if the dest has an error, then stop piping into it. - // however, don't suppress the throwing behavior for this. - function onerror(er) { - debug('onerror', er); - unpipe(); - dest.removeListener('error', onerror); - if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); - } +Readable.ReadableState = ReadableState; - // Make sure our error handler is attached before userland ones. - prependListener(dest, 'error', onerror); +/**/ +var EE = require('events').EventEmitter; - // Both close and finish should trigger unpipe, but only once. - function onclose() { - dest.removeListener('finish', onfinish); - unpipe(); - } - dest.once('close', onclose); - function onfinish() { - debug('onfinish'); - dest.removeListener('close', onclose); - unpipe(); - } - dest.once('finish', onfinish); +var EElistenerCount = function (emitter, type) { + return emitter.listeners(type).length; +}; +/**/ - function unpipe() { - debug('unpipe'); - src.unpipe(dest); +/**/ +var Stream; +(function () { + try { + Stream = require('st' + 'ream'); + } catch (_) {} finally { + if (!Stream) Stream = require('events').EventEmitter; } +})(); +/**/ - // tell the dest that it's being piped to - dest.emit('pipe', src); - - // start the flow if it hasn't been started already. - if (!state.flowing) { - debug('pipe resume'); - src.resume(); - } +var Buffer = require('buffer').Buffer; +/**/ +var bufferShim = require('buffer-shims'); +/**/ - return dest; -}; +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ -function pipeOnDrain(src) { - return function () { - var state = src._readableState; - debug('pipeOnDrain', state.awaitDrain); - if (state.awaitDrain) state.awaitDrain--; - if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { - state.flowing = true; - flow(src); - } - }; +/**/ +var debugUtil = require('util'); +var debug = void 0; +if (debugUtil && debugUtil.debuglog) { + debug = debugUtil.debuglog('stream'); +} else { + debug = function () {}; } +/**/ -Readable.prototype.unpipe = function (dest) { - var state = this._readableState; - - // if we're not piping anywhere, then do nothing. - if (state.pipesCount === 0) return this; - - // just one destination. most common case. - if (state.pipesCount === 1) { - // passed in one, but it's not the right one. - if (dest && dest !== state.pipes) return this; - - if (!dest) dest = state.pipes; - - // got a match. - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - if (dest) dest.emit('unpipe', this); - return this; - } +var StringDecoder; - // slow case. multiple pipe destinations. +util.inherits(Readable, Stream); - if (!dest) { - // remove all. - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; +var hasPrependListener = typeof EE.prototype.prependListener === 'function'; - for (var _i = 0; _i < len; _i++) { - dests[_i].emit('unpipe', this); - }return this; - } +function prependListener(emitter, event, fn) { + if (hasPrependListener) return emitter.prependListener(event, fn); - // try to find the right one. - var i = indexOf(state.pipes, dest); - if (i === -1) return this; + // This is a brutally ugly hack to make sure that our error handler + // is attached before any userland ones. NEVER DO THIS. This is here + // only because this code needs to continue to work with older versions + // of Node.js that do not include the prependListener() method. The goal + // is to eventually remove this hack. + if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; +} - state.pipes.splice(i, 1); - state.pipesCount -= 1; - if (state.pipesCount === 1) state.pipes = state.pipes[0]; +var Duplex; +function ReadableState(options, stream) { + Duplex = Duplex || require('./_stream_duplex'); - dest.emit('unpipe', this); + options = options || {}; - return this; -}; + // object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away + this.objectMode = !!options.objectMode; -// set up data events if they are asked for -// Ensure readable listeners eventually get something -Readable.prototype.on = function (ev, fn) { - var res = Stream.prototype.on.call(this, ev, fn); + if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode; - // If listening to data, and it has not explicitly been paused, - // then call resume to start the flow of data on the next tick. - if (ev === 'data' && false !== this._readableState.flowing) { - this.resume(); - } + // the point at which it stops calling _read() to fill the buffer + // Note: 0 is a valid value, means "don't call _read preemptively ever" + var hwm = options.highWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; - if (ev === 'readable' && !this._readableState.endEmitted) { - var state = this._readableState; - if (!state.readableListening) { - state.readableListening = true; - state.emittedReadable = false; - state.needReadable = true; - if (!state.reading) { - processNextTick(nReadingNextTick, this); - } else if (state.length) { - emitReadable(this, state); - } - } - } + // cast to ints. + this.highWaterMark = ~ ~this.highWaterMark; - return res; -}; -Readable.prototype.addListener = Readable.prototype.on; + this.buffer = []; + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; + this.ended = false; + this.endEmitted = false; + this.reading = false; -function nReadingNextTick(self) { - debug('readable nexttick read 0'); - self.read(0); -} + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; -// pause() and resume() are remnants of the legacy readable stream API -// If the user uses them, then switch into old mode. -Readable.prototype.resume = function () { - var state = this._readableState; - if (!state.flowing) { - debug('resume'); - state.flowing = true; - resume(this, state); - } - return this; -}; + // whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + this.resumeScheduled = false; -function resume(stream, state) { - if (!state.resumeScheduled) { - state.resumeScheduled = true; - processNextTick(resume_, stream, state); - } -} + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; -function resume_(stream, state) { - if (!state.reading) { - debug('resume read 0'); - stream.read(0); - } + // when piping, we only care about 'readable' events that happen + // after read()ing all the bytes and not getting any pushback. + this.ranOut = false; - state.resumeScheduled = false; - stream.emit('resume'); - flow(stream); - if (state.flowing && !state.reading) stream.read(0); -} + // the number of writers that are awaiting a drain event in .pipe()s + this.awaitDrain = 0; -Readable.prototype.pause = function () { - debug('call pause flowing=%j', this._readableState.flowing); - if (false !== this._readableState.flowing) { - debug('pause'); - this._readableState.flowing = false; - this.emit('pause'); - } - return this; -}; + // if true, a maybeReadMore has been scheduled + this.readingMore = false; -function flow(stream) { - var state = stream._readableState; - debug('flow', state.flowing); - if (state.flowing) { - do { - var chunk = stream.read(); - } while (null !== chunk && state.flowing); + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; } } -// wrap an old-style stream as the async data source. -// This is *not* part of the readable stream interface. -// It is an ugly unfortunate mess of history. -Readable.prototype.wrap = function (stream) { - var state = this._readableState; - var paused = false; - - var self = this; - stream.on('end', function () { - debug('wrapped end'); - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) self.push(chunk); - } +var Duplex; +function Readable(options) { + Duplex = Duplex || require('./_stream_duplex'); - self.push(null); - }); + if (!(this instanceof Readable)) return new Readable(options); - stream.on('data', function (chunk) { - debug('wrapped data'); - if (state.decoder) chunk = state.decoder.write(chunk); + this._readableState = new ReadableState(options, this); - // don't skip over falsy values in objectMode - if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; + // legacy + this.readable = true; - var ret = self.push(chunk); - if (!ret) { - paused = true; - stream.pause(); - } - }); + if (options && typeof options.read === 'function') this._read = options.read; - // proxy all the other methods. - // important when wrapping filters and duplexes. - for (var i in stream) { - if (this[i] === undefined && typeof stream[i] === 'function') { - this[i] = function (method) { - return function () { - return stream[method].apply(stream, arguments); - }; - }(i); - } - } + Stream.call(this); +} - // proxy certain important events. - var events = ['error', 'close', 'destroy', 'pause', 'resume']; - forEach(events, function (ev) { - stream.on(ev, self.emit.bind(self, ev)); - }); +// Manually shove something into the read() buffer. +// This returns true if the highWaterMark has not been hit yet, +// similar to how Writable.write() returns true if you should +// write() some more. +Readable.prototype.push = function (chunk, encoding) { + var state = this._readableState; - // when we try to consume some more bytes, simply unpause the - // underlying stream. - self._read = function (n) { - debug('wrapped _read', n); - if (paused) { - paused = false; - stream.resume(); + if (!state.objectMode && typeof chunk === 'string') { + encoding = encoding || state.defaultEncoding; + if (encoding !== state.encoding) { + chunk = bufferShim.from(chunk, encoding); + encoding = ''; } - }; + } - return self; + return readableAddChunk(this, state, chunk, encoding, false); }; -// exposed for testing purposes only. -Readable._fromList = fromList; - -// Pluck off n bytes from an array of buffers. -// Length is the combined lengths of all the buffers in the list. -function fromList(n, state) { - var list = state.buffer; - var length = state.length; - var stringMode = !!state.decoder; - var objectMode = !!state.objectMode; - var ret; +// Unshift should *always* be something directly out of read() +Readable.prototype.unshift = function (chunk) { + var state = this._readableState; + return readableAddChunk(this, state, chunk, '', true); +}; - // nothing in the list, definitely empty. - if (list.length === 0) return null; +Readable.prototype.isPaused = function () { + return this._readableState.flowing === false; +}; - if (length === 0) ret = null;else if (objectMode) ret = list.shift();else if (!n || n >= length) { - // read it all, truncate the array. - if (stringMode) ret = list.join('');else if (list.length === 1) ret = list[0];else ret = Buffer.concat(list, length); - list.length = 0; - } else { - // read just some of it. - if (n < list[0].length) { - // just take a part of the first list item. - // slice is the same for buffers and strings. - var buf = list[0]; - ret = buf.slice(0, n); - list[0] = buf.slice(n); - } else if (n === list[0].length) { - // first list is a perfect match - ret = list.shift(); +function readableAddChunk(stream, state, chunk, encoding, addToFront) { + var er = chunkInvalid(state, chunk); + if (er) { + stream.emit('error', er); + } else if (chunk === null) { + state.reading = false; + onEofChunk(stream, state); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (state.ended && !addToFront) { + var e = new Error('stream.push() after EOF'); + stream.emit('error', e); + } else if (state.endEmitted && addToFront) { + var _e = new Error('stream.unshift() after end event'); + stream.emit('error', _e); } else { - // complex case. - // we have enough to cover it, but it spans past the first buffer. - if (stringMode) ret = '';else ret = bufferShim.allocUnsafe(n); - - var c = 0; - for (var i = 0, l = list.length; i < l && c < n; i++) { - var _buf = list[0]; - var cpy = Math.min(n - c, _buf.length); + var skipAdd; + if (state.decoder && !addToFront && !encoding) { + chunk = state.decoder.write(chunk); + skipAdd = !state.objectMode && chunk.length === 0; + } - if (stringMode) ret += _buf.slice(0, cpy);else _buf.copy(ret, c, 0, cpy); + if (!addToFront) state.reading = false; - if (cpy < _buf.length) list[0] = _buf.slice(cpy);else list.shift(); + // Don't add to the buffer if we've decoded to an empty string chunk and + // we're not in object mode + if (!skipAdd) { + // if we want the data now, just emit it. + if (state.flowing && state.length === 0 && !state.sync) { + stream.emit('data', chunk); + stream.read(0); + } else { + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); - c += cpy; + if (state.needReadable) emitReadable(stream); + } } + + maybeReadMore(stream, state); } + } else if (!addToFront) { + state.reading = false; } - return ret; -} - -function endReadable(stream) { - var state = stream._readableState; - - // If we get here before consuming all the bytes, then that is a - // bug in node. Should never happen. - if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); - - if (!state.endEmitted) { - state.ended = true; - processNextTick(endReadableNT, state, stream); - } + return needMoreData(state); } -function endReadableNT(state, stream) { - // Check that we didn't get one last unshift. - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit('end'); - } +// if it's past the high water mark, we can push in some more. +// Also, if we have no data yet, we can stand some +// more bytes. This is to work around cases where hwm=0, +// such as the repl. Also, if the push() triggered a +// readable event, and the user called read(largeNumber) such that +// needReadable was set, then we ought to push more, so that another +// 'readable' event will be triggered. +function needMoreData(state) { + return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); } -function forEach(xs, f) { - for (var i = 0, l = xs.length; i < l; i++) { - f(xs[i], i); - } -} +// backwards compatibility. +Readable.prototype.setEncoding = function (enc) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this._readableState.decoder = new StringDecoder(enc); + this._readableState.encoding = enc; + return this; +}; -function indexOf(xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) return i; +// Don't raise the hwm > 8MB +var MAX_HWM = 0x800000; +function computeNewHighWaterMark(n) { + if (n >= MAX_HWM) { + n = MAX_HWM; + } else { + // Get the next highest power of 2 + n--; + n |= n >>> 1; + n |= n >>> 2; + n |= n >>> 4; + n |= n >>> 8; + n |= n >>> 16; + n++; } - return -1; + return n; } -}).call(this,require('_process')) -},{"./_stream_duplex":451,"_process":442,"buffer":83,"buffer-shims":81,"core-util-is":380,"events":418,"inherits":428,"isarray":430,"process-nextick-args":441,"string_decoder/":478,"util":55}],454:[function(require,module,exports){ -// a transform stream is a readable/writable stream where you do -// something with the data. Sometimes it's called a "filter", -// but that's not a great name for it, since that implies a thing where -// some bits pass through, and others are simply ignored. (That would -// be a valid example of a transform, of course.) -// -// While the output is causally related to the input, it's not a -// necessarily symmetric or synchronous transformation. For example, -// a zlib stream might take multiple plain-text writes(), and then -// emit a single compressed chunk some time in the future. -// -// Here's how this works: -// -// The Transform stream has all the aspects of the readable and writable -// stream classes. When you write(chunk), that calls _write(chunk,cb) -// internally, and returns false if there's a lot of pending writes -// buffered up. When you call read(), that calls _read(n) until -// there's enough pending readable data buffered up. -// -// In a transform stream, the written data is placed in a buffer. When -// _read(n) is called, it transforms the queued up data, calling the -// buffered _write cb's as it consumes chunks. If consuming a single -// written chunk would result in multiple output chunks, then the first -// outputted bit calls the readcb, and subsequent chunks just go into -// the read buffer, and will cause it to emit 'readable' if necessary. -// -// This way, back-pressure is actually determined by the reading side, -// since _read has to be called to start processing a new chunk. However, -// a pathological inflate type of transform can cause excessive buffering -// here. For example, imagine a stream where every byte of input is -// interpreted as an integer from 0-255, and then results in that many -// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in -// 1kb of data being output. In this case, you could write a very small -// amount of input, and end up with a very large amount of output. In -// such a pathological inflating mechanism, there'd be no way to tell -// the system to stop doing the transform. A single 4MB write could -// cause the system to run out of memory. -// -// However, even in such a pathological case, only a single written chunk -// would be consumed, and then the rest would wait (un-transformed) until -// the results of the previous transformed chunk were consumed. -'use strict'; +function howMuchToRead(n, state) { + if (state.length === 0 && state.ended) return 0; -module.exports = Transform; + if (state.objectMode) return n === 0 ? 0 : 1; -var Duplex = require('./_stream_duplex'); + if (n === null || isNaN(n)) { + // only flow one buffer at a time + if (state.flowing && state.buffer.length) return state.buffer[0].length;else return state.length; + } -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ + if (n <= 0) return 0; -util.inherits(Transform, Duplex); + // If we're asking for more than the target buffer level, + // then raise the water mark. Bump up to the next highest + // power of 2, to prevent increasing it excessively in tiny + // amounts. + if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); -function TransformState(stream) { - this.afterTransform = function (er, data) { - return afterTransform(stream, er, data); - }; + // don't have that much. return null, unless we've ended. + if (n > state.length) { + if (!state.ended) { + state.needReadable = true; + return 0; + } else { + return state.length; + } + } - this.needTransform = false; - this.transforming = false; - this.writecb = null; - this.writechunk = null; - this.writeencoding = null; + return n; } -function afterTransform(stream, er, data) { - var ts = stream._transformState; - ts.transforming = false; - - var cb = ts.writecb; - - if (!cb) return stream.emit('error', new Error('no writecb in Transform class')); - - ts.writechunk = null; - ts.writecb = null; - - if (data !== null && data !== undefined) stream.push(data); +// you can override either this method, or the async _read(n) below. +Readable.prototype.read = function (n) { + debug('read', n); + var state = this._readableState; + var nOrig = n; - cb(er); + if (typeof n !== 'number' || n > 0) state.emittedReadable = false; - var rs = stream._readableState; - rs.reading = false; - if (rs.needReadable || rs.length < rs.highWaterMark) { - stream._read(rs.highWaterMark); + // if we're doing read(0) to trigger a readable event, but we + // already have a bunch of data in the buffer, then just trigger + // the 'readable' event and move on. + if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { + debug('read: emitReadable', state.length, state.ended); + if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); + return null; } -} - -function Transform(options) { - if (!(this instanceof Transform)) return new Transform(options); - - Duplex.call(this, options); - this._transformState = new TransformState(this); + n = howMuchToRead(n, state); - // when the writable side finishes, then flush out anything remaining. - var stream = this; + // if we've ended, and we're now clear, then finish it up. + if (n === 0 && state.ended) { + if (state.length === 0) endReadable(this); + return null; + } - // start out asking for a readable event once data is transformed. - this._readableState.needReadable = true; + // All the actual chunk generation logic needs to be + // *below* the call to _read. The reason is that in certain + // synthetic stream cases, such as passthrough streams, _read + // may be a completely synchronous operation which may change + // the state of the read buffer, providing enough data when + // before there was *not* enough. + // + // So, the steps are: + // 1. Figure out what the state of things will be after we do + // a read from the buffer. + // + // 2. If that resulting state will trigger a _read, then call _read. + // Note that this may be asynchronous, or synchronous. Yes, it is + // deeply ugly to write APIs this way, but that still doesn't mean + // that the Readable class should behave improperly, as streams are + // designed to be sync/async agnostic. + // Take note if the _read call is sync or async (ie, if the read call + // has returned yet), so that we know whether or not it's safe to emit + // 'readable' etc. + // + // 3. Actually pull the requested chunks out of the buffer and return. - // we have implemented the _read method, and done the other things - // that Readable wants before the first _read call, so unset the - // sync guard flag. - this._readableState.sync = false; + // if we need a readable event, then we need to do some reading. + var doRead = state.needReadable; + debug('need readable', doRead); - if (options) { - if (typeof options.transform === 'function') this._transform = options.transform; + // if we currently have less than the highWaterMark, then also read some + if (state.length === 0 || state.length - n < state.highWaterMark) { + doRead = true; + debug('length less than watermark', doRead); + } - if (typeof options.flush === 'function') this._flush = options.flush; + // however, if we've ended, then there's no point, and if we're already + // reading, then it's unnecessary. + if (state.ended || state.reading) { + doRead = false; + debug('reading or ended', doRead); } - this.once('prefinish', function () { - if (typeof this._flush === 'function') this._flush(function (er) { - done(stream, er); - });else done(stream); - }); -} + if (doRead) { + debug('do read'); + state.reading = true; + state.sync = true; + // if the length is currently zero, then we *need* a readable event. + if (state.length === 0) state.needReadable = true; + // call internal read method + this._read(state.highWaterMark); + state.sync = false; + } -Transform.prototype.push = function (chunk, encoding) { - this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk, encoding); -}; + // If _read pushed data synchronously, then `reading` will be false, + // and we need to re-evaluate how much data we can return to the user. + if (doRead && !state.reading) n = howMuchToRead(nOrig, state); -// This is the part where you do stuff! -// override this function in implementation classes. -// 'chunk' is an input chunk. -// -// Call `push(newChunk)` to pass along transformed output -// to the readable side. You may call 'push' zero or more times. -// -// Call `cb(err)` when you are done with this chunk. If you pass -// an error, then that'll put the hurt on the whole operation. If you -// never call cb(), then you'll never get another chunk. -Transform.prototype._transform = function (chunk, encoding, cb) { - throw new Error('Not implemented'); -}; + var ret; + if (n > 0) ret = fromList(n, state);else ret = null; -Transform.prototype._write = function (chunk, encoding, cb) { - var ts = this._transformState; - ts.writecb = cb; - ts.writechunk = chunk; - ts.writeencoding = encoding; - if (!ts.transforming) { - var rs = this._readableState; - if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); + if (ret === null) { + state.needReadable = true; + n = 0; } -}; - -// Doesn't matter what the args are here. -// _transform does all the work. -// That we got here means that the readable side wants more data. -Transform.prototype._read = function (n) { - var ts = this._transformState; - if (ts.writechunk !== null && ts.writecb && !ts.transforming) { - ts.transforming = true; - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); - } else { - // mark that we need a transform, so that any data that comes in - // will get processed, now that we've asked for it. - ts.needTransform = true; - } -}; + state.length -= n; -function done(stream, er) { - if (er) return stream.emit('error', er); + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (state.length === 0 && !state.ended) state.needReadable = true; - // if there's nothing in the write buffer, then that means - // that nothing more will ever be provided - var ws = stream._writableState; - var ts = stream._transformState; + // If we tried to read() past the EOF, then emit end on the next tick. + if (nOrig !== n && state.ended && state.length === 0) endReadable(this); - if (ws.length) throw new Error('Calling transform done when ws.length != 0'); + if (ret !== null) this.emit('data', ret); - if (ts.transforming) throw new Error('Calling transform done when still transforming'); + return ret; +}; - return stream.push(null); +function chunkInvalid(state, chunk) { + var er = null; + if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + return er; } -},{"./_stream_duplex":451,"core-util-is":380,"inherits":428}],455:[function(require,module,exports){ -(function (process){ -// A bit simpler than readable streams. -// Implement an async ._write(chunk, encoding, cb), and it'll handle all -// the drain event emission and buffering. -'use strict'; +function onEofChunk(stream, state) { + if (state.ended) return; + if (state.decoder) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) { + state.buffer.push(chunk); + state.length += state.objectMode ? 1 : chunk.length; + } + } + state.ended = true; -module.exports = Writable; + // emit 'readable' now to make sure it gets picked up. + emitReadable(stream); +} -/**/ -var processNextTick = require('process-nextick-args'); -/**/ +// Don't emit readable right away in sync mode, because this can trigger +// another read() call => stack overflow. This way, it might trigger +// a nextTick recursion warning, but that's not so bad. +function emitReadable(stream) { + var state = stream._readableState; + state.needReadable = false; + if (!state.emittedReadable) { + debug('emitReadable', state.flowing); + state.emittedReadable = true; + if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream); + } +} -/**/ -var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick; -/**/ +function emitReadable_(stream) { + debug('emit readable'); + stream.emit('readable'); + flow(stream); +} -Writable.WritableState = WritableState; +// at this point, the user has presumably seen the 'readable' event, +// and called read() to consume some data. that may have triggered +// in turn another _read(n) call, in which case reading = true if +// it's in progress. +// However, if we're not ended, or reading, and the length < hwm, +// then go ahead and try to read some more preemptively. +function maybeReadMore(stream, state) { + if (!state.readingMore) { + state.readingMore = true; + processNextTick(maybeReadMore_, stream, state); + } +} -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ +function maybeReadMore_(stream, state) { + var len = state.length; + while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { + debug('maybeReadMore read 0'); + stream.read(0); + if (len === state.length) + // didn't get any data, stop spinning. + break;else len = state.length; + } + state.readingMore = false; +} -/**/ -var internalUtil = { - deprecate: require('util-deprecate') +// abstract method. to be overridden in specific implementation classes. +// call cb(er, data) where data is <= n in length. +// for virtual (non-string, non-buffer) streams, "length" is somewhat +// arbitrary, and perhaps not very meaningful. +Readable.prototype._read = function (n) { + this.emit('error', new Error('not implemented')); }; -/**/ - -/**/ -var Stream; -(function () { - try { - Stream = require('st' + 'ream'); - } catch (_) {} finally { - if (!Stream) Stream = require('events').EventEmitter; - } -})(); -/**/ -var Buffer = require('buffer').Buffer; -/**/ -var bufferShim = require('buffer-shims'); -/**/ +Readable.prototype.pipe = function (dest, pipeOpts) { + var src = this; + var state = this._readableState; -util.inherits(Writable, Stream); + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + case 1: + state.pipes = [state.pipes, dest]; + break; + default: + state.pipes.push(dest); + break; + } + state.pipesCount += 1; + debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); -function nop() {} + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; -function WriteReq(chunk, encoding, cb) { - this.chunk = chunk; - this.encoding = encoding; - this.callback = cb; - this.next = null; -} + var endFn = doEnd ? onend : cleanup; + if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn); -var Duplex; -function WritableState(options, stream) { - Duplex = Duplex || require('./_stream_duplex'); + dest.on('unpipe', onunpipe); + function onunpipe(readable) { + debug('onunpipe'); + if (readable === src) { + cleanup(); + } + } - options = options || {}; + function onend() { + debug('onend'); + dest.end(); + } - // object stream flag to indicate whether or not this stream - // contains buffers or objects. - this.objectMode = !!options.objectMode; + // when the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. + var ondrain = pipeOnDrain(src); + dest.on('drain', ondrain); - if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode; + var cleanedUp = false; + function cleanup() { + debug('cleanup'); + // cleanup event handlers once the pipe is broken + dest.removeListener('close', onclose); + dest.removeListener('finish', onfinish); + dest.removeListener('drain', ondrain); + dest.removeListener('error', onerror); + dest.removeListener('unpipe', onunpipe); + src.removeListener('end', onend); + src.removeListener('end', cleanup); + src.removeListener('data', ondata); - // the point at which write() starts returning false - // Note: 0 is a valid value, means that we always return false if - // the entire buffer is not flushed immediately on write() - var hwm = options.highWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; + cleanedUp = true; - // cast to ints. - this.highWaterMark = ~ ~this.highWaterMark; + // if the reader is waiting for a drain event from this + // specific writer, then it would cause it to never start + // flowing again. + // So, if this is awaiting a drain, then we just call it now. + // If we don't know, then assume that we are waiting for one. + if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); + } - this.needDrain = false; - // at the start of calling end() - this.ending = false; - // when end() has been called, and returned - this.ended = false; - // when 'finish' is emitted - this.finished = false; + src.on('data', ondata); + function ondata(chunk) { + debug('ondata'); + var ret = dest.write(chunk); + if (false === ret) { + // If the user unpiped during `dest.write()`, it is possible + // to get stuck in a permanently paused state if that write + // also returned false. + // => Check whether `dest` is still a piping destination. + if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { + debug('false write response, pause', src._readableState.awaitDrain); + src._readableState.awaitDrain++; + } + src.pause(); + } + } - // should we decode strings into buffers before passing to _write? - // this is here so that some node-core streams can optimize string - // handling at a lower level. - var noDecode = options.decodeStrings === false; - this.decodeStrings = !noDecode; + // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. + function onerror(er) { + debug('onerror', er); + unpipe(); + dest.removeListener('error', onerror); + if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); + } - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; + // Make sure our error handler is attached before userland ones. + prependListener(dest, 'error', onerror); - // not an actual buffer we keep track of, but a measurement - // of how much we're waiting to get pushed to some underlying - // socket or file. - this.length = 0; + // Both close and finish should trigger unpipe, but only once. + function onclose() { + dest.removeListener('finish', onfinish); + unpipe(); + } + dest.once('close', onclose); + function onfinish() { + debug('onfinish'); + dest.removeListener('close', onclose); + unpipe(); + } + dest.once('finish', onfinish); - // a flag to see when we're in the middle of a write. - this.writing = false; + function unpipe() { + debug('unpipe'); + src.unpipe(dest); + } - // when true all writes will be buffered until .uncork() call - this.corked = 0; + // tell the dest that it's being piped to + dest.emit('pipe', src); - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; + // start the flow if it hasn't been started already. + if (!state.flowing) { + debug('pipe resume'); + src.resume(); + } - // a flag to know if we're processing previously buffered items, which - // may call the _write() callback in the same tick, so that we don't - // end up in an overlapped onwrite situation. - this.bufferProcessing = false; + return dest; +}; - // the callback that's passed to _write(chunk,cb) - this.onwrite = function (er) { - onwrite(stream, er); +function pipeOnDrain(src) { + return function () { + var state = src._readableState; + debug('pipeOnDrain', state.awaitDrain); + if (state.awaitDrain) state.awaitDrain--; + if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { + state.flowing = true; + flow(src); + } }; +} - // the callback that the user supplies to write(chunk,encoding,cb) - this.writecb = null; - - // the amount that is being written when _write is called. - this.writelen = 0; +Readable.prototype.unpipe = function (dest) { + var state = this._readableState; - this.bufferedRequest = null; - this.lastBufferedRequest = null; + // if we're not piping anywhere, then do nothing. + if (state.pipesCount === 0) return this; - // number of pending user-supplied write callbacks - // this must be 0 before 'finish' can be emitted - this.pendingcb = 0; + // just one destination. most common case. + if (state.pipesCount === 1) { + // passed in one, but it's not the right one. + if (dest && dest !== state.pipes) return this; - // emit prefinish if the only thing we're waiting for is _write cbs - // This is relevant for synchronous Transform streams - this.prefinished = false; + if (!dest) dest = state.pipes; - // True if the error was already emitted and should not be thrown again - this.errorEmitted = false; + // got a match. + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) dest.emit('unpipe', this); + return this; + } - // count buffered requests - this.bufferedRequestCount = 0; + // slow case. multiple pipe destinations. - // allocate the first CorkedRequest, there is always - // one allocated and free to use, and we maintain at most two - this.corkedRequestsFree = new CorkedRequest(this); -} + if (!dest) { + // remove all. + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; -WritableState.prototype.getBuffer = function writableStateGetBuffer() { - var current = this.bufferedRequest; - var out = []; - while (current) { - out.push(current); - current = current.next; + for (var _i = 0; _i < len; _i++) { + dests[_i].emit('unpipe', this); + }return this; } - return out; -}; - -(function () { - try { - Object.defineProperty(WritableState.prototype, 'buffer', { - get: internalUtil.deprecate(function () { - return this.getBuffer(); - }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.') - }); - } catch (_) {} -})(); -var Duplex; -function Writable(options) { - Duplex = Duplex || require('./_stream_duplex'); + // try to find the right one. + var i = indexOf(state.pipes, dest); + if (i === -1) return this; - // Writable ctor is applied to Duplexes, though they're not - // instanceof Writable, they're instanceof Readable. - if (!(this instanceof Writable) && !(this instanceof Duplex)) return new Writable(options); + state.pipes.splice(i, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) state.pipes = state.pipes[0]; - this._writableState = new WritableState(options, this); + dest.emit('unpipe', this); - // legacy. - this.writable = true; + return this; +}; - if (options) { - if (typeof options.write === 'function') this._write = options.write; +// set up data events if they are asked for +// Ensure readable listeners eventually get something +Readable.prototype.on = function (ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); - if (typeof options.writev === 'function') this._writev = options.writev; + // If listening to data, and it has not explicitly been paused, + // then call resume to start the flow of data on the next tick. + if (ev === 'data' && false !== this._readableState.flowing) { + this.resume(); } - Stream.call(this); -} + if (ev === 'readable' && !this._readableState.endEmitted) { + var state = this._readableState; + if (!state.readableListening) { + state.readableListening = true; + state.emittedReadable = false; + state.needReadable = true; + if (!state.reading) { + processNextTick(nReadingNextTick, this); + } else if (state.length) { + emitReadable(this, state); + } + } + } -// Otherwise people can pipe Writable streams, which is just wrong. -Writable.prototype.pipe = function () { - this.emit('error', new Error('Cannot pipe, not readable')); + return res; }; +Readable.prototype.addListener = Readable.prototype.on; -function writeAfterEnd(stream, cb) { - var er = new Error('write after end'); - // TODO: defer error events consistently everywhere, not just the cb - stream.emit('error', er); - processNextTick(cb, er); -} - -// If we get something that is not a buffer, string, null, or undefined, -// and we're not in objectMode, then that's an error. -// Otherwise stream chunks are all considered to be of length=1, and the -// watermarks determine how many objects to keep in the buffer, rather than -// how many bytes or characters. -function validChunk(stream, state, chunk, cb) { - var valid = true; - var er = false; - // Always throw error if a null is written - // if we are not in object mode then throw - // if it is not a buffer, string, or undefined. - if (chunk === null) { - er = new TypeError('May not write null values to stream'); - } else if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); +function nReadingNextTick(self) { + debug('readable nexttick read 0'); + self.read(0); +} + +// pause() and resume() are remnants of the legacy readable stream API +// If the user uses them, then switch into old mode. +Readable.prototype.resume = function () { + var state = this._readableState; + if (!state.flowing) { + debug('resume'); + state.flowing = true; + resume(this, state); } - if (er) { - stream.emit('error', er); - processNextTick(cb, er); - valid = false; + return this; +}; + +function resume(stream, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + processNextTick(resume_, stream, state); } - return valid; } -Writable.prototype.write = function (chunk, encoding, cb) { - var state = this._writableState; - var ret = false; - - if (typeof encoding === 'function') { - cb = encoding; - encoding = null; +function resume_(stream, state) { + if (!state.reading) { + debug('resume read 0'); + stream.read(0); } - if (Buffer.isBuffer(chunk)) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; + state.resumeScheduled = false; + stream.emit('resume'); + flow(stream); + if (state.flowing && !state.reading) stream.read(0); +} - if (typeof cb !== 'function') cb = nop; +Readable.prototype.pause = function () { + debug('call pause flowing=%j', this._readableState.flowing); + if (false !== this._readableState.flowing) { + debug('pause'); + this._readableState.flowing = false; + this.emit('pause'); + } + return this; +}; - if (state.ended) writeAfterEnd(this, cb);else if (validChunk(this, state, chunk, cb)) { - state.pendingcb++; - ret = writeOrBuffer(this, state, chunk, encoding, cb); +function flow(stream) { + var state = stream._readableState; + debug('flow', state.flowing); + if (state.flowing) { + do { + var chunk = stream.read(); + } while (null !== chunk && state.flowing); } +} - return ret; -}; +// wrap an old-style stream as the async data source. +// This is *not* part of the readable stream interface. +// It is an ugly unfortunate mess of history. +Readable.prototype.wrap = function (stream) { + var state = this._readableState; + var paused = false; -Writable.prototype.cork = function () { - var state = this._writableState; + var self = this; + stream.on('end', function () { + debug('wrapped end'); + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) self.push(chunk); + } - state.corked++; -}; + self.push(null); + }); -Writable.prototype.uncork = function () { - var state = this._writableState; + stream.on('data', function (chunk) { + debug('wrapped data'); + if (state.decoder) chunk = state.decoder.write(chunk); - if (state.corked) { - state.corked--; + // don't skip over falsy values in objectMode + if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; - if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); + var ret = self.push(chunk); + if (!ret) { + paused = true; + stream.pause(); + } + }); + + // proxy all the other methods. + // important when wrapping filters and duplexes. + for (var i in stream) { + if (this[i] === undefined && typeof stream[i] === 'function') { + this[i] = function (method) { + return function () { + return stream[method].apply(stream, arguments); + }; + }(i); + } } -}; -Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { - // node::ParseEncoding() requires lower case. - if (typeof encoding === 'string') encoding = encoding.toLowerCase(); - if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); - this._writableState.defaultEncoding = encoding; - return this; -}; + // proxy certain important events. + var events = ['error', 'close', 'destroy', 'pause', 'resume']; + forEach(events, function (ev) { + stream.on(ev, self.emit.bind(self, ev)); + }); -function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { - chunk = bufferShim.from(chunk, encoding); - } - return chunk; -} + // when we try to consume some more bytes, simply unpause the + // underlying stream. + self._read = function (n) { + debug('wrapped _read', n); + if (paused) { + paused = false; + stream.resume(); + } + }; -// if we're already writing something, then just put this -// in the queue, and wait our turn. Otherwise, call _write -// If we return false, then we need a drain event, so set that flag. -function writeOrBuffer(stream, state, chunk, encoding, cb) { - chunk = decodeChunk(state, chunk, encoding); + return self; +}; - if (Buffer.isBuffer(chunk)) encoding = 'buffer'; - var len = state.objectMode ? 1 : chunk.length; +// exposed for testing purposes only. +Readable._fromList = fromList; - state.length += len; +// Pluck off n bytes from an array of buffers. +// Length is the combined lengths of all the buffers in the list. +function fromList(n, state) { + var list = state.buffer; + var length = state.length; + var stringMode = !!state.decoder; + var objectMode = !!state.objectMode; + var ret; - var ret = state.length < state.highWaterMark; - // we must ensure that previous needDrain will not be reset to false. - if (!ret) state.needDrain = true; + // nothing in the list, definitely empty. + if (list.length === 0) return null; - if (state.writing || state.corked) { - var last = state.lastBufferedRequest; - state.lastBufferedRequest = new WriteReq(chunk, encoding, cb); - if (last) { - last.next = state.lastBufferedRequest; + if (length === 0) ret = null;else if (objectMode) ret = list.shift();else if (!n || n >= length) { + // read it all, truncate the array. + if (stringMode) ret = list.join('');else if (list.length === 1) ret = list[0];else ret = Buffer.concat(list, length); + list.length = 0; + } else { + // read just some of it. + if (n < list[0].length) { + // just take a part of the first list item. + // slice is the same for buffers and strings. + var buf = list[0]; + ret = buf.slice(0, n); + list[0] = buf.slice(n); + } else if (n === list[0].length) { + // first list is a perfect match + ret = list.shift(); } else { - state.bufferedRequest = state.lastBufferedRequest; + // complex case. + // we have enough to cover it, but it spans past the first buffer. + if (stringMode) ret = '';else ret = bufferShim.allocUnsafe(n); + + var c = 0; + for (var i = 0, l = list.length; i < l && c < n; i++) { + var _buf = list[0]; + var cpy = Math.min(n - c, _buf.length); + + if (stringMode) ret += _buf.slice(0, cpy);else _buf.copy(ret, c, 0, cpy); + + if (cpy < _buf.length) list[0] = _buf.slice(cpy);else list.shift(); + + c += cpy; + } } - state.bufferedRequestCount += 1; - } else { - doWrite(stream, state, false, len, chunk, encoding, cb); } return ret; } -function doWrite(stream, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); - state.sync = false; +function endReadable(stream) { + var state = stream._readableState; + + // If we get here before consuming all the bytes, then that is a + // bug in node. Should never happen. + if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); + + if (!state.endEmitted) { + state.ended = true; + processNextTick(endReadableNT, state, stream); + } } -function onwriteError(stream, state, sync, er, cb) { - --state.pendingcb; - if (sync) processNextTick(cb, er);else cb(er); +function endReadableNT(state, stream) { + // Check that we didn't get one last unshift. + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); + } +} - stream._writableState.errorEmitted = true; - stream.emit('error', er); +function forEach(xs, f) { + for (var i = 0, l = xs.length; i < l; i++) { + f(xs[i], i); + } } -function onwriteStateUpdate(state) { - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; +function indexOf(xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; } +}).call(this,require('_process')) +},{"./_stream_duplex":452,"_process":443,"buffer":84,"buffer-shims":82,"core-util-is":381,"events":419,"inherits":429,"isarray":431,"process-nextick-args":442,"string_decoder/":478,"util":56}],455:[function(require,module,exports){ +// a transform stream is a readable/writable stream where you do +// something with the data. Sometimes it's called a "filter", +// but that's not a great name for it, since that implies a thing where +// some bits pass through, and others are simply ignored. (That would +// be a valid example of a transform, of course.) +// +// While the output is causally related to the input, it's not a +// necessarily symmetric or synchronous transformation. For example, +// a zlib stream might take multiple plain-text writes(), and then +// emit a single compressed chunk some time in the future. +// +// Here's how this works: +// +// The Transform stream has all the aspects of the readable and writable +// stream classes. When you write(chunk), that calls _write(chunk,cb) +// internally, and returns false if there's a lot of pending writes +// buffered up. When you call read(), that calls _read(n) until +// there's enough pending readable data buffered up. +// +// In a transform stream, the written data is placed in a buffer. When +// _read(n) is called, it transforms the queued up data, calling the +// buffered _write cb's as it consumes chunks. If consuming a single +// written chunk would result in multiple output chunks, then the first +// outputted bit calls the readcb, and subsequent chunks just go into +// the read buffer, and will cause it to emit 'readable' if necessary. +// +// This way, back-pressure is actually determined by the reading side, +// since _read has to be called to start processing a new chunk. However, +// a pathological inflate type of transform can cause excessive buffering +// here. For example, imagine a stream where every byte of input is +// interpreted as an integer from 0-255, and then results in that many +// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in +// 1kb of data being output. In this case, you could write a very small +// amount of input, and end up with a very large amount of output. In +// such a pathological inflating mechanism, there'd be no way to tell +// the system to stop doing the transform. A single 4MB write could +// cause the system to run out of memory. +// +// However, even in such a pathological case, only a single written chunk +// would be consumed, and then the rest would wait (un-transformed) until +// the results of the previous transformed chunk were consumed. -function onwrite(stream, er) { - var state = stream._writableState; - var sync = state.sync; - var cb = state.writecb; +'use strict'; - onwriteStateUpdate(state); +module.exports = Transform; - if (er) onwriteError(stream, state, sync, er, cb);else { - // Check if we're actually ready to finish, but don't emit yet - var finished = needFinish(state); +var Duplex = require('./_stream_duplex'); - if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { - clearBuffer(stream, state); - } +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ - if (sync) { - /**/ - asyncWrite(afterWrite, stream, state, finished, cb); - /**/ - } else { - afterWrite(stream, state, finished, cb); - } - } -} +util.inherits(Transform, Duplex); -function afterWrite(stream, state, finished, cb) { - if (!finished) onwriteDrain(stream, state); - state.pendingcb--; - cb(); - finishMaybe(stream, state); -} +function TransformState(stream) { + this.afterTransform = function (er, data) { + return afterTransform(stream, er, data); + }; -// Must force callback to be called on nextTick, so that we don't -// emit 'drain' before the write() consumer gets the 'false' return -// value, and has a chance to attach a 'drain' listener. -function onwriteDrain(stream, state) { - if (state.length === 0 && state.needDrain) { - state.needDrain = false; - stream.emit('drain'); - } + this.needTransform = false; + this.transforming = false; + this.writecb = null; + this.writechunk = null; + this.writeencoding = null; } -// if there's something in the buffer waiting, then process it -function clearBuffer(stream, state) { - state.bufferProcessing = true; - var entry = state.bufferedRequest; +function afterTransform(stream, er, data) { + var ts = stream._transformState; + ts.transforming = false; - if (stream._writev && entry && entry.next) { - // Fast case, write everything using _writev() - var l = state.bufferedRequestCount; - var buffer = new Array(l); - var holder = state.corkedRequestsFree; - holder.entry = entry; + var cb = ts.writecb; - var count = 0; - while (entry) { - buffer[count] = entry; - entry = entry.next; - count += 1; - } + if (!cb) return stream.emit('error', new Error('no writecb in Transform class')); - doWrite(stream, state, true, state.length, buffer, '', holder.finish); + ts.writechunk = null; + ts.writecb = null; - // doWrite is almost always async, defer these to save a bit of time - // as the hot path ends with doWrite - state.pendingcb++; - state.lastBufferedRequest = null; - if (holder.next) { - state.corkedRequestsFree = holder.next; - holder.next = null; - } else { - state.corkedRequestsFree = new CorkedRequest(state); - } - } else { - // Slow case, write chunks one-by-one - while (entry) { - var chunk = entry.chunk; - var encoding = entry.encoding; - var cb = entry.callback; - var len = state.objectMode ? 1 : chunk.length; + if (data !== null && data !== undefined) stream.push(data); - doWrite(stream, state, false, len, chunk, encoding, cb); - entry = entry.next; - // if we didn't call the onwrite immediately, then - // it means that we need to wait until it does. - // also, that means that the chunk and cb are currently - // being processed, so move the buffer counter past them. - if (state.writing) { - break; - } - } + cb(er); - if (entry === null) state.lastBufferedRequest = null; + var rs = stream._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + stream._read(rs.highWaterMark); } - - state.bufferedRequestCount = 0; - state.bufferedRequest = entry; - state.bufferProcessing = false; } -Writable.prototype._write = function (chunk, encoding, cb) { - cb(new Error('not implemented')); -}; +function Transform(options) { + if (!(this instanceof Transform)) return new Transform(options); -Writable.prototype._writev = null; + Duplex.call(this, options); -Writable.prototype.end = function (chunk, encoding, cb) { - var state = this._writableState; + this._transformState = new TransformState(this); - if (typeof chunk === 'function') { - cb = chunk; - chunk = null; - encoding = null; - } else if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } + // when the writable side finishes, then flush out anything remaining. + var stream = this; - if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); + // start out asking for a readable event once data is transformed. + this._readableState.needReadable = true; - // .end() fully uncorks - if (state.corked) { - state.corked = 1; - this.uncork(); + // we have implemented the _read method, and done the other things + // that Readable wants before the first _read call, so unset the + // sync guard flag. + this._readableState.sync = false; + + if (options) { + if (typeof options.transform === 'function') this._transform = options.transform; + + if (typeof options.flush === 'function') this._flush = options.flush; } - // ignore unnecessary end() calls. - if (!state.ending && !state.finished) endWritable(this, state, cb); + this.once('prefinish', function () { + if (typeof this._flush === 'function') this._flush(function (er) { + done(stream, er); + });else done(stream); + }); +} + +Transform.prototype.push = function (chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); }; -function needFinish(state) { - return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; -} +// This is the part where you do stuff! +// override this function in implementation classes. +// 'chunk' is an input chunk. +// +// Call `push(newChunk)` to pass along transformed output +// to the readable side. You may call 'push' zero or more times. +// +// Call `cb(err)` when you are done with this chunk. If you pass +// an error, then that'll put the hurt on the whole operation. If you +// never call cb(), then you'll never get another chunk. +Transform.prototype._transform = function (chunk, encoding, cb) { + throw new Error('Not implemented'); +}; -function prefinish(stream, state) { - if (!state.prefinished) { - state.prefinished = true; - stream.emit('prefinish'); +Transform.prototype._write = function (chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); } -} +}; -function finishMaybe(stream, state) { - var need = needFinish(state); - if (need) { - if (state.pendingcb === 0) { - prefinish(stream, state); - state.finished = true; - stream.emit('finish'); - } else { - prefinish(stream, state); - } - } - return need; -} +// Doesn't matter what the args are here. +// _transform does all the work. +// That we got here means that the readable side wants more data. +Transform.prototype._read = function (n) { + var ts = this._transformState; -function endWritable(stream, state, cb) { - state.ending = true; - finishMaybe(stream, state); - if (cb) { - if (state.finished) processNextTick(cb);else stream.once('finish', cb); + if (ts.writechunk !== null && ts.writecb && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + // mark that we need a transform, so that any data that comes in + // will get processed, now that we've asked for it. + ts.needTransform = true; } - state.ended = true; - stream.writable = false; -} +}; -// It seems a linked list but it is not -// there will be only 2 of these for each stream -function CorkedRequest(state) { - var _this = this; +function done(stream, er) { + if (er) return stream.emit('error', er); - this.next = null; - this.entry = null; + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided + var ws = stream._writableState; + var ts = stream._transformState; - this.finish = function (err) { - var entry = _this.entry; - _this.entry = null; - while (entry) { - var cb = entry.callback; - state.pendingcb--; - cb(err); - entry = entry.next; - } - if (state.corkedRequestsFree) { - state.corkedRequestsFree.next = _this; - } else { - state.corkedRequestsFree = _this; - } - }; -} -}).call(this,require('_process')) -},{"./_stream_duplex":451,"_process":442,"buffer":83,"buffer-shims":81,"core-util-is":380,"events":418,"inherits":428,"process-nextick-args":441,"util-deprecate":479}],456:[function(require,module,exports){ -module.exports = require("./lib/_stream_passthrough.js") + if (ws.length) throw new Error('Calling transform done when ws.length != 0'); -},{"./lib/_stream_passthrough.js":452}],457:[function(require,module,exports){ -(function (process){ -var Stream = (function (){ - try { - return require('st' + 'ream'); // hack to fix a circular dependency issue when used with browserify - } catch(_){} -}()); -exports = module.exports = require('./lib/_stream_readable.js'); -exports.Stream = Stream || exports; -exports.Readable = exports; -exports.Writable = require('./lib/_stream_writable.js'); -exports.Duplex = require('./lib/_stream_duplex.js'); -exports.Transform = require('./lib/_stream_transform.js'); -exports.PassThrough = require('./lib/_stream_passthrough.js'); + if (ts.transforming) throw new Error('Calling transform done when still transforming'); -if (!process.browser && process.env.READABLE_STREAM === 'disable' && Stream) { - module.exports = Stream; + return stream.push(null); } +},{"./_stream_duplex":452,"core-util-is":381,"inherits":429}],456:[function(require,module,exports){ +(function (process){ +// A bit simpler than readable streams. +// Implement an async ._write(chunk, encoding, cb), and it'll handle all +// the drain event emission and buffering. -}).call(this,require('_process')) -},{"./lib/_stream_duplex.js":451,"./lib/_stream_passthrough.js":452,"./lib/_stream_readable.js":453,"./lib/_stream_transform.js":454,"./lib/_stream_writable.js":455,"_process":442}],458:[function(require,module,exports){ -module.exports = require("./lib/_stream_transform.js") - -},{"./lib/_stream_transform.js":454}],459:[function(require,module,exports){ -module.exports = require("./lib/_stream_writable.js") - -},{"./lib/_stream_writable.js":455}],460:[function(require,module,exports){ -(function (process,global){ -/** - * Copyright (c) 2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * https://raw.github.com/facebook/regenerator/master/LICENSE file. An - * additional grant of patent rights can be found in the PATENTS file in - * the same directory. - */ - -!(function(global) { - "use strict"; +'use strict'; - var hasOwn = Object.prototype.hasOwnProperty; - var undefined; // More compressible than void 0. - var $Symbol = typeof Symbol === "function" ? Symbol : {}; - var iteratorSymbol = $Symbol.iterator || "@@iterator"; - var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; +module.exports = Writable; - var inModule = typeof module === "object"; - var runtime = global.regeneratorRuntime; - if (runtime) { - if (inModule) { - // If regeneratorRuntime is defined globally and we're in a module, - // make the exports object identical to regeneratorRuntime. - module.exports = runtime; - } - // Don't bother evaluating the rest of this file if the runtime was - // already defined globally. - return; - } +/**/ +var processNextTick = require('process-nextick-args'); +/**/ - // Define the runtime globally (as expected by generated code) as either - // module.exports (if we're in a module) or a new, empty object. - runtime = global.regeneratorRuntime = inModule ? module.exports : {}; +/**/ +var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick; +/**/ - function wrap(innerFn, outerFn, self, tryLocsList) { - // If outerFn provided, then outerFn.prototype instanceof Generator. - var generator = Object.create((outerFn || Generator).prototype); - var context = new Context(tryLocsList || []); +Writable.WritableState = WritableState; - // The ._invoke method unifies the implementations of the .next, - // .throw, and .return methods. - generator._invoke = makeInvokeMethod(innerFn, self, context); +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ - return generator; - } - runtime.wrap = wrap; +/**/ +var internalUtil = { + deprecate: require('util-deprecate') +}; +/**/ - // Try/catch helper to minimize deoptimizations. Returns a completion - // record like context.tryEntries[i].completion. This interface could - // have been (and was previously) designed to take a closure to be - // invoked without arguments, but in all the cases we care about we - // already have an existing method we want to call, so there's no need - // to create a new function object. We can even get away with assuming - // the method takes exactly one argument, since that happens to be true - // in every case, so we don't have to touch the arguments object. The - // only additional allocation required is the completion record, which - // has a stable shape and so hopefully should be cheap to allocate. - function tryCatch(fn, obj, arg) { - try { - return { type: "normal", arg: fn.call(obj, arg) }; - } catch (err) { - return { type: "throw", arg: err }; - } +/**/ +var Stream; +(function () { + try { + Stream = require('st' + 'ream'); + } catch (_) {} finally { + if (!Stream) Stream = require('events').EventEmitter; } +})(); +/**/ - var GenStateSuspendedStart = "suspendedStart"; - var GenStateSuspendedYield = "suspendedYield"; - var GenStateExecuting = "executing"; - var GenStateCompleted = "completed"; +var Buffer = require('buffer').Buffer; +/**/ +var bufferShim = require('buffer-shims'); +/**/ - // Returning this object from the innerFn has the same effect as - // breaking out of the dispatch switch statement. - var ContinueSentinel = {}; +util.inherits(Writable, Stream); - // Dummy constructor functions that we use as the .constructor and - // .constructor.prototype properties for functions that return Generator - // objects. For full spec compliance, you may wish to configure your - // minifier not to mangle the names of these two functions. - function Generator() {} - function GeneratorFunction() {} - function GeneratorFunctionPrototype() {} +function nop() {} - var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype; - GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; - GeneratorFunctionPrototype.constructor = GeneratorFunction; - GeneratorFunctionPrototype[toStringTagSymbol] = GeneratorFunction.displayName = "GeneratorFunction"; +function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; + this.next = null; +} - // Helper for defining the .next, .throw, and .return methods of the - // Iterator interface in terms of a single ._invoke method. - function defineIteratorMethods(prototype) { - ["next", "throw", "return"].forEach(function(method) { - prototype[method] = function(arg) { - return this._invoke(method, arg); - }; - }); - } +var Duplex; +function WritableState(options, stream) { + Duplex = Duplex || require('./_stream_duplex'); - runtime.isGeneratorFunction = function(genFun) { - var ctor = typeof genFun === "function" && genFun.constructor; - return ctor - ? ctor === GeneratorFunction || - // For the native GeneratorFunction constructor, the best we can - // do is to check its .name property. - (ctor.displayName || ctor.name) === "GeneratorFunction" - : false; - }; + options = options || {}; - runtime.mark = function(genFun) { - if (Object.setPrototypeOf) { - Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); - } else { - genFun.__proto__ = GeneratorFunctionPrototype; - if (!(toStringTagSymbol in genFun)) { - genFun[toStringTagSymbol] = "GeneratorFunction"; - } - } - genFun.prototype = Object.create(Gp); - return genFun; - }; + // object stream flag to indicate whether or not this stream + // contains buffers or objects. + this.objectMode = !!options.objectMode; - // Within the body of any async function, `await x` is transformed to - // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test - // `value instanceof AwaitArgument` to determine if the yielded value is - // meant to be awaited. Some may consider the name of this method too - // cutesy, but they are curmudgeons. - runtime.awrap = function(arg) { - return new AwaitArgument(arg); - }; + if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode; - function AwaitArgument(arg) { - this.arg = arg; - } + // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() + var hwm = options.highWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; - function AsyncIterator(generator) { - function invoke(method, arg, resolve, reject) { - var record = tryCatch(generator[method], generator, arg); - if (record.type === "throw") { - reject(record.arg); - } else { - var result = record.arg; - var value = result.value; - if (value instanceof AwaitArgument) { - return Promise.resolve(value.arg).then(function(value) { - invoke("next", value, resolve, reject); - }, function(err) { - invoke("throw", err, resolve, reject); - }); - } + // cast to ints. + this.highWaterMark = ~ ~this.highWaterMark; - return Promise.resolve(value).then(function(unwrapped) { - // When a yielded Promise is resolved, its final value becomes - // the .value of the Promise<{value,done}> result for the - // current iteration. If the Promise is rejected, however, the - // result for this iteration will be rejected with the same - // reason. Note that rejections of yielded Promises are not - // thrown back into the generator function, as is the case - // when an awaited Promise is rejected. This difference in - // behavior between yield and await is important, because it - // allows the consumer to decide what to do with the yielded - // rejection (swallow it and continue, manually .throw it back - // into the generator, abandon iteration, whatever). With - // await, by contrast, there is no opportunity to examine the - // rejection reason outside the generator function, so the - // only option is to throw it from the await expression, and - // let the generator function handle the exception. - result.value = unwrapped; - resolve(result); - }, reject); - } - } + this.needDrain = false; + // at the start of calling end() + this.ending = false; + // when end() has been called, and returned + this.ended = false; + // when 'finish' is emitted + this.finished = false; - if (typeof process === "object" && process.domain) { - invoke = process.domain.bind(invoke); - } + // should we decode strings into buffers before passing to _write? + // this is here so that some node-core streams can optimize string + // handling at a lower level. + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; - var previousPromise; + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; - function enqueue(method, arg) { - function callInvokeWithMethodAndArg() { - return new Promise(function(resolve, reject) { - invoke(method, arg, resolve, reject); - }); - } + // not an actual buffer we keep track of, but a measurement + // of how much we're waiting to get pushed to some underlying + // socket or file. + this.length = 0; - return previousPromise = - // If enqueue has been called before, then we want to wait until - // all previous Promises have been resolved before calling invoke, - // so that results are always delivered in the correct order. If - // enqueue has not been called before, then it is important to - // call invoke immediately, without waiting on a callback to fire, - // so that the async generator function has the opportunity to do - // any necessary setup in a predictable way. This predictability - // is why the Promise constructor synchronously invokes its - // executor callback, and why async functions synchronously - // execute code before the first await. Since we implement simple - // async functions in terms of async generators, it is especially - // important to get this right, even though it requires care. - previousPromise ? previousPromise.then( - callInvokeWithMethodAndArg, - // Avoid propagating failures to Promises returned by later - // invocations of the iterator. - callInvokeWithMethodAndArg - ) : callInvokeWithMethodAndArg(); - } + // a flag to see when we're in the middle of a write. + this.writing = false; - // Define the unified helper method that is used to implement .next, - // .throw, and .return (see defineIteratorMethods). - this._invoke = enqueue; - } + // when true all writes will be buffered until .uncork() call + this.corked = 0; - defineIteratorMethods(AsyncIterator.prototype); + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; - // Note that simple async functions are implemented on top of - // AsyncIterator objects; they just return a Promise for the value of - // the final result produced by the iterator. - runtime.async = function(innerFn, outerFn, self, tryLocsList) { - var iter = new AsyncIterator( - wrap(innerFn, outerFn, self, tryLocsList) - ); + // a flag to know if we're processing previously buffered items, which + // may call the _write() callback in the same tick, so that we don't + // end up in an overlapped onwrite situation. + this.bufferProcessing = false; - return runtime.isGeneratorFunction(outerFn) - ? iter // If outerFn is a generator, return the full iterator. - : iter.next().then(function(result) { - return result.done ? result.value : iter.next(); - }); + // the callback that's passed to _write(chunk,cb) + this.onwrite = function (er) { + onwrite(stream, er); }; - function makeInvokeMethod(innerFn, self, context) { - var state = GenStateSuspendedStart; - - return function invoke(method, arg) { - if (state === GenStateExecuting) { - throw new Error("Generator is already running"); - } - - if (state === GenStateCompleted) { - if (method === "throw") { - throw arg; - } + // the callback that the user supplies to write(chunk,encoding,cb) + this.writecb = null; - // Be forgiving, per 25.3.3.3.3 of the spec: - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume - return doneResult(); - } + // the amount that is being written when _write is called. + this.writelen = 0; - while (true) { - var delegate = context.delegate; - if (delegate) { - if (method === "return" || - (method === "throw" && delegate.iterator[method] === undefined)) { - // A return or throw (when the delegate iterator has no throw - // method) always terminates the yield* loop. - context.delegate = null; + this.bufferedRequest = null; + this.lastBufferedRequest = null; - // If the delegate iterator has a return method, give it a - // chance to clean up. - var returnMethod = delegate.iterator["return"]; - if (returnMethod) { - var record = tryCatch(returnMethod, delegate.iterator, arg); - if (record.type === "throw") { - // If the return method threw an exception, let that - // exception prevail over the original return or throw. - method = "throw"; - arg = record.arg; - continue; - } - } + // number of pending user-supplied write callbacks + // this must be 0 before 'finish' can be emitted + this.pendingcb = 0; - if (method === "return") { - // Continue with the outer return, now that the delegate - // iterator has been terminated. - continue; - } - } + // emit prefinish if the only thing we're waiting for is _write cbs + // This is relevant for synchronous Transform streams + this.prefinished = false; - var record = tryCatch( - delegate.iterator[method], - delegate.iterator, - arg - ); + // True if the error was already emitted and should not be thrown again + this.errorEmitted = false; - if (record.type === "throw") { - context.delegate = null; + // count buffered requests + this.bufferedRequestCount = 0; - // Like returning generator.throw(uncaught), but without the - // overhead of an extra function call. - method = "throw"; - arg = record.arg; - continue; - } + // allocate the first CorkedRequest, there is always + // one allocated and free to use, and we maintain at most two + this.corkedRequestsFree = new CorkedRequest(this); +} - // Delegate generator ran and handled its own exceptions so - // regardless of what the method was, we continue as if it is - // "next" with an undefined arg. - method = "next"; - arg = undefined; +WritableState.prototype.getBuffer = function writableStateGetBuffer() { + var current = this.bufferedRequest; + var out = []; + while (current) { + out.push(current); + current = current.next; + } + return out; +}; - var info = record.arg; - if (info.done) { - context[delegate.resultName] = info.value; - context.next = delegate.nextLoc; - } else { - state = GenStateSuspendedYield; - return info; - } +(function () { + try { + Object.defineProperty(WritableState.prototype, 'buffer', { + get: internalUtil.deprecate(function () { + return this.getBuffer(); + }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.') + }); + } catch (_) {} +})(); - context.delegate = null; - } +var Duplex; +function Writable(options) { + Duplex = Duplex || require('./_stream_duplex'); - if (method === "next") { - // Setting context._sent for legacy support of Babel's - // function.sent implementation. - context.sent = context._sent = arg; + // Writable ctor is applied to Duplexes, though they're not + // instanceof Writable, they're instanceof Readable. + if (!(this instanceof Writable) && !(this instanceof Duplex)) return new Writable(options); - } else if (method === "throw") { - if (state === GenStateSuspendedStart) { - state = GenStateCompleted; - throw arg; - } + this._writableState = new WritableState(options, this); - if (context.dispatchException(arg)) { - // If the dispatched exception was caught by a catch block, - // then let that catch block handle the exception normally. - method = "next"; - arg = undefined; - } + // legacy. + this.writable = true; - } else if (method === "return") { - context.abrupt("return", arg); - } + if (options) { + if (typeof options.write === 'function') this._write = options.write; - state = GenStateExecuting; + if (typeof options.writev === 'function') this._writev = options.writev; + } - var record = tryCatch(innerFn, self, context); - if (record.type === "normal") { - // If an exception is thrown from innerFn, we leave state === - // GenStateExecuting and loop back for another invocation. - state = context.done - ? GenStateCompleted - : GenStateSuspendedYield; + Stream.call(this); +} - var info = { - value: record.arg, - done: context.done - }; +// Otherwise people can pipe Writable streams, which is just wrong. +Writable.prototype.pipe = function () { + this.emit('error', new Error('Cannot pipe, not readable')); +}; - if (record.arg === ContinueSentinel) { - if (context.delegate && method === "next") { - // Deliberately forget the last sent value so that we don't - // accidentally pass it on to the delegate. - arg = undefined; - } - } else { - return info; - } +function writeAfterEnd(stream, cb) { + var er = new Error('write after end'); + // TODO: defer error events consistently everywhere, not just the cb + stream.emit('error', er); + processNextTick(cb, er); +} - } else if (record.type === "throw") { - state = GenStateCompleted; - // Dispatch the exception by looping back around to the - // context.dispatchException(arg) call above. - method = "throw"; - arg = record.arg; - } - } - }; +// If we get something that is not a buffer, string, null, or undefined, +// and we're not in objectMode, then that's an error. +// Otherwise stream chunks are all considered to be of length=1, and the +// watermarks determine how many objects to keep in the buffer, rather than +// how many bytes or characters. +function validChunk(stream, state, chunk, cb) { + var valid = true; + var er = false; + // Always throw error if a null is written + // if we are not in object mode then throw + // if it is not a buffer, string, or undefined. + if (chunk === null) { + er = new TypeError('May not write null values to stream'); + } else if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + if (er) { + stream.emit('error', er); + processNextTick(cb, er); + valid = false; + } + return valid; +} + +Writable.prototype.write = function (chunk, encoding, cb) { + var state = this._writableState; + var ret = false; + + if (typeof encoding === 'function') { + cb = encoding; + encoding = null; } - // Define Generator.prototype.{next,throw,return} in terms of the - // unified ._invoke helper method. - defineIteratorMethods(Gp); + if (Buffer.isBuffer(chunk)) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; - Gp[iteratorSymbol] = function() { - return this; - }; + if (typeof cb !== 'function') cb = nop; - Gp[toStringTagSymbol] = "Generator"; + if (state.ended) writeAfterEnd(this, cb);else if (validChunk(this, state, chunk, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, chunk, encoding, cb); + } - Gp.toString = function() { - return "[object Generator]"; - }; + return ret; +}; - function pushTryEntry(locs) { - var entry = { tryLoc: locs[0] }; +Writable.prototype.cork = function () { + var state = this._writableState; - if (1 in locs) { - entry.catchLoc = locs[1]; - } + state.corked++; +}; - if (2 in locs) { - entry.finallyLoc = locs[2]; - entry.afterLoc = locs[3]; - } +Writable.prototype.uncork = function () { + var state = this._writableState; - this.tryEntries.push(entry); - } + if (state.corked) { + state.corked--; - function resetTryEntry(entry) { - var record = entry.completion || {}; - record.type = "normal"; - delete record.arg; - entry.completion = record; + if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); } +}; - function Context(tryLocsList) { - // The root entry object (effectively a try statement without a catch - // or a finally block) gives us a place to store values thrown from - // locations where there is no enclosing try statement. - this.tryEntries = [{ tryLoc: "root" }]; - tryLocsList.forEach(pushTryEntry, this); - this.reset(true); +Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + // node::ParseEncoding() requires lower case. + if (typeof encoding === 'string') encoding = encoding.toLowerCase(); + if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); + this._writableState.defaultEncoding = encoding; + return this; +}; + +function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { + chunk = bufferShim.from(chunk, encoding); } + return chunk; +} - runtime.keys = function(object) { - var keys = []; - for (var key in object) { - keys.push(key); - } - keys.reverse(); +// if we're already writing something, then just put this +// in the queue, and wait our turn. Otherwise, call _write +// If we return false, then we need a drain event, so set that flag. +function writeOrBuffer(stream, state, chunk, encoding, cb) { + chunk = decodeChunk(state, chunk, encoding); - // Rather than returning an object with a next method, we keep - // things simple and return the next function itself. - return function next() { - while (keys.length) { - var key = keys.pop(); - if (key in object) { - next.value = key; - next.done = false; - return next; - } - } + if (Buffer.isBuffer(chunk)) encoding = 'buffer'; + var len = state.objectMode ? 1 : chunk.length; - // To avoid creating an additional object, we just hang the .value - // and .done properties off the next function object itself. This - // also ensures that the minifier will not anonymize the function. - next.done = true; - return next; - }; - }; + state.length += len; - function values(iterable) { - if (iterable) { - var iteratorMethod = iterable[iteratorSymbol]; - if (iteratorMethod) { - return iteratorMethod.call(iterable); - } + var ret = state.length < state.highWaterMark; + // we must ensure that previous needDrain will not be reset to false. + if (!ret) state.needDrain = true; - if (typeof iterable.next === "function") { - return iterable; - } + if (state.writing || state.corked) { + var last = state.lastBufferedRequest; + state.lastBufferedRequest = new WriteReq(chunk, encoding, cb); + if (last) { + last.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; + } + state.bufferedRequestCount += 1; + } else { + doWrite(stream, state, false, len, chunk, encoding, cb); + } - if (!isNaN(iterable.length)) { - var i = -1, next = function next() { - while (++i < iterable.length) { - if (hasOwn.call(iterable, i)) { - next.value = iterable[i]; - next.done = false; - return next; - } - } + return ret; +} - next.value = undefined; - next.done = true; +function doWrite(stream, state, writev, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); + state.sync = false; +} - return next; - }; +function onwriteError(stream, state, sync, er, cb) { + --state.pendingcb; + if (sync) processNextTick(cb, er);else cb(er); - return next.next = next; - } - } + stream._writableState.errorEmitted = true; + stream.emit('error', er); +} - // Return an iterator with no values. - return { next: doneResult }; - } - runtime.values = values; +function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; +} - function doneResult() { - return { value: undefined, done: true }; - } +function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; - Context.prototype = { - constructor: Context, + onwriteStateUpdate(state); - reset: function(skipTempReset) { - this.prev = 0; - this.next = 0; - // Resetting context._sent for legacy support of Babel's - // function.sent implementation. - this.sent = this._sent = undefined; - this.done = false; - this.delegate = null; + if (er) onwriteError(stream, state, sync, er, cb);else { + // Check if we're actually ready to finish, but don't emit yet + var finished = needFinish(state); - this.tryEntries.forEach(resetTryEntry); + if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { + clearBuffer(stream, state); + } - if (!skipTempReset) { - for (var name in this) { - // Not sure about the optimal order of these conditions: - if (name.charAt(0) === "t" && - hasOwn.call(this, name) && - !isNaN(+name.slice(1))) { - this[name] = undefined; - } - } + if (sync) { + /**/ + asyncWrite(afterWrite, stream, state, finished, cb); + /**/ + } else { + afterWrite(stream, state, finished, cb); } - }, + } +} - stop: function() { - this.done = true; +function afterWrite(stream, state, finished, cb) { + if (!finished) onwriteDrain(stream, state); + state.pendingcb--; + cb(); + finishMaybe(stream, state); +} - var rootEntry = this.tryEntries[0]; - var rootRecord = rootEntry.completion; - if (rootRecord.type === "throw") { - throw rootRecord.arg; - } +// Must force callback to be called on nextTick, so that we don't +// emit 'drain' before the write() consumer gets the 'false' return +// value, and has a chance to attach a 'drain' listener. +function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit('drain'); + } +} - return this.rval; - }, +// if there's something in the buffer waiting, then process it +function clearBuffer(stream, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; - dispatchException: function(exception) { - if (this.done) { - throw exception; - } + if (stream._writev && entry && entry.next) { + // Fast case, write everything using _writev() + var l = state.bufferedRequestCount; + var buffer = new Array(l); + var holder = state.corkedRequestsFree; + holder.entry = entry; - var context = this; - function handle(loc, caught) { - record.type = "throw"; - record.arg = exception; - context.next = loc; - return !!caught; - } + var count = 0; + while (entry) { + buffer[count] = entry; + entry = entry.next; + count += 1; + } - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - var record = entry.completion; + doWrite(stream, state, true, state.length, buffer, '', holder.finish); - if (entry.tryLoc === "root") { - // Exception thrown outside of any try block that could handle - // it, so set the completion value of the entire function to - // throw the exception. - return handle("end"); - } + // doWrite is almost always async, defer these to save a bit of time + // as the hot path ends with doWrite + state.pendingcb++; + state.lastBufferedRequest = null; + if (holder.next) { + state.corkedRequestsFree = holder.next; + holder.next = null; + } else { + state.corkedRequestsFree = new CorkedRequest(state); + } + } else { + // Slow case, write chunks one-by-one + while (entry) { + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; - if (entry.tryLoc <= this.prev) { - var hasCatch = hasOwn.call(entry, "catchLoc"); - var hasFinally = hasOwn.call(entry, "finallyLoc"); + doWrite(stream, state, false, len, chunk, encoding, cb); + entry = entry.next; + // if we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + if (state.writing) { + break; + } + } - if (hasCatch && hasFinally) { - if (this.prev < entry.catchLoc) { - return handle(entry.catchLoc, true); - } else if (this.prev < entry.finallyLoc) { - return handle(entry.finallyLoc); - } + if (entry === null) state.lastBufferedRequest = null; + } - } else if (hasCatch) { - if (this.prev < entry.catchLoc) { - return handle(entry.catchLoc, true); - } + state.bufferedRequestCount = 0; + state.bufferedRequest = entry; + state.bufferProcessing = false; +} - } else if (hasFinally) { - if (this.prev < entry.finallyLoc) { - return handle(entry.finallyLoc); - } +Writable.prototype._write = function (chunk, encoding, cb) { + cb(new Error('not implemented')); +}; - } else { - throw new Error("try statement without catch or finally"); - } - } - } - }, +Writable.prototype._writev = null; - abrupt: function(type, arg) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.tryLoc <= this.prev && - hasOwn.call(entry, "finallyLoc") && - this.prev < entry.finallyLoc) { - var finallyEntry = entry; - break; - } - } +Writable.prototype.end = function (chunk, encoding, cb) { + var state = this._writableState; - if (finallyEntry && - (type === "break" || - type === "continue") && - finallyEntry.tryLoc <= arg && - arg <= finallyEntry.finallyLoc) { - // Ignore the finally entry if control is not jumping to a - // location outside the try/catch block. - finallyEntry = null; - } + if (typeof chunk === 'function') { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } - var record = finallyEntry ? finallyEntry.completion : {}; - record.type = type; - record.arg = arg; + if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); - if (finallyEntry) { - this.next = finallyEntry.finallyLoc; - } else { - this.complete(record); - } + // .end() fully uncorks + if (state.corked) { + state.corked = 1; + this.uncork(); + } - return ContinueSentinel; - }, + // ignore unnecessary end() calls. + if (!state.ending && !state.finished) endWritable(this, state, cb); +}; - complete: function(record, afterLoc) { - if (record.type === "throw") { - throw record.arg; - } +function needFinish(state) { + return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; +} - if (record.type === "break" || - record.type === "continue") { - this.next = record.arg; - } else if (record.type === "return") { - this.rval = record.arg; - this.next = "end"; - } else if (record.type === "normal" && afterLoc) { - this.next = afterLoc; - } - }, +function prefinish(stream, state) { + if (!state.prefinished) { + state.prefinished = true; + stream.emit('prefinish'); + } +} - finish: function(finallyLoc) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.finallyLoc === finallyLoc) { - this.complete(entry.completion, entry.afterLoc); - resetTryEntry(entry); - return ContinueSentinel; - } - } - }, +function finishMaybe(stream, state) { + var need = needFinish(state); + if (need) { + if (state.pendingcb === 0) { + prefinish(stream, state); + state.finished = true; + stream.emit('finish'); + } else { + prefinish(stream, state); + } + } + return need; +} - "catch": function(tryLoc) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.tryLoc === tryLoc) { - var record = entry.completion; - if (record.type === "throw") { - var thrown = record.arg; - resetTryEntry(entry); - } - return thrown; - } - } +function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); + if (cb) { + if (state.finished) processNextTick(cb);else stream.once('finish', cb); + } + state.ended = true; + stream.writable = false; +} - // The context.catch method must only be called with a location - // argument that corresponds to a known catch block. - throw new Error("illegal catch attempt"); - }, +// It seems a linked list but it is not +// there will be only 2 of these for each stream +function CorkedRequest(state) { + var _this = this; - delegateYield: function(iterable, resultName, nextLoc) { - this.delegate = { - iterator: values(iterable), - resultName: resultName, - nextLoc: nextLoc - }; + this.next = null; + this.entry = null; - return ContinueSentinel; + this.finish = function (err) { + var entry = _this.entry; + _this.entry = null; + while (entry) { + var cb = entry.callback; + state.pendingcb--; + cb(err); + entry = entry.next; + } + if (state.corkedRequestsFree) { + state.corkedRequestsFree.next = _this; + } else { + state.corkedRequestsFree = _this; } }; -})( - // Among the various tricks for obtaining a reference to the global - // object, this seems to be the most reliable technique that does not - // use indirect eval (which violates Content Security Policy). - typeof global === "object" ? global : - typeof window === "object" ? window : - typeof self === "object" ? self : this -); +} +}).call(this,require('_process')) +},{"./_stream_duplex":452,"_process":443,"buffer":84,"buffer-shims":82,"core-util-is":381,"events":419,"inherits":429,"process-nextick-args":442,"util-deprecate":479}],457:[function(require,module,exports){ +module.exports = require("./lib/_stream_passthrough.js") -}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"_process":442}],461:[function(require,module,exports){ +},{"./lib/_stream_passthrough.js":453}],458:[function(require,module,exports){ +(function (process){ +var Stream = (function (){ + try { + return require('st' + 'ream'); // hack to fix a circular dependency issue when used with browserify + } catch(_){} +}()); +exports = module.exports = require('./lib/_stream_readable.js'); +exports.Stream = Stream || exports; +exports.Readable = exports; +exports.Writable = require('./lib/_stream_writable.js'); +exports.Duplex = require('./lib/_stream_duplex.js'); +exports.Transform = require('./lib/_stream_transform.js'); +exports.PassThrough = require('./lib/_stream_passthrough.js'); + +if (!process.browser && process.env.READABLE_STREAM === 'disable' && Stream) { + module.exports = Stream; +} + +}).call(this,require('_process')) +},{"./lib/_stream_duplex.js":452,"./lib/_stream_passthrough.js":453,"./lib/_stream_readable.js":454,"./lib/_stream_transform.js":455,"./lib/_stream_writable.js":456,"_process":443}],459:[function(require,module,exports){ +module.exports = require("./lib/_stream_transform.js") + +},{"./lib/_stream_transform.js":455}],460:[function(require,module,exports){ +module.exports = require("./lib/_stream_writable.js") + +},{"./lib/_stream_writable.js":456}],461:[function(require,module,exports){ (function (Buffer){ /* CryptoJS v3.1.2 @@ -65640,7 +65571,7 @@ function ripemd160 (message) { module.exports = ripemd160 }).call(this,require("buffer").Buffer) -},{"buffer":83}],462:[function(require,module,exports){ +},{"buffer":84}],462:[function(require,module,exports){ (function (Buffer){ const assert = require('assert') /** @@ -65873,7 +65804,7 @@ function toBuffer (v) { } }).call(this,require("buffer").Buffer) -},{"assert":48,"buffer":83}],463:[function(require,module,exports){ +},{"assert":48,"buffer":84}],463:[function(require,module,exports){ (function (Buffer){ var pbkdf2Sync = require('pbkdf2').pbkdf2Sync @@ -66056,7 +65987,7 @@ function arraycopy (src, srcPos, dest, destPos, length) { module.exports = scrypt }).call(this,require("buffer").Buffer) -},{"buffer":83,"pbkdf2":440}],464:[function(require,module,exports){ +},{"buffer":84,"pbkdf2":441}],464:[function(require,module,exports){ 'use strict' module.exports = require('./lib')(require('./lib/elliptic')) @@ -66108,7 +66039,7 @@ exports.isNumberInInterval = function (number, x, y, message) { } }).call(this,{"isBuffer":require("../../is-buffer/index.js")}) -},{"../../is-buffer/index.js":429}],466:[function(require,module,exports){ +},{"../../is-buffer/index.js":430}],466:[function(require,module,exports){ (function (Buffer){ 'use strict' var createHash = require('create-hash') @@ -66359,7 +66290,7 @@ exports.ecdhUnsafe = function (publicKey, privateKey, compressed) { } }).call(this,require("buffer").Buffer) -},{"../messages.json":468,"bn.js":53,"buffer":83,"create-hash":382,"elliptic":397}],467:[function(require,module,exports){ +},{"../messages.json":468,"bn.js":54,"buffer":84,"create-hash":383,"elliptic":398}],467:[function(require,module,exports){ (function (Buffer){ 'use strict' var bip66 = require('bip66') @@ -66679,7 +66610,7 @@ module.exports = function (secp256k1) { } }).call(this,require("buffer").Buffer) -},{"./assert":465,"./messages.json":468,"bip66":52,"buffer":83}],468:[function(require,module,exports){ +},{"./assert":465,"./messages.json":468,"bip66":53,"buffer":84}],468:[function(require,module,exports){ module.exports={ "COMPRESSED_TYPE_INVALID": "compressed should be a boolean", "EC_PRIVATE_KEY_TYPE_INVALID": "private key should be a Buffer", @@ -66790,7 +66721,7 @@ Hash.prototype._update = function () { module.exports = Hash }).call(this,require("buffer").Buffer) -},{"buffer":83}],470:[function(require,module,exports){ +},{"buffer":84}],470:[function(require,module,exports){ var exports = module.exports = function SHA (algorithm) { algorithm = algorithm.toLowerCase() @@ -66904,7 +66835,7 @@ Sha.prototype._hash = function () { module.exports = Sha }).call(this,require("buffer").Buffer) -},{"./hash":469,"buffer":83,"inherits":428}],472:[function(require,module,exports){ +},{"./hash":469,"buffer":84,"inherits":429}],472:[function(require,module,exports){ (function (Buffer){ /* * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined @@ -67006,7 +66937,7 @@ Sha1.prototype._hash = function () { module.exports = Sha1 }).call(this,require("buffer").Buffer) -},{"./hash":469,"buffer":83,"inherits":428}],473:[function(require,module,exports){ +},{"./hash":469,"buffer":84,"inherits":429}],473:[function(require,module,exports){ (function (Buffer){ /** * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined @@ -67062,7 +66993,7 @@ Sha224.prototype._hash = function () { module.exports = Sha224 }).call(this,require("buffer").Buffer) -},{"./hash":469,"./sha256":474,"buffer":83,"inherits":428}],474:[function(require,module,exports){ +},{"./hash":469,"./sha256":474,"buffer":84,"inherits":429}],474:[function(require,module,exports){ (function (Buffer){ /** * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined @@ -67200,7 +67131,7 @@ Sha256.prototype._hash = function () { module.exports = Sha256 }).call(this,require("buffer").Buffer) -},{"./hash":469,"buffer":83,"inherits":428}],475:[function(require,module,exports){ +},{"./hash":469,"buffer":84,"inherits":429}],475:[function(require,module,exports){ (function (Buffer){ var inherits = require('inherits') var SHA512 = require('./sha512') @@ -67260,7 +67191,7 @@ Sha384.prototype._hash = function () { module.exports = Sha384 }).call(this,require("buffer").Buffer) -},{"./hash":469,"./sha512":476,"buffer":83,"inherits":428}],476:[function(require,module,exports){ +},{"./hash":469,"./sha512":476,"buffer":84,"inherits":429}],476:[function(require,module,exports){ (function (Buffer){ var inherits = require('inherits') var Hash = require('./hash') @@ -67523,7 +67454,7 @@ Sha512.prototype._hash = function () { module.exports = Sha512 }).call(this,require("buffer").Buffer) -},{"./hash":469,"buffer":83,"inherits":428}],477:[function(require,module,exports){ +},{"./hash":469,"buffer":84,"inherits":429}],477:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -67652,7 +67583,7 @@ Stream.prototype.pipe = function(dest, options) { return dest; }; -},{"events":418,"inherits":428,"readable-stream/duplex.js":450,"readable-stream/passthrough.js":456,"readable-stream/readable.js":457,"readable-stream/transform.js":458,"readable-stream/writable.js":459}],478:[function(require,module,exports){ +},{"events":419,"inherits":429,"readable-stream/duplex.js":451,"readable-stream/passthrough.js":457,"readable-stream/readable.js":458,"readable-stream/transform.js":459,"readable-stream/writable.js":460}],478:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -67875,7 +67806,7 @@ function base64DetectIncompleteChar(buffer) { this.charLength = this.charReceived ? 3 : 0; } -},{"buffer":83}],479:[function(require,module,exports){ +},{"buffer":84}],479:[function(require,module,exports){ (function (global){ /** @@ -68543,7 +68474,7 @@ function hasOwnProperty(obj, prop) { } }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./support/isBuffer":480,"_process":442,"inherits":428}],482:[function(require,module,exports){ +},{"./support/isBuffer":480,"_process":443,"inherits":429}],482:[function(require,module,exports){ (function (global){ var rng; @@ -68903,4 +68834,4 @@ exports.createContext = Script.createContext = function (context) { return copy; }; -},{"indexof":427}]},{},[27]); +},{"indexof":428}]},{},[27]); diff --git a/dist/js/etherwallet-master.js b/dist/js/etherwallet-master.js index 2a3341a1f5..6272e000ba 100644 --- a/dist/js/etherwallet-master.js +++ b/dist/js/etherwallet-master.js @@ -1,2532 +1,2474 @@ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o0) - ajaxReq.queuePost(); - }); -} -ajaxReq.post = function(data, callback) { - this.pendingPosts.push({ - data: data, - callback: callback - }); - if(this.pendingPosts.length==1) - this.queuePost(); -} -ajaxReq.getETHvalue = function(callback) { - var prefix = "eth"; - this.http.get(this.COINMARKETCAPAPI + prefix).then(function(data) { - data = data['data']['price']; - var priceObj = { - usd: data['usd'].toFixed(6), - eur: data['eur'].toFixed(6), - btc: data['btc'].toFixed(6) - }; - callback(priceObj); - }); -} -ajaxReq.getDAOProposals = function(callback) { - this.http.get(this.DAOPROPOSALSURL).then(function(data) { - callback(data.data); - }); -} +'use strict'; +var http; +var ajaxReq = function() {} +ajaxReq.http = null; +ajaxReq.postSerializer = null; +ajaxReq.SERVERURL = "https://rpc.myetherwallet.com/api.php"; +ajaxReq.DAOPROPOSALSURL = "https://rpc.myetherwallet.com/TheDAO/getDAOProposals.php"; +ajaxReq.COINMARKETCAPAPI = "https://coinmarketcap-nexuist.rhcloud.com/api/"; +ajaxReq.pendingPosts = []; +ajaxReq.config = { + headers: { + 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' + } +}; +ajaxReq.getBalance = function(addr, callback) { + this.post({ + balance: addr + }, callback); +} +ajaxReq.getTransactionData = function(addr, callback) { + this.post({ + txdata: addr + }, callback); +} +ajaxReq.sendRawTx = function(rawTx, callback) { + this.post({ + rawtx: rawTx + }, callback); +} +ajaxReq.getEstimatedGas = function(txobj, callback) { + this.post({ + estimatedGas: txobj + }, callback); +} +ajaxReq.getEthCall = function(txobj, callback) { + this.post({ + ethCall: txobj + }, callback); +} +ajaxReq.queuePost = function() { + var data = this.pendingPosts[0].data; + var callback = this.pendingPosts[0].callback; + this.http.post(this.SERVERURL, this.postSerializer(data), this.config).then(function(data) { + callback(data.data); + ajaxReq.pendingPosts.splice(0, 1); + if(ajaxReq.pendingPosts.length>0) + ajaxReq.queuePost(); + }); +} +ajaxReq.post = function(data, callback) { + this.pendingPosts.push({ + data: data, + callback: callback + }); + if(this.pendingPosts.length==1) + this.queuePost(); +} +ajaxReq.getETHvalue = function(callback) { + var prefix = "eth"; + this.http.get(this.COINMARKETCAPAPI + prefix).then(function(data) { + data = data['data']['price']; + var priceObj = { + usd: data['usd'].toFixed(6), + eur: data['eur'].toFixed(6), + btc: data['btc'].toFixed(6) + }; + callback(priceObj); + }); +} +ajaxReq.getDAOProposals = function(callback) { + this.http.get(this.DAOPROPOSALSURL).then(function(data) { + callback(data.data); + }); +} module.exports = ajaxReq; },{}],2:[function(require,module,exports){ -'use strict'; -var addWalletCtrl = function($scope, $sce) { - $scope.showBtnGen = $scope.showBtnUnlock = $scope.showBtnAdd = $scope.showBtnAddWallet = $scope.showAddWallet = $scope.requireFPass = $scope.requirePPass = $scope.showPassTxt = false; - $scope.nickNames = []; - $scope.filePassword = $scope.fileContent = ""; - $scope.wallet = null; - $scope.addAccount = { - address: "", - nickName: "", - encStr: "", - password: "" - }; - $scope.onPrivKeyChange = function() { - $scope.addWalletStats = ""; - $scope.requirePPass = $scope.manualprivkey.length == 128 || $scope.manualprivkey.length == 132; - $scope.showBtnUnlock = $scope.manualprivkey.length == 64; - }; - $scope.onPrivKeyPassChange = function() { - $scope.showBtnUnlock = $scope.privPassword.length > 6; - }; - $scope.showContent = function($fileContent) { - $scope.fileStatus = $sce.trustAsHtml(globalFuncs.getSuccessText("File Selected: " + document.getElementById('fselector').files[0].name)); - try { - $scope.requireFPass = Wallet.walletRequirePass($fileContent); - $scope.showBtnUnlock = !$scope.requireFPass; - $scope.fileContent = $fileContent; - } catch (e) { - $scope.fileStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - }; - $scope.openFileDialog = function($fileContent) { - $scope.addWalletStats = ""; - document.getElementById('fselector').click(); - }; - $scope.onFilePassChange = function() { - $scope.showBtnUnlock = $scope.filePassword.length > 6; - }; - $scope.decryptWallet = function() { - $scope.wallet = null; - $scope.addWalletStats = ""; - try { - if ($scope.walletType == "pasteprivkey" && $scope.requirePPass) { - $scope.wallet = Wallet.fromMyEtherWalletKey($scope.manualprivkey, $scope.privPassword); - $scope.addAccount.password = $scope.privPassword; - } else if ($scope.walletType == "pasteprivkey" && !$scope.requirePPass) { - $scope.wallet = new Wallet($scope.manualprivkey); - $scope.addAccount.password = ''; - } else if ($scope.walletType == "fileupload") { - $scope.wallet = Wallet.getWalletFromPrivKeyFile($scope.fileContent, $scope.filePassword); - $scope.addAccount.password = $scope.filePassword; - } - $scope.addAccount.address = $scope.wallet.getAddressString(); - } catch (e) { - $scope.addWalletStats = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[6] + e)); - } - if ($scope.wallet != null) { - $scope.addWalletStats = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[1])); - $scope.showAddWallet = true; - $scope.showPassTxt = $scope.addAccount.password == ''; - $scope.setBalance(); - } - }; - $scope.setNickNames = function() { - cxFuncs.getAllNickNames(function(nicks) { - $scope.nickNames = nicks; - }); - }; - $scope.setNickNames(); - $scope.newWalletChange = function(varStatus, shwbtn) { - if ($scope.addAccount.nickName != "" && $scope.nickNames.indexOf($scope.addAccount.nickName) == -1 && $scope.addAccount.password.length > 8) $scope[shwbtn] = true; - else $scope[shwbtn] = false; - if ($scope.nickNames.indexOf($scope.addAccount.nickName) !== -1) $scope[varStatus] = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[13])); - else $scope[varStatus] = ""; - } - $scope.watchOnlyChange = function() { - if ($scope.addAccount.address != "" && $scope.addAccount.nickName != "" && $scope.nickNames.indexOf($scope.addAccount.nickName) == -1 && ethFuncs.validateEtherAddress($scope.addAccount.address)) $scope.showBtnAdd = true; - else $scope.showBtnAdd = false; - if ($scope.addAccount.address != "" && !ethFuncs.validateEtherAddress($scope.addAccount.address)) $scope.watchOnlyStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[5])); - else if ($scope.nickNames.indexOf($scope.addAccount.nickName) !== -1) $scope.watchOnlyStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[13])); - else $scope.watchOnlyStatus = ""; - } - $scope.addWatchOnly = function() { - if ($scope.nickNames.indexOf($scope.addAccount.nickName) !== -1) { - $scope.addWalletStats = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[13])); - return; - } - cxFuncs.addWatchOnlyAddress($scope.addAccount.address, $scope.addAccount.nickName, function() { - if (chrome.runtime.lastError) { - $scope.addWalletStats = $sce.trustAsHtml(globalFuncs.getDangerText(chrome.runtime.lastError.message)); - } else { - $scope.addWalletStats = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[3] + $scope.addAccount.address)); - $scope.setNickNames(); - } - $scope.$apply(); - }); - } - $scope.isStrongPass = function(pass) { - return globalFuncs.isStrongPass(pass); - } - $scope.$watch('walletType', function() { - $scope.showBtnGen = $scope.showBtnUnlock = $scope.showBtnAdd = $scope.showAddWallet = false; - $scope.addNewNick = $scope.addNewPass = ""; - $scope.addWalletStats = ""; - }); - $scope.addWalletToStorage = function(status) { - if ($scope.nickNames.indexOf($scope.addAccount.nickName) !== -1) { - $scope[status] = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[13])); - return; - } else if($scope.nickNames.indexOf(ethUtil.toChecksumAddress($scope.addAccount.address)) !== -1){ - $scope[status] = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[16])); - return; - } - cxFuncs.addWalletToStorage($scope.addAccount.address, $scope.addAccount.encStr, $scope.addAccount.nickName, function() { - if (chrome.runtime.lastError) { - $scope[status] = $sce.trustAsHtml(globalFuncs.getDangerText(chrome.runtime.lastError.message)); - } else { - $scope[status] = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[3] + $scope.addAccount.address)); - $scope.setNickNames(); - } - $scope.$apply(); - }); - } - $scope.importWalletToStorage = function() { - var wStr = $scope.wallet.toV3($scope.addAccount.password, { - kdf: globalFuncs.kdf, - n: globalFuncs.scrypt.n - }); - $scope.addAccount.encStr = JSON.stringify(wStr); - $scope.addWalletToStorage('addStatus'); - } - $scope.generateWallet = function() { - var wallet = Wallet.generate(false); - var wStr = wallet.toV3($scope.addAccount.password, { - kdf: globalFuncs.kdf, - n: globalFuncs.scrypt.n - }); - $scope.addAccount.encStr = JSON.stringify(wStr); - $scope.addAccount.address = wallet.getAddressString(); - $scope.addWalletToStorage('addWalletStats'); - } - $scope.setBalance = function() { - ajaxReq.getBalance($scope.wallet.getAddressString(), function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.etherBalance = etherUnits.toEther(data.data.balance, 'wei'); - ajaxReq.getETHvalue(function(data) { - $scope.usdBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.usd); - $scope.eurBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.eur); - $scope.btcBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.btc); - }); - } - }); - } -}; -module.exports = addWalletCtrl; +'use strict'; +var addWalletCtrl = function($scope, $sce) { + $scope.showBtnGen = $scope.showBtnUnlock = $scope.showBtnAdd = $scope.showBtnAddWallet = $scope.showAddWallet = $scope.requireFPass = $scope.requirePPass = $scope.showPassTxt = false; + $scope.nickNames = []; + $scope.filePassword = $scope.fileContent = ""; + $scope.wallet = null; + $scope.addAccount = { + address: "", + nickName: "", + encStr: "", + password: "" + }; + $scope.onPrivKeyChange = function() { + $scope.addWalletStats = ""; + $scope.requirePPass = $scope.manualprivkey.length == 128 || $scope.manualprivkey.length == 132; + $scope.showBtnUnlock = $scope.manualprivkey.length == 64; + }; + $scope.onPrivKeyPassChange = function() { + $scope.showBtnUnlock = $scope.privPassword.length > 6; + }; + $scope.showContent = function($fileContent) { + $scope.fileStatus = $sce.trustAsHtml(globalFuncs.getSuccessText("File Selected: " + document.getElementById('fselector').files[0].name)); + try { + $scope.requireFPass = Wallet.walletRequirePass($fileContent); + $scope.showBtnUnlock = !$scope.requireFPass; + $scope.fileContent = $fileContent; + } catch (e) { + $scope.fileStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + }; + $scope.openFileDialog = function($fileContent) { + $scope.addWalletStats = ""; + document.getElementById('fselector').click(); + }; + $scope.onFilePassChange = function() { + $scope.showBtnUnlock = $scope.filePassword.length > 6; + }; + $scope.decryptWallet = function() { + $scope.wallet = null; + $scope.addWalletStats = ""; + try { + if ($scope.walletType == "pasteprivkey" && $scope.requirePPass) { + $scope.wallet = Wallet.fromMyEtherWalletKey($scope.manualprivkey, $scope.privPassword); + $scope.addAccount.password = $scope.privPassword; + } else if ($scope.walletType == "pasteprivkey" && !$scope.requirePPass) { + $scope.wallet = new Wallet($scope.manualprivkey); + $scope.addAccount.password = ''; + } else if ($scope.walletType == "fileupload") { + $scope.wallet = Wallet.getWalletFromPrivKeyFile($scope.fileContent, $scope.filePassword); + $scope.addAccount.password = $scope.filePassword; + } + $scope.addAccount.address = $scope.wallet.getAddressString(); + } catch (e) { + $scope.addWalletStats = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[6] + e)); + } + if ($scope.wallet != null) { + $scope.addWalletStats = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[1])); + $scope.showAddWallet = true; + $scope.showPassTxt = $scope.addAccount.password == ''; + $scope.setBalance(); + } + }; + $scope.setNickNames = function() { + cxFuncs.getAllNickNames(function(nicks) { + $scope.nickNames = nicks; + }); + }; + $scope.setNickNames(); + $scope.newWalletChange = function(varStatus, shwbtn) { + if ($scope.addAccount.nickName != "" && $scope.nickNames.indexOf($scope.addAccount.nickName) == -1 && $scope.addAccount.password.length > 8) $scope[shwbtn] = true; + else $scope[shwbtn] = false; + if ($scope.nickNames.indexOf($scope.addAccount.nickName) !== -1) $scope[varStatus] = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[13])); + else $scope[varStatus] = ""; + } + $scope.watchOnlyChange = function() { + if ($scope.addAccount.address != "" && $scope.addAccount.nickName != "" && $scope.nickNames.indexOf($scope.addAccount.nickName) == -1 && ethFuncs.validateEtherAddress($scope.addAccount.address)) $scope.showBtnAdd = true; + else $scope.showBtnAdd = false; + if ($scope.addAccount.address != "" && !ethFuncs.validateEtherAddress($scope.addAccount.address)) $scope.watchOnlyStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[5])); + else if ($scope.nickNames.indexOf($scope.addAccount.nickName) !== -1) $scope.watchOnlyStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[13])); + else $scope.watchOnlyStatus = ""; + } + $scope.addWatchOnly = function() { + if ($scope.nickNames.indexOf($scope.addAccount.nickName) !== -1) { + $scope.addWalletStats = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[13])); + return; + } + cxFuncs.addWatchOnlyAddress($scope.addAccount.address, $scope.addAccount.nickName, function() { + if (chrome.runtime.lastError) { + $scope.addWalletStats = $sce.trustAsHtml(globalFuncs.getDangerText(chrome.runtime.lastError.message)); + } else { + $scope.addWalletStats = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[3] + $scope.addAccount.address)); + $scope.setNickNames(); + } + $scope.$apply(); + }); + } + $scope.isStrongPass = function(pass) { + return globalFuncs.isStrongPass(pass); + } + $scope.$watch('walletType', function() { + $scope.showBtnGen = $scope.showBtnUnlock = $scope.showBtnAdd = $scope.showAddWallet = false; + $scope.addNewNick = $scope.addNewPass = ""; + $scope.addWalletStats = ""; + }); + $scope.addWalletToStorage = function(status) { + if ($scope.nickNames.indexOf($scope.addAccount.nickName) !== -1) { + $scope[status] = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[13])); + return; + } else if($scope.nickNames.indexOf(ethUtil.toChecksumAddress($scope.addAccount.address)) !== -1){ + $scope[status] = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[16])); + return; + } + cxFuncs.addWalletToStorage($scope.addAccount.address, $scope.addAccount.encStr, $scope.addAccount.nickName, function() { + if (chrome.runtime.lastError) { + $scope[status] = $sce.trustAsHtml(globalFuncs.getDangerText(chrome.runtime.lastError.message)); + } else { + $scope[status] = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[3] + $scope.addAccount.address)); + $scope.setNickNames(); + } + $scope.$apply(); + }); + } + $scope.importWalletToStorage = function() { + var wStr = $scope.wallet.toV3($scope.addAccount.password, { + kdf: globalFuncs.kdf, + n: globalFuncs.scrypt.n + }); + $scope.addAccount.encStr = JSON.stringify(wStr); + $scope.addWalletToStorage('addStatus'); + } + $scope.generateWallet = function() { + var wallet = Wallet.generate(false); + var wStr = wallet.toV3($scope.addAccount.password, { + kdf: globalFuncs.kdf, + n: globalFuncs.scrypt.n + }); + $scope.addAccount.encStr = JSON.stringify(wStr); + $scope.addAccount.address = wallet.getAddressString(); + $scope.addWalletToStorage('addWalletStats'); + } + $scope.setBalance = function() { + ajaxReq.getBalance($scope.wallet.getAddressString(), function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.etherBalance = etherUnits.toEther(data.data.balance, 'wei'); + ajaxReq.getETHvalue(function(data) { + $scope.usdBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.usd); + $scope.eurBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.eur); + $scope.btcBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.btc); + }); + } + }); + } +}; +module.exports = addWalletCtrl; },{}],3:[function(require,module,exports){ -'use strict'; -var cxDecryptWalletCtrl = function($scope, $sce, walletService) { - $scope.allWallets = []; - $scope.selectedWallet = $scope.password = ""; - $scope.setAllWallets = function() { - cxFuncs.getWalletsArr(function(wlts) { - $scope.allWallets = wlts; - $scope.updateBalance(); - $scope.$apply(); - }); - }; - $scope.updateBalance = function() { - for (var i = 0; i < $scope.allWallets.length; i++) { - $scope.setBalance($scope.allWallets[i].addr,i); - } - }; - $scope.setBalance = function(address,id) { - ajaxReq.getBalance(address, function(data) { - if (data.error) { - $scope.allWallets[id].balance = data.msg; - } else { - $scope.allWallets[id].balance = etherUnits.toEther(data.data.balance, 'wei'); - } - }); - }; - $scope.setAllWallets(); - $scope.getPrivFromAdd = function(){ - if ($scope.selectedWallet=="") throw globalFuncs.errorMsgs[5]; - for (var i = 0; i < $scope.allWallets.length; i++) { - if( $scope.allWallets[i].addr==$scope.selectedWallet) - return $scope.allWallets[i].priv; - } - throw globalFuncs.errorMsgs[14]; - } - $scope.decryptWallet = function() { - $scope.wallet=null; - $scope.decryptStatus=""; - try { - var priv = $scope.getPrivFromAdd(); - if (priv.length==132) - $scope.wallet = Wallet.fromMyEtherWalletKey(priv, $scope.password); - else - $scope.wallet = Wallet.getWalletFromPrivKeyFile(priv, $scope.password); - walletService.password = $scope.password; - walletService.wallet = $scope.wallet; - } catch (e) { - $scope.decryptStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[6] + ":" + e)); - } - if($scope.wallet!=null) $scope.decryptStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[1])); - }; -}; +'use strict'; +var cxDecryptWalletCtrl = function($scope, $sce, walletService) { + $scope.allWallets = []; + $scope.selectedWallet = $scope.password = ""; + $scope.setAllWallets = function() { + cxFuncs.getWalletsArr(function(wlts) { + $scope.allWallets = wlts; + $scope.updateBalance(); + $scope.$apply(); + }); + }; + $scope.updateBalance = function() { + for (var i = 0; i < $scope.allWallets.length; i++) { + $scope.setBalance($scope.allWallets[i].addr,i); + } + }; + $scope.setBalance = function(address,id) { + ajaxReq.getBalance(address, function(data) { + if (data.error) { + $scope.allWallets[id].balance = data.msg; + } else { + $scope.allWallets[id].balance = etherUnits.toEther(data.data.balance, 'wei'); + } + }); + }; + $scope.setAllWallets(); + $scope.getPrivFromAdd = function(){ + if ($scope.selectedWallet=="") throw globalFuncs.errorMsgs[5]; + for (var i = 0; i < $scope.allWallets.length; i++) { + if( $scope.allWallets[i].addr==$scope.selectedWallet) + return $scope.allWallets[i].priv; + } + throw globalFuncs.errorMsgs[14]; + } + $scope.decryptWallet = function() { + $scope.wallet=null; + $scope.decryptStatus=""; + try { + var priv = $scope.getPrivFromAdd(); + if (priv.length==132) + $scope.wallet = Wallet.fromMyEtherWalletKey(priv, $scope.password); + else + $scope.wallet = Wallet.getWalletFromPrivKeyFile(priv, $scope.password); + walletService.password = $scope.password; + walletService.wallet = $scope.wallet; + } catch (e) { + $scope.decryptStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[6] + ":" + e)); + } + if($scope.wallet!=null) $scope.decryptStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[1])); + }; +}; module.exports = cxDecryptWalletCtrl; },{}],4:[function(require,module,exports){ -'use strict'; -var mainPopCtrl = function($scope, $sce) { - $scope.allWallets = []; - $scope.allWatchOnly = []; - $scope.setAllWallets = function() { - cxFuncs.getWalletsArr(function(wlts) { - $scope.allWallets = wlts; - $scope.updateBalance('allWallets'); - }); - cxFuncs.getWatchOnlyArr(function(wlts) { - $scope.allWatchOnly = wlts; - $scope.updateBalance('allWatchOnly'); - $scope.$apply(); - }); - }; - $scope.updateBalance = function(varWal) { - for (var i = 0; i < $scope[varWal].length; i++) { - $scope.setBalance($scope[varWal][i].addr, i, varWal); - } - }; - $scope.setBalance = function(address, id, varWal) { - ajaxReq.getBalance(address, function(data) { - if (data.error) { - $scope[varWal][id].balance = data.msg; - } else { - $scope[varWal][id].balance = etherUnits.toEther(data.data.balance, 'wei'); - $scope[varWal][id].balanceR = new BigNumber($scope[varWal][id].balance).toPrecision(5); - } - }); - }; - $scope.setAllWallets(); -}; -module.exports = mainPopCtrl; +'use strict'; +var mainPopCtrl = function($scope, $sce) { + $scope.allWallets = []; + $scope.allWatchOnly = []; + $scope.setAllWallets = function() { + cxFuncs.getWalletsArr(function(wlts) { + $scope.allWallets = wlts; + $scope.updateBalance('allWallets'); + }); + cxFuncs.getWatchOnlyArr(function(wlts) { + $scope.allWatchOnly = wlts; + $scope.updateBalance('allWatchOnly'); + $scope.$apply(); + }); + }; + $scope.updateBalance = function(varWal) { + for (var i = 0; i < $scope[varWal].length; i++) { + $scope.setBalance($scope[varWal][i].addr, i, varWal); + } + }; + $scope.setBalance = function(address, id, varWal) { + ajaxReq.getBalance(address, function(data) { + if (data.error) { + $scope[varWal][id].balance = data.msg; + } else { + $scope[varWal][id].balance = etherUnits.toEther(data.data.balance, 'wei'); + $scope[varWal][id].balanceR = new BigNumber($scope[varWal][id].balance).toPrecision(5); + } + }); + }; + $scope.setAllWallets(); +}; +module.exports = mainPopCtrl; },{}],5:[function(require,module,exports){ -'use strict'; -var myWalletsCtrl = function($scope, $sce) { - $scope.editModal = new Modal(document.getElementById('editWallet')); - $scope.viewModal = new Modal(document.getElementById('viewWalletDetails')); - $scope.removeModal = new Modal(document.getElementById('removeWallet')); - $scope.allWallets = []; - $scope.allWatchOnly = []; - $scope.nickNames = []; - $scope.fiatVal = { - usd: 0, - eur: 0, - btc: 0 - }; - $scope.viewWallet = {}; - $scope.setNickNames = function() { - cxFuncs.getAllNickNames(function(nicks) { - $scope.nickNames = nicks; - }); - }; - $scope.setAllWallets = function() { - cxFuncs.getWalletsArr(function(wlts) { - $scope.allWallets = wlts; - $scope.updateBalance('allWallets'); - }); - cxFuncs.getWatchOnlyArr(function(wlts) { - $scope.allWatchOnly = wlts; - $scope.updateBalance('allWatchOnly'); - $scope.$apply(); - }); - }; - $scope.updateBalance = function(varWal) { - for (var i = 0; i < $scope[varWal].length; i++) { - $scope.setBalance($scope[varWal][i].addr, i, varWal); - } - }; - $scope.setBalance = function(address, id, varWal) { - ajaxReq.getBalance(address, function(data) { - if (data.error) { - $scope[varWal][id].balance = data.msg; - } else { - $scope[varWal][id].balance = etherUnits.toEther(data.data.balance, 'wei'); - $scope[varWal][id].balanceR = new BigNumber($scope[varWal][id].balance).toPrecision(5); - $scope[varWal][id].usd = etherUnits.toFiat($scope[varWal][id].balance, 'ether', $scope.fiatVal.usd); - $scope[varWal][id].eur = etherUnits.toFiat($scope[varWal][id].balance, 'ether', $scope.fiatVal.eur); - $scope[varWal][id].btc = etherUnits.toFiat($scope[varWal][id].balance, 'ether', $scope.fiatVal.btc); - } - }); - }; - $scope.setViewWalletObj = function(val, type) { - var vtype = 'allWallets'; - if (type == 'watchOnly') vtype = 'allWatchOnly' - $scope.viewWallet = { - nick: $scope[vtype][val].nick, - addr: $scope[vtype][val].addr, - id: val, - type: type - } - } - $scope.editMWallet = function(val, type) { - $scope.setViewWalletObj(val, type); - $scope.editModal.open(); - } - $scope.editSave = function() { - if ($scope.nickNames.indexOf($scope.viewWallet.nick) !== -1) { - $scope.editStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[13])); - return; - } else { - cxFuncs.editNickName($scope.viewWallet.addr, $scope.viewWallet.nick, function() { - if (chrome.runtime.lastError) $scope.editStatus = $sce.trustAsHtml(globalFuncs.getDangerText(chrome.runtime.lastError.message)); - else { - $scope.setAllWallets(); - $scope.setNickNames(); - $scope.editModal.close(); - } - }); - } - } - $scope.viewMWallet = function(val, type) { - $scope.setViewWalletObj(val, type); - $scope.viewModal.open(); - } - $scope.decryptWallet = function() { - $scope.wallet = null; - $scope.viewStatus = ""; - try { - var priv = $scope.allWallets[$scope.viewWallet.id].priv; - if (priv.length==132) - $scope.wallet = Wallet.fromMyEtherWalletKey(priv, $scope.password); - else - $scope.wallet = Wallet.getWalletFromPrivKeyFile(priv, $scope.password); - $scope.viewModal.close(); - $scope.setWalletInfo(); - $scope.password = ""; - } catch (e) { - $scope.viewStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[6] + ":" + e)); - } - }; - $scope.printQRCode = function() { - globalFuncs.printPaperWallets(JSON.stringify([{ - address: $scope.wallet.getAddressString(), - private: $scope.wallet.getPrivateKeyString() - }])); - } - $scope.resetWallet = function() { - $scope.wallet = null; - $scope.blob = $scope.blobEnc = $scope.password = ""; - } - $scope.setWalletInfo = function() { - $scope.blob = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toJSON()); - if ($scope.password != '') { - $scope.blobEnc = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toV3($scope.password, { - kdf: globalFuncs.kdf, - n: globalFuncs.scrypt.n - })); - $scope.encFileName = $scope.wallet.getV3Filename(); - } - ajaxReq.getBalance($scope.wallet.getAddressString(), function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.etherBalance = etherUnits.toEther(data.data.balance, 'wei'); - ajaxReq.getETHvalue(function(data) { - $scope.usdBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.usd); - $scope.eurBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.eur); - $scope.btcBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.btc); - }); - } - }); - } - $scope.deleteWalletMsg = function(val, type) { - $scope.setViewWalletObj(val, type); - $scope.removeModal.open(); - } - $scope.deleteWallet = function() { - cxFuncs.deleteAccount($scope.viewWallet.addr, function() { - $scope.setAllWallets(); - $scope.setNickNames(); - $scope.removeModal.close(); - }); - } - ajaxReq.getETHvalue(function(data) { - $scope.fiatVal.usd = data.usd; - $scope.fiatVal.eur = data.eur; - $scope.fiatVal.btc = data.btc; - $scope.setAllWallets(); - }); - $scope.setNickNames(); -}; +'use strict'; +var myWalletsCtrl = function($scope, $sce) { + $scope.editModal = new Modal(document.getElementById('editWallet')); + $scope.viewModal = new Modal(document.getElementById('viewWalletDetails')); + $scope.removeModal = new Modal(document.getElementById('removeWallet')); + $scope.allWallets = []; + $scope.allWatchOnly = []; + $scope.nickNames = []; + $scope.fiatVal = { + usd: 0, + eur: 0, + btc: 0 + }; + $scope.viewWallet = {}; + $scope.setNickNames = function() { + cxFuncs.getAllNickNames(function(nicks) { + $scope.nickNames = nicks; + }); + }; + $scope.setAllWallets = function() { + cxFuncs.getWalletsArr(function(wlts) { + $scope.allWallets = wlts; + $scope.updateBalance('allWallets'); + }); + cxFuncs.getWatchOnlyArr(function(wlts) { + $scope.allWatchOnly = wlts; + $scope.updateBalance('allWatchOnly'); + $scope.$apply(); + }); + }; + $scope.updateBalance = function(varWal) { + for (var i = 0; i < $scope[varWal].length; i++) { + $scope.setBalance($scope[varWal][i].addr, i, varWal); + } + }; + $scope.setBalance = function(address, id, varWal) { + ajaxReq.getBalance(address, function(data) { + if (data.error) { + $scope[varWal][id].balance = data.msg; + } else { + $scope[varWal][id].balance = etherUnits.toEther(data.data.balance, 'wei'); + $scope[varWal][id].balanceR = new BigNumber($scope[varWal][id].balance).toPrecision(5); + $scope[varWal][id].usd = etherUnits.toFiat($scope[varWal][id].balance, 'ether', $scope.fiatVal.usd); + $scope[varWal][id].eur = etherUnits.toFiat($scope[varWal][id].balance, 'ether', $scope.fiatVal.eur); + $scope[varWal][id].btc = etherUnits.toFiat($scope[varWal][id].balance, 'ether', $scope.fiatVal.btc); + } + }); + }; + $scope.setViewWalletObj = function(val, type) { + var vtype = 'allWallets'; + if (type == 'watchOnly') vtype = 'allWatchOnly' + $scope.viewWallet = { + nick: $scope[vtype][val].nick, + addr: $scope[vtype][val].addr, + id: val, + type: type + } + } + $scope.editMWallet = function(val, type) { + $scope.setViewWalletObj(val, type); + $scope.editModal.open(); + } + $scope.editSave = function() { + if ($scope.nickNames.indexOf($scope.viewWallet.nick) !== -1) { + $scope.editStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[13])); + return; + } else { + cxFuncs.editNickName($scope.viewWallet.addr, $scope.viewWallet.nick, function() { + if (chrome.runtime.lastError) $scope.editStatus = $sce.trustAsHtml(globalFuncs.getDangerText(chrome.runtime.lastError.message)); + else { + $scope.setAllWallets(); + $scope.setNickNames(); + $scope.editModal.close(); + } + }); + } + } + $scope.viewMWallet = function(val, type) { + $scope.setViewWalletObj(val, type); + $scope.viewModal.open(); + } + $scope.decryptWallet = function() { + $scope.wallet = null; + $scope.viewStatus = ""; + try { + var priv = $scope.allWallets[$scope.viewWallet.id].priv; + if (priv.length==132) + $scope.wallet = Wallet.fromMyEtherWalletKey(priv, $scope.password); + else + $scope.wallet = Wallet.getWalletFromPrivKeyFile(priv, $scope.password); + $scope.viewModal.close(); + $scope.setWalletInfo(); + $scope.password = ""; + } catch (e) { + $scope.viewStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[6] + ":" + e)); + } + }; + $scope.printQRCode = function() { + globalFuncs.printPaperWallets(JSON.stringify([{ + address: $scope.wallet.getAddressString(), + private: $scope.wallet.getPrivateKeyString() + }])); + } + $scope.resetWallet = function() { + $scope.wallet = null; + $scope.blob = $scope.blobEnc = $scope.password = ""; + } + $scope.setWalletInfo = function() { + $scope.blob = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toJSON()); + if ($scope.password != '') { + $scope.blobEnc = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toV3($scope.password, { + kdf: globalFuncs.kdf, + n: globalFuncs.scrypt.n + })); + $scope.encFileName = $scope.wallet.getV3Filename(); + } + ajaxReq.getBalance($scope.wallet.getAddressString(), function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.etherBalance = etherUnits.toEther(data.data.balance, 'wei'); + ajaxReq.getETHvalue(function(data) { + $scope.usdBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.usd); + $scope.eurBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.eur); + $scope.btcBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.btc); + }); + } + }); + } + $scope.deleteWalletMsg = function(val, type) { + $scope.setViewWalletObj(val, type); + $scope.removeModal.open(); + } + $scope.deleteWallet = function() { + cxFuncs.deleteAccount($scope.viewWallet.addr, function() { + $scope.setAllWallets(); + $scope.setNickNames(); + $scope.removeModal.close(); + }); + } + ajaxReq.getETHvalue(function(data) { + $scope.fiatVal.usd = data.usd; + $scope.fiatVal.eur = data.eur; + $scope.fiatVal.btc = data.btc; + $scope.setAllWallets(); + }); + $scope.setNickNames(); +}; module.exports = myWalletsCtrl; },{}],6:[function(require,module,exports){ -'use strict'; -var quickSendCtrl = function($scope, $sce) { - $scope.allWallets = []; - $scope.selectedWallet = ""; - $scope.showConfirm = false; - $scope.tx = { - gasLimit: globalFuncs.defaultTxGasLimit, - data: "", - to: "", - unit: "ether", - value: "", - nonce: null, - gasPrice: null, - donate: false - } - $scope.setAllWallets = function() { - cxFuncs.getWalletsArr(function(wlts) { - $scope.allWallets = wlts; - $scope.updateBalance('allWallets'); - }); - }; - $scope.updateBalance = function(varWal) { - for (var i = 0; i < $scope[varWal].length; i++) { - $scope.setBalance($scope[varWal][i].addr, i, varWal); - } - }; - $scope.setBalance = function(address, id, varWal) { - ajaxReq.getBalance(address, function(data) { - if (data.error) { - $scope[varWal][id].balance = data.msg; - } else { - $scope[varWal][id].balance = etherUnits.toEther(data.data.balance, 'wei'); - $scope[varWal][id].balanceR = new BigNumber($scope[varWal][id].balance).toPrecision(5); - } - }); - }; - $scope.validateAddress = function() { - if (ethFuncs.validateEtherAddress($scope.tx.to)) { - $scope.validateAddressStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[0])); - } else { - $scope.validateAddressStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[5])); - } - } - $scope.transferAllBalance = function() { - $scope.wallet = {}; - $scope.wallet.getAddressString = function() { - return $scope.allWallets[$scope.selectedWallet].addr; - } - uiFuncs.transferAllBalance($scope, $sce); - } - $scope.prepTX = function() { - try { - if (!ethFuncs.validateEtherAddress($scope.tx.to)) throw globalFuncs.errorMsgs[5]; - else if (!globalFuncs.isNumeric($scope.tx.value) || parseFloat($scope.tx.value) < 0) throw globalFuncs.errorMsgs[7]; - $scope.showConfirm = true; - } catch (e) { - $scope.prepTXStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - } - $scope.unlockAndSend = function() { - try { - $scope.decryptWallet(); - $scope.autoSend = true; - uiFuncs.generateTx($scope, $sce); - $scope.validateTxStatus = ""; - } catch (e) { - $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - } - $scope.decryptWallet = function() { - $scope.wallet = null; - $scope.validateTxStatus = ""; - $scope.wallet = Wallet.getWalletFromPrivKeyFile($scope.allWallets[$scope.selectedWallet].priv, $scope.password); - }; - $scope.setAllWallets(); -}; +'use strict'; +var quickSendCtrl = function($scope, $sce) { + $scope.allWallets = []; + $scope.selectedWallet = ""; + $scope.showConfirm = false; + $scope.tx = { + gasLimit: globalFuncs.defaultTxGasLimit, + data: "", + to: "", + unit: "ether", + value: "", + nonce: null, + gasPrice: null, + donate: false + } + $scope.setAllWallets = function() { + cxFuncs.getWalletsArr(function(wlts) { + $scope.allWallets = wlts; + $scope.updateBalance('allWallets'); + }); + }; + $scope.updateBalance = function(varWal) { + for (var i = 0; i < $scope[varWal].length; i++) { + $scope.setBalance($scope[varWal][i].addr, i, varWal); + } + }; + $scope.setBalance = function(address, id, varWal) { + ajaxReq.getBalance(address, function(data) { + if (data.error) { + $scope[varWal][id].balance = data.msg; + } else { + $scope[varWal][id].balance = etherUnits.toEther(data.data.balance, 'wei'); + $scope[varWal][id].balanceR = new BigNumber($scope[varWal][id].balance).toPrecision(5); + } + }); + }; + $scope.validateAddress = function() { + if (ethFuncs.validateEtherAddress($scope.tx.to)) { + $scope.validateAddressStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[0])); + } else { + $scope.validateAddressStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[5])); + } + } + $scope.transferAllBalance = function() { + $scope.wallet = {}; + $scope.wallet.getAddressString = function() { + return $scope.allWallets[$scope.selectedWallet].addr; + } + uiFuncs.transferAllBalance($scope, $sce); + } + $scope.prepTX = function() { + try { + if (!ethFuncs.validateEtherAddress($scope.tx.to)) throw globalFuncs.errorMsgs[5]; + else if (!globalFuncs.isNumeric($scope.tx.value) || parseFloat($scope.tx.value) < 0) throw globalFuncs.errorMsgs[7]; + $scope.showConfirm = true; + } catch (e) { + $scope.prepTXStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + } + $scope.unlockAndSend = function() { + try { + $scope.decryptWallet(); + $scope.autoSend = true; + uiFuncs.generateTx($scope, $sce); + $scope.validateTxStatus = ""; + } catch (e) { + $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + } + $scope.decryptWallet = function() { + $scope.wallet = null; + $scope.validateTxStatus = ""; + $scope.wallet = Wallet.getWalletFromPrivKeyFile($scope.allWallets[$scope.selectedWallet].priv, $scope.password); + }; + $scope.setAllWallets(); +}; module.exports = quickSendCtrl; },{}],7:[function(require,module,exports){ -'use strict'; -var bulkGenCtrl = function($scope) { - $scope.showWallets = false; - $scope.genWallets = function(){ - if($scope.amount==''||$scope.amount != parseInt($scope.amount, 10)) alert(globalFuncs.errorMsgs[0]); - else { - $scope.wallets = []; - var csv = ''; var txt = ''; - $scope.jsonWallets = []; - for(var i=0;i<$scope.amount;i++){ - var tWallet = Wallet.generate(false); - csv += tWallet.getChecksumAddressString() + ',' + tWallet.getPrivateKeyString() + '\n'; - txt += tWallet.getChecksumAddressString() + '\t' + tWallet.getPrivateKeyString() + '\n'; - $scope.jsonWallets.push({ - address: tWallet.getChecksumAddressString(), - private: tWallet.getPrivateKeyString() - }); - $scope.wallets.push(tWallet); - } - $scope.showWallets = true; - $scope.bJSON = globalFuncs.getBlob("text/json;charset=UTF-8",JSON.stringify($scope.jsonWallets)); - $scope.bTXT = globalFuncs.getBlob("text/plain;charset=UTF-8",txt); - $scope.bCSV = globalFuncs.getBlob("text/csv;charset=UTF-8",csv); - } - } - $scope.printQRCode = function() { - globalFuncs.printPaperWallets(JSON.stringify($scope.jsonWallets)); - } -}; +'use strict'; +var bulkGenCtrl = function($scope) { + $scope.showWallets = false; + $scope.genWallets = function(){ + if($scope.amount==''||$scope.amount != parseInt($scope.amount, 10)) alert(globalFuncs.errorMsgs[0]); + else { + $scope.wallets = []; + var csv = ''; var txt = ''; + $scope.jsonWallets = []; + for(var i=0;i<$scope.amount;i++){ + var tWallet = Wallet.generate(false); + csv += tWallet.getChecksumAddressString() + ',' + tWallet.getPrivateKeyString() + '\n'; + txt += tWallet.getChecksumAddressString() + '\t' + tWallet.getPrivateKeyString() + '\n'; + $scope.jsonWallets.push({ + address: tWallet.getChecksumAddressString(), + private: tWallet.getPrivateKeyString() + }); + $scope.wallets.push(tWallet); + } + $scope.showWallets = true; + $scope.bJSON = globalFuncs.getBlob("text/json;charset=UTF-8",JSON.stringify($scope.jsonWallets)); + $scope.bTXT = globalFuncs.getBlob("text/plain;charset=UTF-8",txt); + $scope.bCSV = globalFuncs.getBlob("text/csv;charset=UTF-8",csv); + } + } + $scope.printQRCode = function() { + globalFuncs.printPaperWallets(JSON.stringify($scope.jsonWallets)); + } +}; module.exports = bulkGenCtrl; },{}],8:[function(require,module,exports){ -'use strict'; -var decryptWalletCtrl = function($scope, $sce, walletService) { - $scope.walletType = ""; - $scope.requireFPass = $scope.requirePPass = $scope.showFDecrypt = $scope.showPDecrypt = false; - $scope.filePassword = ""; - $scope.fileContent = ""; - $scope.showContent = function($fileContent) { - $scope.fileStatus = $sce.trustAsHtml(globalFuncs.getSuccessText("File Selected: " + document.getElementById('fselector').files[0].name)); - try { - $scope.requireFPass = Wallet.walletRequirePass($fileContent); - $scope.showFDecrypt = !$scope.requireFPass; - $scope.fileContent = $fileContent; - } catch (e) { - $scope.fileStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - }; - $scope.openFileDialog = function($fileContent) { - document.getElementById('fselector').click(); - }; - $scope.onFilePassChange = function() { - $scope.showFDecrypt = $scope.filePassword.length > 3; - }; - $scope.onPrivKeyChange = function() { - $scope.requirePPass = $scope.manualprivkey.length == 128 || $scope.manualprivkey.length == 132; - $scope.showPDecrypt = $scope.manualprivkey.length == 64; - }; - $scope.onPrivKeyPassChange = function() { - $scope.showPDecrypt = $scope.privPassword.length > 6; - }; - $scope.decryptWallet = function() { - $scope.wallet=null; - $scope.decryptStatus=""; - try { - if ($scope.showPDecrypt && $scope.requirePPass) { - $scope.wallet = Wallet.fromMyEtherWalletKey($scope.manualprivkey, $scope.privPassword); - walletService.password = $scope.privPassword; - } else if ($scope.showPDecrypt && !$scope.requirePPass) { - $scope.wallet = new Wallet($scope.manualprivkey); - walletService.password = ''; - } else if ($scope.showFDecrypt) { - $scope.wallet = Wallet.getWalletFromPrivKeyFile($scope.fileContent, $scope.filePassword); - walletService.password = $scope.filePassword; - } - walletService.wallet = $scope.wallet; - } catch (e) { - $scope.decryptStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[6]+e)); - } - if($scope.wallet!=null) $scope.decryptStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[1])); - }; -}; +'use strict'; +var decryptWalletCtrl = function($scope, $sce, walletService) { + $scope.walletType = ""; + $scope.requireFPass = $scope.requirePPass = $scope.showFDecrypt = $scope.showPDecrypt = false; + $scope.filePassword = ""; + $scope.fileContent = ""; + $scope.showContent = function($fileContent) { + $scope.fileStatus = $sce.trustAsHtml(globalFuncs.getSuccessText("File Selected: " + document.getElementById('fselector').files[0].name)); + try { + $scope.requireFPass = Wallet.walletRequirePass($fileContent); + $scope.showFDecrypt = !$scope.requireFPass; + $scope.fileContent = $fileContent; + } catch (e) { + $scope.fileStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + }; + $scope.openFileDialog = function($fileContent) { + document.getElementById('fselector').click(); + }; + $scope.onFilePassChange = function() { + $scope.showFDecrypt = $scope.filePassword.length > 3; + }; + $scope.onPrivKeyChange = function() { + $scope.requirePPass = $scope.manualprivkey.length == 128 || $scope.manualprivkey.length == 132; + $scope.showPDecrypt = $scope.manualprivkey.length == 64; + }; + $scope.onPrivKeyPassChange = function() { + $scope.showPDecrypt = $scope.privPassword.length > 6; + }; + $scope.decryptWallet = function() { + $scope.wallet=null; + $scope.decryptStatus=""; + try { + if ($scope.showPDecrypt && $scope.requirePPass) { + $scope.wallet = Wallet.fromMyEtherWalletKey($scope.manualprivkey, $scope.privPassword); + walletService.password = $scope.privPassword; + } else if ($scope.showPDecrypt && !$scope.requirePPass) { + $scope.wallet = new Wallet($scope.manualprivkey); + walletService.password = ''; + } else if ($scope.showFDecrypt) { + $scope.wallet = Wallet.getWalletFromPrivKeyFile($scope.fileContent, $scope.filePassword); + walletService.password = $scope.filePassword; + } + walletService.wallet = $scope.wallet; + } catch (e) { + $scope.decryptStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[6]+e)); + } + if($scope.wallet!=null) $scope.decryptStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[1])); + }; +}; module.exports = decryptWalletCtrl; },{}],9:[function(require,module,exports){ -'use strict'; -var digixCtrl = function($scope, $sce, walletService) { - new Modal(document.getElementById('sendTransaction')); - walletService.wallet = null; - walletService.password = ''; - $scope.showSend = true; - $scope.showRaw = false; - $scope.digixContract = "0xf0160428a8552ac9bb7e050d90eeade4ddd52843"; - $scope.tokenContract = "0xe0b7927c4af23765cb51314a0e0521a9645f0e2a"; - $scope.badgeContract = "0x54bda709fed875224eae569bb6817d96ef7ed9ad"; - $scope.digixUserInfo = "0x1959a002"; - $scope.digixClaim = "0x4e71d92d"; - $scope.digixTransfer = "0xa9059cbb"; - $scope.balanceOf = "0x70a08231"; - $scope.tx = { - gasLimit: globalFuncs.digixClaimTxGasLimit, - data: $scope.digixClaim, - to: $scope.digixContract, - unit: "ether", - value: 0, - nonce: null, - gasPrice: null, - donate: false - } - $scope.tokenTx = { - to: '', - value: 0, - unit: "dgd" - } - $scope.$watch(function() { - if (walletService.wallet == null) return null; - return walletService.wallet.getAddressString(); - }, function() { - if (walletService.wallet == null) return; - $scope.wallet = walletService.wallet; - $scope.setBalance(); - }); - $scope.validateAddress = function(address, status) { - if (ethFuncs.validateEtherAddress(address)) { - $scope[status] = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[0])); - } else { - $scope[status] = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[5])); - } - } - $scope.setBalance = function() { - var tUserInfo = { - to: $scope.digixContract, - data: $scope.digixUserInfo - }; - ajaxReq.getBalance($scope.wallet.getAddressString(), function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.etherBalance = etherUnits.toEther(data.data.balance, 'wei'); - ajaxReq.getETHvalue(function(data) { - $scope.usdBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.usd); - $scope.eurBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.eur); - $scope.btcBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.btc); - }); - } - }); - var userInfo = ethFuncs.getDataObj($scope.digixContract, $scope.digixUserInfo, [ethFuncs.getNakedAddress($scope.wallet.getAddressString())]); - ajaxReq.getEthCall(userInfo, function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - var digixObj = $scope.processDigixInfo(data.data); - $scope.centsTotal = digixObj.centstotal; - $scope.weiTotal = digixObj.weitotal; - $scope.shareTotal = digixObj.share; - $scope.badgesTotal = digixObj.badges; - $scope.claimedTotal = digixObj.claimed.toString(); - } - }); - var tokenBalance = ethFuncs.getDataObj($scope.tokenContract, $scope.balanceOf, [ethFuncs.getNakedAddress($scope.wallet.getAddressString())]); - ajaxReq.getEthCall(tokenBalance, function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.tokenBalance = new BigNumber(data.data).div(1000000000).toString(); - } - }); - var badgeBalance = ethFuncs.getDataObj($scope.badgeContract, $scope.balanceOf, [ethFuncs.getNakedAddress($scope.wallet.getAddressString())]); - ajaxReq.getEthCall(badgeBalance, function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.badgeBalance = new BigNumber(data.data).toString(); - } - }); - } - $scope.processDigixInfo = function(data) { - data = data.replace('0x', ''); - var values = data.match(/.{1,64}/g); - var digixObj = { - centstotal: new BigNumber('0x' + values[0]).div(100).toString(), - weitotal: new BigNumber('0x' + values[1]).div(etherUnits.getValueOfUnit('ether')).toString(), - share: new BigNumber('0x' + values[2]).div(etherUnits.getValueOfUnit('gwei')).toString(), - badges: new BigNumber('0x' + values[3]).toString(), - claimed: new BigNumber('0x' + values[4]).toString() == '1' - }; - return digixObj; - } - $scope.$watch('tx', function() { - $scope.showRaw = false; - $scope.sendTxStatus = ""; - }, true); - $scope.$watch('showSend', function() { - $scope.showRaw = false; - $scope.sendTxStatus = ""; - if (!$scope.showSend) { - $scope.tx.data = $scope.digixClaim; - $scope.tx.to = $scope.digixContract; - $scope.tx.gasLimit = globalFuncs.digixClaimTxGasLimit; - } - }); - $scope.generateTokenTx = function() { - try { - if (!ethFuncs.validateEtherAddress($scope.tokenTx.to)) throw globalFuncs.errorMsgs[5]; - else if (!globalFuncs.isNumeric($scope.tokenTx.value) || parseFloat($scope.tokenTx.value) < 0) throw globalFuncs.errorMsgs[7]; - else if ($scope.tokenTx.unit == "dgd" && new BigNumber($scope.tokenTx.value).greaterThan(new BigNumber($scope.tokenBalance))) throw globalFuncs.errorMsgs[7]; - else if ($scope.tokenTx.unit == "dgdb" && new BigNumber($scope.tokenTx.value).greaterThan(new BigNumber($scope.badgeBalance))) throw globalFuncs.errorMsgs[7]; - var value = 0; - if ($scope.tokenTx.unit == "dgd") { - value = new BigNumber($scope.tokenTx.value).times(etherUnits.getValueOfUnit('gwei')).toString(16); - $scope.tx.to = $scope.tokenContract; - } else { - value = new BigNumber($scope.tokenTx.value).toString(16); - $scope.tx.to = $scope.badgeContract; - } - value = ethFuncs.padLeft(value, 64); - var toAdd = ethFuncs.padLeft(ethFuncs.getNakedAddress($scope.tokenTx.to), 64); - $scope.tx.data = $scope.digixTransfer + toAdd + value; - $scope.tx.value = 0; - $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText('')); - $scope.generateTx(); - } catch (e) { - $scope.showRaw = false; - $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - } - $scope.generateTx = function(){ - uiFuncs.generateTx($scope,$sce); - } - $scope.sendTx = function() { - uiFuncs.sendTx($scope,$sce); - } -}; -module.exports = digixCtrl; +'use strict'; +var digixCtrl = function($scope, $sce, walletService) { + new Modal(document.getElementById('sendTransaction')); + walletService.wallet = null; + walletService.password = ''; + $scope.showSend = true; + $scope.showRaw = false; + $scope.digixContract = "0xf0160428a8552ac9bb7e050d90eeade4ddd52843"; + $scope.tokenContract = "0xe0b7927c4af23765cb51314a0e0521a9645f0e2a"; + $scope.badgeContract = "0x54bda709fed875224eae569bb6817d96ef7ed9ad"; + $scope.digixUserInfo = "0x1959a002"; + $scope.digixClaim = "0x4e71d92d"; + $scope.digixTransfer = "0xa9059cbb"; + $scope.balanceOf = "0x70a08231"; + $scope.tx = { + gasLimit: globalFuncs.digixClaimTxGasLimit, + data: $scope.digixClaim, + to: $scope.digixContract, + unit: "ether", + value: 0, + nonce: null, + gasPrice: null, + donate: false + } + $scope.tokenTx = { + to: '', + value: 0, + unit: "dgd" + } + $scope.$watch(function() { + if (walletService.wallet == null) return null; + return walletService.wallet.getAddressString(); + }, function() { + if (walletService.wallet == null) return; + $scope.wallet = walletService.wallet; + $scope.setBalance(); + }); + $scope.validateAddress = function(address, status) { + if (ethFuncs.validateEtherAddress(address)) { + $scope[status] = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[0])); + } else { + $scope[status] = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[5])); + } + } + $scope.setBalance = function() { + var tUserInfo = { + to: $scope.digixContract, + data: $scope.digixUserInfo + }; + ajaxReq.getBalance($scope.wallet.getAddressString(), function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.etherBalance = etherUnits.toEther(data.data.balance, 'wei'); + ajaxReq.getETHvalue(function(data) { + $scope.usdBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.usd); + $scope.eurBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.eur); + $scope.btcBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.btc); + }); + } + }); + var userInfo = ethFuncs.getDataObj($scope.digixContract, $scope.digixUserInfo, [ethFuncs.getNakedAddress($scope.wallet.getAddressString())]); + ajaxReq.getEthCall(userInfo, function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + var digixObj = $scope.processDigixInfo(data.data); + $scope.centsTotal = digixObj.centstotal; + $scope.weiTotal = digixObj.weitotal; + $scope.shareTotal = digixObj.share; + $scope.badgesTotal = digixObj.badges; + $scope.claimedTotal = digixObj.claimed.toString(); + } + }); + var tokenBalance = ethFuncs.getDataObj($scope.tokenContract, $scope.balanceOf, [ethFuncs.getNakedAddress($scope.wallet.getAddressString())]); + ajaxReq.getEthCall(tokenBalance, function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.tokenBalance = new BigNumber(data.data).div(1000000000).toString(); + } + }); + var badgeBalance = ethFuncs.getDataObj($scope.badgeContract, $scope.balanceOf, [ethFuncs.getNakedAddress($scope.wallet.getAddressString())]); + ajaxReq.getEthCall(badgeBalance, function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.badgeBalance = new BigNumber(data.data).toString(); + } + }); + } + $scope.processDigixInfo = function(data) { + data = data.replace('0x', ''); + var values = data.match(/.{1,64}/g); + var digixObj = { + centstotal: new BigNumber('0x' + values[0]).div(100).toString(), + weitotal: new BigNumber('0x' + values[1]).div(etherUnits.getValueOfUnit('ether')).toString(), + share: new BigNumber('0x' + values[2]).div(etherUnits.getValueOfUnit('gwei')).toString(), + badges: new BigNumber('0x' + values[3]).toString(), + claimed: new BigNumber('0x' + values[4]).toString() == '1' + }; + return digixObj; + } + $scope.$watch('tx', function() { + $scope.showRaw = false; + $scope.sendTxStatus = ""; + }, true); + $scope.$watch('showSend', function() { + $scope.showRaw = false; + $scope.sendTxStatus = ""; + if (!$scope.showSend) { + $scope.tx.data = $scope.digixClaim; + $scope.tx.to = $scope.digixContract; + $scope.tx.gasLimit = globalFuncs.digixClaimTxGasLimit; + } + }); + $scope.generateTokenTx = function() { + try { + if (!ethFuncs.validateEtherAddress($scope.tokenTx.to)) throw globalFuncs.errorMsgs[5]; + else if (!globalFuncs.isNumeric($scope.tokenTx.value) || parseFloat($scope.tokenTx.value) < 0) throw globalFuncs.errorMsgs[7]; + else if ($scope.tokenTx.unit == "dgd" && new BigNumber($scope.tokenTx.value).greaterThan(new BigNumber($scope.tokenBalance))) throw globalFuncs.errorMsgs[7]; + else if ($scope.tokenTx.unit == "dgdb" && new BigNumber($scope.tokenTx.value).greaterThan(new BigNumber($scope.badgeBalance))) throw globalFuncs.errorMsgs[7]; + var value = 0; + if ($scope.tokenTx.unit == "dgd") { + value = new BigNumber($scope.tokenTx.value).times(etherUnits.getValueOfUnit('gwei')).toString(16); + $scope.tx.to = $scope.tokenContract; + } else { + value = new BigNumber($scope.tokenTx.value).toString(16); + $scope.tx.to = $scope.badgeContract; + } + value = ethFuncs.padLeft(value, 64); + var toAdd = ethFuncs.padLeft(ethFuncs.getNakedAddress($scope.tokenTx.to), 64); + $scope.tx.data = $scope.digixTransfer + toAdd + value; + $scope.tx.value = 0; + $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText('')); + $scope.generateTx(); + } catch (e) { + $scope.showRaw = false; + $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + } + $scope.generateTx = function(){ + uiFuncs.generateTx($scope,$sce); + } + $scope.sendTx = function() { + uiFuncs.sendTx($scope,$sce); + } +}; +module.exports = digixCtrl; },{}],10:[function(require,module,exports){ (function (Buffer){ -'use strict'; -var sendOfflineTxCtrl = function($scope, $sce, walletService) { - walletService.wallet = null; - walletService.password = ''; - $scope.showAdvance = false; - $scope.showRaw = false; - $scope.showWalletInfo = false; - $scope.gasPriceDec = 0; - $scope.nonceDec = 0; - $scope.tx = { - gasLimit: globalFuncs.defaultTxGasLimit, - from: "", - data: "", - to: "", - unit: "ether", - value: '', - nonce: null, - gasPrice: null, - donate: false - } - $scope.$watch(function() { - if (walletService.wallet == null) return null; - return walletService.wallet.getAddressString(); - }, function() { - if (walletService.wallet == null) return; - $scope.wallet = walletService.wallet; - }); - $scope.getWalletInfo = function() { - if (ethFuncs.validateEtherAddress($scope.tx.from)) { - ajaxReq.getTransactionData($scope.tx.from, function(data) { - if (data.error) throw data.msg; - data = data.data; - $scope.gasPriceDec = ethFuncs.hexToDecimal(ethFuncs.sanitizeHex(ethFuncs.addTinyMoreToGas(data.gasprice))); - $scope.nonceDec = ethFuncs.hexToDecimal(data.nonce); - $scope.showWalletInfo = true; - }); - } - } - $scope.$watch('tx', function() { - $scope.showRaw = false; - $scope.sendTxStatus = ""; - }, true); - $scope.validateAddress = function(address, status) { - if (ethFuncs.validateEtherAddress(address)) { - $scope[status] = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[0])); - } else { - $scope[status] = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[5])); - } - } - $scope.generateTx = function() { - try { - if (!ethFuncs.validateEtherAddress($scope.tx.to)) throw globalFuncs.errorMsgs[5]; - else if (!globalFuncs.isNumeric($scope.tx.value) || parseFloat($scope.tx.value) < 0) throw globalFuncs.errorMsgs[7]; - else if (!globalFuncs.isNumeric($scope.gasPriceDec) || parseFloat($scope.gasPriceDec) <= 0) throw globalFuncs.errorMsgs[10]; - else if (!globalFuncs.isNumeric($scope.nonceDec) || parseFloat($scope.nonceDec) < 0) throw globalFuncs.errorMsgs[11]; - else if (!globalFuncs.isNumeric($scope.tx.gasLimit) || parseFloat($scope.tx.gasLimit) <= 0) throw globalFuncs.errorMsgs[8]; - else if (!ethFuncs.validateHexString($scope.tx.data)) throw globalFuncs.errorMsgs[9]; - var rawTx = { - nonce: ethFuncs.sanitizeHex(ethFuncs.decimalToHex($scope.nonceDec)), - gasPrice: ethFuncs.sanitizeHex(ethFuncs.decimalToHex($scope.gasPriceDec)), - gasLimit: ethFuncs.sanitizeHex(ethFuncs.decimalToHex($scope.tx.gasLimit)), - to: ethFuncs.sanitizeHex($scope.tx.to), - value: ethFuncs.sanitizeHex(ethFuncs.decimalToHex(etherUnits.toWei($scope.tx.value, $scope.tx.unit))), - data: ethFuncs.sanitizeHex($scope.tx.data) - } - var eTx = new ethUtil.Tx(rawTx); - eTx.sign(new Buffer($scope.wallet.getPrivateKeyString(), 'hex')); - $scope.rawTx = JSON.stringify(rawTx); - $scope.signedTx = '0x' + eTx.serialize().toString('hex'); - $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText('')); - } catch (e) { - $scope.showRaw = false; - $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - } - $scope.confirmSendTx = function(){ - try { - if($scope.signedTx=="" || !ethFuncs.validateHexString($scope.signedTx)) throw globalFuncs.errorMsgs[12]; - var eTx = new ethUtil.Tx($scope.signedTx); - $scope.tx.to = '0x'+eTx.to.toString('hex'); - $scope.tx.value = etherUnits.toEther('0x'+eTx.value.toString('hex'),'wei'); - $scope.tx.unit = 'ether'; - new Modal(document.getElementById('sendTransactionOffline')).open(); - } catch (e){ - $scope.offlineTxPublishStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - } - $scope.sendTx = function() { - new Modal(document.getElementById('sendTransactionOffline')).close(); - ajaxReq.sendRawTx($scope.signedTx, function(data) { - if (data.error) { - $scope.offlineTxPublishStatus = $sce.trustAsHtml(globalFuncs.getDangerText(data.msg)); - } else { - $scope.offlineTxPublishStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[2] + " " + data.data)); - } - }); - } -}; +'use strict'; +var sendOfflineTxCtrl = function($scope, $sce, walletService) { + walletService.wallet = null; + walletService.password = ''; + $scope.showAdvance = false; + $scope.showRaw = false; + $scope.showWalletInfo = false; + $scope.gasPriceDec = 0; + $scope.nonceDec = 0; + $scope.tx = { + gasLimit: globalFuncs.defaultTxGasLimit, + from: "", + data: "", + to: "", + unit: "ether", + value: '', + nonce: null, + gasPrice: null, + donate: false + } + $scope.$watch(function() { + if (walletService.wallet == null) return null; + return walletService.wallet.getAddressString(); + }, function() { + if (walletService.wallet == null) return; + $scope.wallet = walletService.wallet; + }); + $scope.getWalletInfo = function() { + if (ethFuncs.validateEtherAddress($scope.tx.from)) { + ajaxReq.getTransactionData($scope.tx.from, function(data) { + if (data.error) throw data.msg; + data = data.data; + $scope.gasPriceDec = ethFuncs.hexToDecimal(ethFuncs.sanitizeHex(ethFuncs.addTinyMoreToGas(data.gasprice))); + $scope.nonceDec = ethFuncs.hexToDecimal(data.nonce); + $scope.showWalletInfo = true; + }); + } + } + $scope.$watch('tx', function() { + $scope.showRaw = false; + $scope.sendTxStatus = ""; + }, true); + $scope.validateAddress = function(address, status) { + if (ethFuncs.validateEtherAddress(address)) { + $scope[status] = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[0])); + } else { + $scope[status] = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[5])); + } + } + $scope.generateTx = function() { + try { + if (!ethFuncs.validateEtherAddress($scope.tx.to)) throw globalFuncs.errorMsgs[5]; + else if (!globalFuncs.isNumeric($scope.tx.value) || parseFloat($scope.tx.value) < 0) throw globalFuncs.errorMsgs[7]; + else if (!globalFuncs.isNumeric($scope.gasPriceDec) || parseFloat($scope.gasPriceDec) <= 0) throw globalFuncs.errorMsgs[10]; + else if (!globalFuncs.isNumeric($scope.nonceDec) || parseFloat($scope.nonceDec) < 0) throw globalFuncs.errorMsgs[11]; + else if (!globalFuncs.isNumeric($scope.tx.gasLimit) || parseFloat($scope.tx.gasLimit) <= 0) throw globalFuncs.errorMsgs[8]; + else if (!ethFuncs.validateHexString($scope.tx.data)) throw globalFuncs.errorMsgs[9]; + var rawTx = { + nonce: ethFuncs.sanitizeHex(ethFuncs.decimalToHex($scope.nonceDec)), + gasPrice: ethFuncs.sanitizeHex(ethFuncs.decimalToHex($scope.gasPriceDec)), + gasLimit: ethFuncs.sanitizeHex(ethFuncs.decimalToHex($scope.tx.gasLimit)), + to: ethFuncs.sanitizeHex($scope.tx.to), + value: ethFuncs.sanitizeHex(ethFuncs.decimalToHex(etherUnits.toWei($scope.tx.value, $scope.tx.unit))), + data: ethFuncs.sanitizeHex($scope.tx.data) + } + var eTx = new ethUtil.Tx(rawTx); + eTx.sign(new Buffer($scope.wallet.getPrivateKeyString(), 'hex')); + $scope.rawTx = JSON.stringify(rawTx); + $scope.signedTx = '0x' + eTx.serialize().toString('hex'); + $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText('')); + } catch (e) { + $scope.showRaw = false; + $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + } + $scope.confirmSendTx = function(){ + try { + if($scope.signedTx=="" || !ethFuncs.validateHexString($scope.signedTx)) throw globalFuncs.errorMsgs[12]; + var eTx = new ethUtil.Tx($scope.signedTx); + $scope.tx.to = '0x'+eTx.to.toString('hex'); + $scope.tx.value = etherUnits.toEther('0x'+eTx.value.toString('hex'),'wei'); + $scope.tx.unit = 'ether'; + new Modal(document.getElementById('sendTransactionOffline')).open(); + } catch (e){ + $scope.offlineTxPublishStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + } + $scope.sendTx = function() { + new Modal(document.getElementById('sendTransactionOffline')).close(); + ajaxReq.sendRawTx($scope.signedTx, function(data) { + if (data.error) { + $scope.offlineTxPublishStatus = $sce.trustAsHtml(globalFuncs.getDangerText(data.msg)); + } else { + $scope.offlineTxPublishStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[2] + " " + data.data)); + } + }); + } +}; module.exports = sendOfflineTxCtrl; }).call(this,require("buffer").Buffer) -},{"buffer":83}],11:[function(require,module,exports){ -'use strict'; -var sendTxCtrl = function($scope, $sce, walletService) { - new Modal(document.getElementById('sendTransaction')); - walletService.wallet = null; - walletService.password = ''; - $scope.showAdvance = false; - $scope.showRaw = false; - $scope.tx = { - gasLimit: globalFuncs.urlGet('gaslimit') == null ? globalFuncs.defaultTxGasLimit : globalFuncs.urlGet('gaslimit'), - data: globalFuncs.urlGet('data') == null ? "" : globalFuncs.urlGet('data'), - to: globalFuncs.urlGet('to') == null ? "" : globalFuncs.urlGet('to'), - unit: "ether", - value: globalFuncs.urlGet('value') == null ? "" : globalFuncs.urlGet('value'), - nonce: null, - gasPrice: null, - donate: false - } - $scope.$watch(function() { - if (walletService.wallet == null) return null; - return walletService.wallet.getAddressString(); - }, function() { - if (walletService.wallet == null) return; - $scope.wallet = walletService.wallet; - $scope.setBalance(); - }); - $scope.setBalance = function() { - ajaxReq.getBalance($scope.wallet.getAddressString(), function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.etherBalance = etherUnits.toEther(data.data.balance, 'wei'); - ajaxReq.getETHvalue(function(data) { - $scope.usdBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.usd); - $scope.eurBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.eur); - $scope.btcBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.btc); - }); - } - }); - } - $scope.$watch('tx', function() { - $scope.showRaw = false; - $scope.sendTxStatus = ""; - }, true); - $scope.validateAddress = function() { - if (ethFuncs.validateEtherAddress($scope.tx.to)) { - $scope.validateAddressStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[0])); - } else { - $scope.validateAddressStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[5])); - } - } - $scope.toggleShowAdvance = function() { - $scope.showAdvance = !$scope.showAdvance; - } - $scope.onDonateClick = function() { - $scope.tx.to = globalFuncs.donateAddress; - $scope.tx.donate = true; - $scope.validateAddress(); - } - $scope.generateTx = function(){ - uiFuncs.generateTx($scope,$sce); - } - $scope.sendTx = function() { - uiFuncs.sendTx($scope,$sce); - } - $scope.transferAllBalance = function() { - uiFuncs.transferAllBalance($scope,$sce); - } -}; +},{"buffer":84}],11:[function(require,module,exports){ +'use strict'; +var sendTxCtrl = function($scope, $sce, walletService) { + new Modal(document.getElementById('sendTransaction')); + walletService.wallet = null; + walletService.password = ''; + $scope.showAdvance = false; + $scope.showRaw = false; + $scope.tx = { + gasLimit: globalFuncs.urlGet('gaslimit') == null ? globalFuncs.defaultTxGasLimit : globalFuncs.urlGet('gaslimit'), + data: globalFuncs.urlGet('data') == null ? "" : globalFuncs.urlGet('data'), + to: globalFuncs.urlGet('to') == null ? "" : globalFuncs.urlGet('to'), + unit: "ether", + value: globalFuncs.urlGet('value') == null ? "" : globalFuncs.urlGet('value'), + nonce: null, + gasPrice: null, + donate: false + } + $scope.$watch(function() { + if (walletService.wallet == null) return null; + return walletService.wallet.getAddressString(); + }, function() { + if (walletService.wallet == null) return; + $scope.wallet = walletService.wallet; + $scope.setBalance(); + }); + $scope.setBalance = function() { + ajaxReq.getBalance($scope.wallet.getAddressString(), function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.etherBalance = etherUnits.toEther(data.data.balance, 'wei'); + ajaxReq.getETHvalue(function(data) { + $scope.usdBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.usd); + $scope.eurBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.eur); + $scope.btcBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.btc); + }); + } + }); + } + $scope.$watch('tx', function() { + $scope.showRaw = false; + $scope.sendTxStatus = ""; + }, true); + $scope.validateAddress = function() { + if (ethFuncs.validateEtherAddress($scope.tx.to)) { + $scope.validateAddressStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[0])); + } else { + $scope.validateAddressStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[5])); + } + } + $scope.toggleShowAdvance = function() { + $scope.showAdvance = !$scope.showAdvance; + } + $scope.onDonateClick = function() { + $scope.tx.to = globalFuncs.donateAddress; + $scope.tx.donate = true; + $scope.validateAddress(); + } + $scope.generateTx = function(){ + uiFuncs.generateTx($scope,$sce); + } + $scope.sendTx = function() { + uiFuncs.sendTx($scope,$sce); + } + $scope.transferAllBalance = function() { + uiFuncs.transferAllBalance($scope,$sce); + } +}; module.exports = sendTxCtrl; },{}],12:[function(require,module,exports){ -'use strict'; -var tabsCtrl = function($scope, globalService) { - $scope.tabNames = globalService.tabs; - var hval = window.location.hash; - if(hval!=""){ - hval = hval.replace("#",''); - for (var key in $scope.tabNames) { - if($scope.tabNames[key].url == hval){ - $scope.activeTab = globalService.currentTab = $scope.tabNames[key].id; - break; - } - $scope.activeTab = globalService.currentTab; - } - } else { - $scope.activeTab = globalService.currentTab; - } - $scope.tabClick = function(id) { - $scope.activeTab = globalService.currentTab = id; - for (var key in $scope.tabNames) { - if($scope.tabNames[key].id == id) - location.hash = $scope.tabNames[key].url; - } - } -}; -module.exports = tabsCtrl; +'use strict'; +var tabsCtrl = function($scope, globalService) { + $scope.tabNames = globalService.tabs; + var hval = window.location.hash; + if(hval!=""){ + hval = hval.replace("#",''); + for (var key in $scope.tabNames) { + if($scope.tabNames[key].url == hval){ + $scope.activeTab = globalService.currentTab = $scope.tabNames[key].id; + break; + } + $scope.activeTab = globalService.currentTab; + } + } else { + $scope.activeTab = globalService.currentTab; + } + $scope.tabClick = function(id) { + $scope.activeTab = globalService.currentTab = id; + for (var key in $scope.tabNames) { + if($scope.tabNames[key].id == id) + location.hash = $scope.tabNames[key].url; + } + } +}; +module.exports = tabsCtrl; },{}],13:[function(require,module,exports){ -'use strict'; -var theDaoCtrl = function($scope, $sce, walletService) { - $scope.curTab = "send"; - new Modal(document.getElementById('sendTransaction')); - $scope.voteModal = new Modal(document.getElementById('voteProposal')); - $scope.showVoteYes = $scope.showVoteNo = true; - walletService.wallet = null; - walletService.password = ''; - $scope.showAdvance = false; - $scope.showRaw = false; - $scope.slockitContract = "0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413"; //0xd838f9c9792bf8398e1f5fbfbd3b43c5a86445aa - $scope.slockitBalance = "0x70a08231"; - $scope.slockitSupply = "0x18160ddd"; - $scope.slockitTransfer = "0xa9059cbb"; - $scope.slockitProposal = "0x013cf08b"; - $scope.slockitminQuorumDivisor = "0x674ed066"; - $scope.slockitABalance = "0x39d1f908"; - $scope.slockitRToken = "0xcdef91d0"; - $scope.slockitVote = "0xc9d27afe"; - $scope.tx = { - gasLimit: 150000, - data: '', - to: $scope.slockitContract, - unit: "ether", - value: 0, - nonce: null, - gasPrice: null, - donate: false - } - $scope.token = { - balance: 0, - total: 0, - totRaised: 0 - } - $scope.tokenTx = { - to: '', - value: 0, - unit: "dao" - } - $scope.$watch(function() { - if (walletService.wallet == null) return null; - return walletService.wallet.getAddressString(); - }, function() { - if (walletService.wallet == null) return; - $scope.wallet = walletService.wallet; - $scope.setBalance(); - }); - $scope.setBalance = function() { - ajaxReq.getBalance($scope.wallet.getAddressString(), function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.etherBalance = etherUnits.toEther(data.data.balance, 'wei'); - ajaxReq.getETHvalue(function(data) { - $scope.usdBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.usd); - $scope.eurBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.eur); - $scope.btcBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.btc); - }); - } - }); - var userInfo = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitBalance, [ethFuncs.getNakedAddress($scope.wallet.getAddressString())]); - ajaxReq.getEthCall(userInfo, function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.token.balance = new BigNumber(data.data).div(etherUnits.getValueOfUnit('milli') * 10).toString(); - } - }); - var totSupply = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitSupply, []); - ajaxReq.getEthCall(totSupply, function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.token.total = new BigNumber(data.data).toString(); - } - }); - ajaxReq.getBalance($scope.slockitContract, function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.token.totRaised = etherUnits.toEther(data.data.balance, 'wei'); - } - }); - var minq = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitminQuorumDivisor, []); - ajaxReq.getEthCall(minq, function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.minQuorumDivisor = new BigNumber(data.data).toNumber(); - } - }); - var actB = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitABalance, []); - ajaxReq.getEthCall(actB, function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.actualBalance = new BigNumber(data.data).toNumber(); - } - }); - var rToken = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitRToken, [ethFuncs.getNakedAddress($scope.slockitContract)]); - ajaxReq.getEthCall(rToken, function(data) { - if (data.error) { - $scope.etherBalance = data.msg; - } else { - $scope.rewardToken = new BigNumber(data.data).toNumber(); - } - }); - } - - $scope.setProposal = function() { - try { - $scope.loadProposalStatus = ""; - if (!globalFuncs.isNumeric($scope.proposalId) || parseFloat($scope.proposalId) < 0) throw globalFuncs.errorMsgs[15]; - var callProposal = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitProposal, [new BigNumber($scope.proposalId).toString(16)]); - ajaxReq.getEthCall(callProposal, function(data) { - try { - if (data.error) { - $scope.loadProposalStatus = data.msg; - } else { - var proposal = ethFuncs.contractOutToArray(data.data); - $scope.objProposal = { - id: $scope.proposalId, - recipient: '0x' + proposal[0], - amount: etherUnits.toEther('0x' + proposal[1], 'wei'), - content: proposal[12] == "0" ? "" : proposal.slice(13).join(), - description: proposal[12] == "0" ? "Propsoal ID #" + $scope.proposalId : globalFuncs.hexToAscii(proposal.slice(13).join('')).replace(/
/g, '\n').replace(/\\n/g, '\n'), - votingDeadline: new Date(new BigNumber("0x" + proposal[3]).toNumber() * 1000), - today: new Date(), - open: proposal[4] == '1' ? true : false, - proposalPassed: proposal[5] == '1' ? true : false, - proposalHash: '0x' + proposal[6], - proposalDeposit: etherUnits.toEther('0x' + proposal[7], 'wei'), - split: proposal[8] == '1' ? true : false, - yea: etherUnits.toEther('0x' + proposal[9], 'wei'), - nay: etherUnits.toEther('0x' + proposal[10], 'wei'), - creator: "0x" + proposal[11], - enabled: true, - minQuroum: function() { - var totalInWei = etherUnits.toWei($scope.token.totRaised, "ether"); - return etherUnits.toEther(totalInWei / $scope.minQuorumDivisor + (etherUnits.toWei(this.amount, "ether") * totalInWei) / (3 * ($scope.actualBalance + $scope.rewardToken)), "wei"); - }, - data: proposal - }; - $scope.showProposal = true; - - var yeaBN = new BigNumber($scope.objProposal.yea); - var nayBN = new BigNumber($scope.objProposal.nay); - $scope.objProposal.totalVotes = yeaBN.plus(nayBN) - $scope.objProposal.yeaPer = yeaBN.plus(nayBN).toNumber() == '0' ? 0 : yeaBN.div($scope.objProposal.totalVotes).times(100).toNumber(); - $scope.objProposal.nayPer = yeaBN.plus(nayBN).toNumber() == '0' ? 0 : nayBN.div($scope.objProposal.totalVotes).times(100).toNumber(); - - $scope.objProposal.quorumCurrent = ($scope.objProposal.totalVotes * 100) / $scope.token.totRaised; - $scope.objProposal.quorumPer = ($scope.objProposal.minQuroum() * 100) / $scope.token.totRaised; - - $scope.objProposal.openEnglish = $scope.objProposal.open == true ? "Yes" : "No"; - $scope.objProposal.splitEnglish = $scope.objProposal.split == true ? "Yes" : "No"; - $scope.objProposal.proposalPassedEnglish = $scope.objProposal.proposalPassed == true ? "Yes" : "No"; - - if ($scope.objProposal.description.indexOf('\n') > 0) { - var firstLine = $scope.objProposal.description.substring(0, $scope.objProposal.description.indexOf('\n')); - $scope.objProposal.descriptionHTML = $sce.trustAsHtml(globalFuncs.stripTags(marked($scope.objProposal.description.substring(firstLine.length + 1) || ""))); - $scope.objProposal.description = firstLine; - } - } - } catch (e) { - $scope.loadProposalStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[15] + e)); - $scope.showProposal = false; - } - }); - } catch (e) { - $scope.loadProposalStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - } - $scope.$watch('curTab', function() { - $scope.tx.data = ''; - $scope.showRaw = $scope.showProposal = false; - }); - $scope.$watch('[tx,curTab]', function() { - $scope.showRaw = false; - $scope.sendTxStatus = ""; - }, true); - - // sending - $scope.generateTokenTx = function() { - try { - if (!ethFuncs.validateEtherAddress($scope.tokenTx.to)) throw globalFuncs.errorMsgs[5]; - else if (!globalFuncs.isNumeric($scope.tokenTx.value) || parseFloat($scope.tokenTx.value) < 0) throw globalFuncs.errorMsgs[7]; - $scope.tx.to = $scope.slockitContract; - var value = ethFuncs.padLeft(new BigNumber($scope.tokenTx.value).times(etherUnits.getValueOfUnit('milli') * 10).toString(16), 64); - var toAdd = ethFuncs.padLeft(ethFuncs.getNakedAddress($scope.tokenTx.to), 64); - $scope.tx.data = $scope.slockitTransfer + toAdd + value; - $scope.tx.value = 0; - $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText('')); - $scope.generateTx(); - } catch (e) { - $scope.showRaw = false; - $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - }; - - $scope.generateTx = function() { - uiFuncs.generateTx($scope, $sce); - } - $scope.sendTx = function() { - uiFuncs.sendTx($scope, $sce); - } - - // voting - $scope.generateVoteTx = function(isYes) { - if (isYes) $scope.showVoteNo = false; - else $scope.showVoteYes = false; - try { - $scope.tx.to = $scope.slockitContract; - var id = ethFuncs.padLeft(new BigNumber($scope.proposalId).toString(16), 64); - var vote = isYes ? ethFuncs.padLeft("1", 64) : ethFuncs.padLeft("0", 64); - $scope.tx.data = $scope.slockitVote + id + vote; - $scope.tx.value = 0; - $scope.generateTx2(); - } catch (e) { - $scope.showRaw = false; - $scope.voteTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - } - $scope.generateTx2 = function() { - uiFuncs.generateTx($scope, $sce, function() { - $scope.sendTx2(); - }); - } - $scope.sendTx2 = function() { - ajaxReq.sendRawTx($scope.signedTx, function(data) { - if (data.error) { - $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(data.msg + "
" + globalFuncs.errorMsgs[17])); - } else { - $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[4] + " " + globalFuncs.successMsgs[2] + " " + data.data)); - } - }); - } -}; -module.exports = theDaoCtrl; +'use strict'; +var theDaoCtrl = function($scope, $sce, walletService) { + $scope.curTab = "send"; + new Modal(document.getElementById('sendTransaction')); + $scope.voteModal = new Modal(document.getElementById('voteProposal')); + $scope.showVoteYes = $scope.showVoteNo = true; + walletService.wallet = null; + walletService.password = ''; + $scope.showAdvance = false; + $scope.showRaw = false; + $scope.slockitContract = "0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413"; //0xd838f9c9792bf8398e1f5fbfbd3b43c5a86445aa + $scope.slockitBalance = "0x70a08231"; + $scope.slockitSupply = "0x18160ddd"; + $scope.slockitTransfer = "0xa9059cbb"; + $scope.slockitProposal = "0x013cf08b"; + $scope.slockitminQuorumDivisor = "0x674ed066"; + $scope.slockitABalance = "0x39d1f908"; + $scope.slockitRToken = "0xcdef91d0"; + $scope.slockitVote = "0xc9d27afe"; + $scope.tx = { + gasLimit: 150000, + data: '', + to: $scope.slockitContract, + unit: "ether", + value: 0, + nonce: null, + gasPrice: null, + donate: false + } + $scope.token = { + balance: 0, + total: 0, + totRaised: 0 + } + $scope.tokenTx = { + to: '', + value: 0, + unit: "dao" + } + $scope.$watch(function() { + if (walletService.wallet == null) return null; + return walletService.wallet.getAddressString(); + }, function() { + if (walletService.wallet == null) return; + $scope.wallet = walletService.wallet; + $scope.setBalance(); + }); + $scope.setBalance = function() { + ajaxReq.getBalance($scope.wallet.getAddressString(), function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.etherBalance = etherUnits.toEther(data.data.balance, 'wei'); + ajaxReq.getETHvalue(function(data) { + $scope.usdBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.usd); + $scope.eurBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.eur); + $scope.btcBalance = etherUnits.toFiat($scope.etherBalance, 'ether', data.btc); + }); + } + }); + var userInfo = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitBalance, [ethFuncs.getNakedAddress($scope.wallet.getAddressString())]); + ajaxReq.getEthCall(userInfo, function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.token.balance = new BigNumber(data.data).div(etherUnits.getValueOfUnit('milli') * 10).toString(); + } + }); + var totSupply = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitSupply, []); + ajaxReq.getEthCall(totSupply, function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.token.total = new BigNumber(data.data).toString(); + } + }); + ajaxReq.getBalance($scope.slockitContract, function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.token.totRaised = etherUnits.toEther(data.data.balance, 'wei'); + } + }); + var minq = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitminQuorumDivisor, []); + ajaxReq.getEthCall(minq, function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.minQuorumDivisor = new BigNumber(data.data).toNumber(); + } + }); + var actB = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitABalance, []); + ajaxReq.getEthCall(actB, function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.actualBalance = new BigNumber(data.data).toNumber(); + } + }); + var rToken = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitRToken, [ethFuncs.getNakedAddress($scope.slockitContract)]); + ajaxReq.getEthCall(rToken, function(data) { + if (data.error) { + $scope.etherBalance = data.msg; + } else { + $scope.rewardToken = new BigNumber(data.data).toNumber(); + } + }); + } + + $scope.setProposal = function() { + try { + $scope.loadProposalStatus = ""; + if (!globalFuncs.isNumeric($scope.proposalId) || parseFloat($scope.proposalId) < 0) throw globalFuncs.errorMsgs[15]; + var callProposal = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitProposal, [new BigNumber($scope.proposalId).toString(16)]); + ajaxReq.getEthCall(callProposal, function(data) { + try { + if (data.error) { + $scope.loadProposalStatus = data.msg; + } else { + var proposal = ethFuncs.contractOutToArray(data.data); + $scope.objProposal = { + id: $scope.proposalId, + recipient: '0x' + proposal[0], + amount: etherUnits.toEther('0x' + proposal[1], 'wei'), + content: proposal[12] == "0" ? "" : proposal.slice(13).join(), + description: proposal[12] == "0" ? "Propsoal ID #" + $scope.proposalId : globalFuncs.stripTags(globalFuncs.hexToAscii(proposal.slice(13).join('')).replace(/
/g, '\n').replace(/\\n/g, '\n')), + votingDeadline: new Date(new BigNumber("0x" + proposal[3]).toNumber() * 1000), + today: new Date(), + open: proposal[4] == '1' ? true : false, + proposalPassed: proposal[5] == '1' ? true : false, + proposalHash: '0x' + proposal[6], + proposalDeposit: etherUnits.toEther('0x' + proposal[7], 'wei'), + split: proposal[8] == '1' ? true : false, + yea: etherUnits.toEther('0x' + proposal[9], 'wei'), + nay: etherUnits.toEther('0x' + proposal[10], 'wei'), + creator: "0x" + proposal[11], + enabled: true, + minQuroum: function() { + var totalInWei = etherUnits.toWei($scope.token.totRaised, "ether"); + return etherUnits.toEther(totalInWei / $scope.minQuorumDivisor + (etherUnits.toWei(this.amount, "ether") * totalInWei) / (3 * ($scope.actualBalance + $scope.rewardToken)), "wei"); + }, + data: proposal + }; + $scope.showProposal = true; + + var yeaBN = new BigNumber($scope.objProposal.yea); + var nayBN = new BigNumber($scope.objProposal.nay); + $scope.objProposal.totalVotes = yeaBN.plus(nayBN) + $scope.objProposal.yeaPer = yeaBN.plus(nayBN).toNumber() == '0' ? 0 : yeaBN.div($scope.objProposal.totalVotes).times(100).toNumber(); + $scope.objProposal.nayPer = yeaBN.plus(nayBN).toNumber() == '0' ? 0 : nayBN.div($scope.objProposal.totalVotes).times(100).toNumber(); + + $scope.objProposal.quorumCurrent = ($scope.objProposal.totalVotes * 100) / $scope.token.totRaised; + $scope.objProposal.quorumPer = ($scope.objProposal.minQuroum() * 100) / $scope.token.totRaised; + + $scope.objProposal.openEnglish = $scope.objProposal.open == true ? "Yes" : "No"; + $scope.objProposal.splitEnglish = $scope.objProposal.split == true ? "Yes" : "No"; + $scope.objProposal.proposalPassedEnglish = $scope.objProposal.proposalPassed == true ? "Yes" : "No"; + + if ($scope.objProposal.description.indexOf('\n') > 0) { + var firstLine = $scope.objProposal.description.substring(0, $scope.objProposal.description.indexOf('\n')); + $scope.objProposal.descriptionHTML = $sce.trustAsHtml(marked($scope.objProposal.description.substring(firstLine.length + 1) || "")); + $scope.objProposal.description = firstLine; + } + } + } catch (e) { + $scope.loadProposalStatus = $sce.trustAsHtml(globalFuncs.getDangerText(globalFuncs.errorMsgs[15] + e)); + $scope.showProposal = false; + } + }); + } catch (e) { + $scope.loadProposalStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + } + $scope.$watch('curTab', function() { + $scope.tx.data = ''; + $scope.showRaw = $scope.showProposal = false; + }); + $scope.$watch('[tx,curTab]', function() { + $scope.showRaw = false; + $scope.sendTxStatus = ""; + }, true); + + // sending + $scope.generateTokenTx = function() { + try { + if (!ethFuncs.validateEtherAddress($scope.tokenTx.to)) throw globalFuncs.errorMsgs[5]; + else if (!globalFuncs.isNumeric($scope.tokenTx.value) || parseFloat($scope.tokenTx.value) < 0) throw globalFuncs.errorMsgs[7]; + $scope.tx.to = $scope.slockitContract; + var value = ethFuncs.padLeft(new BigNumber($scope.tokenTx.value).times(etherUnits.getValueOfUnit('milli') * 10).toString(16), 64); + var toAdd = ethFuncs.padLeft(ethFuncs.getNakedAddress($scope.tokenTx.to), 64); + $scope.tx.data = $scope.slockitTransfer + toAdd + value; + $scope.tx.value = 0; + $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText('')); + $scope.generateTx(); + } catch (e) { + $scope.showRaw = false; + $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + }; + + $scope.generateTx = function() { + uiFuncs.generateTx($scope, $sce); + } + $scope.sendTx = function() { + uiFuncs.sendTx($scope, $sce); + } + + // voting + $scope.generateVoteTx = function(isYes) { + if (isYes) $scope.showVoteNo = false; + else $scope.showVoteYes = false; + try { + $scope.tx.to = $scope.slockitContract; + var id = ethFuncs.padLeft(new BigNumber($scope.proposalId).toString(16), 64); + var vote = isYes ? ethFuncs.padLeft("1", 64) : ethFuncs.padLeft("0", 64); + $scope.tx.data = $scope.slockitVote + id + vote; + $scope.tx.value = 0; + $scope.generateTx2(); + } catch (e) { + $scope.showRaw = false; + $scope.voteTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + } + $scope.generateTx2 = function() { + uiFuncs.generateTx($scope, $sce, function() { + $scope.sendTx2(); + }); + } + $scope.sendTx2 = function() { + ajaxReq.sendRawTx($scope.signedTx, function(data) { + if (data.error) { + $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(data.msg + "
" + globalFuncs.errorMsgs[17])); + } else { + $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[4] + " " + globalFuncs.successMsgs[2] + " " + data.data)); + } + }); + } +}; +module.exports = theDaoCtrl; },{}],14:[function(require,module,exports){ -'use strict'; -var theDaoProposalCtrl = function($scope, $sce, walletService) { - walletService.wallet = null; - walletService.password = ''; - $scope.voteModal = new Modal(document.getElementById('voteProposal')); - $scope.showVoteYes = $scope.showVoteNo = true; - $scope.AllProposals = []; - $scope.slockitContract = "0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413"; - $scope.slockitBalance = "0x70a08231"; - $scope.slockitSupply = "0x18160ddd"; - $scope.slockitTransfer = "0xa9059cbb"; - $scope.slockitProposal = "0x013cf08b"; - $scope.slockitminQuorumDivisor = "0x674ed066"; - $scope.slockitABalance = "0x39d1f908"; - $scope.slockitRToken = "0xcdef91d0"; - $scope.slockitVote = "0xc9d27afe"; - $scope.initValues = function() { - ajaxReq.getBalance($scope.slockitContract, function(data) { - if (!data.error) $scope.totRaised = etherUnits.toEther(data.data.balance, 'wei'); - var minq = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitminQuorumDivisor, []); - ajaxReq.getEthCall(minq, function(data) { - if (!data.error) $scope.minQuorumDivisor = new BigNumber(data.data).toNumber(); - var actB = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitABalance, []); - ajaxReq.getEthCall(actB, function(data) { - if (!data.error) $scope.actualBalance = new BigNumber(data.data).toNumber(); - var rToken = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitRToken, [ethFuncs.getNakedAddress($scope.slockitContract)]); - ajaxReq.getEthCall(rToken, function(data) { - if (!data.error) $scope.rewardToken = new BigNumber(data.data).toNumber(); - $scope.getAllProposals(); - }); - }); - }); - }); - } - $scope.tx = { - gasLimit: 150000, - data: '', - to: $scope.slockitContract, - unit: "ether", - value: 0, - nonce: null, - gasPrice: null, - donate: false - } - $scope.$watch(function() { - if (walletService.wallet == null) return null; - return walletService.wallet.getAddressString(); - }, function() { - if (walletService.wallet == null) return; - $scope.wallet = walletService.wallet; - }); - $scope.openVote = function(id) { - $scope.voteID = id; - $scope.showVoteYes = $scope.showVoteNo = true; - $scope.voteTxStatus = $scope.sendTxStatus = ""; - $scope.voteModal.open(); - } - $scope.getAllProposals = function() { - ajaxReq.getDAOProposals(function(proposals) { - for (var i = 0; i < proposals.length; i++) { - $scope.AllProposals.push($scope.getProposalObj(proposals[i])); - } - }); - } - - $scope.filters = { - }; - - if (globalFuncs.urlGet('id') == null) { - $scope.comparator = false; - } else { - $scope.filters.id = parseInt(globalFuncs.urlGet('id')); - $scope.comparator = true; - } - - if (globalFuncs.urlGet('open') == null) { - } else { - $scope.filters.open = globalFuncs.urlGet('open'); - $scope.comparator = false; - } - - if (globalFuncs.urlGet('split') == null) { - } else { - $scope.filters.split = globalFuncs.urlGet('split'); - $scope.comparator = false; - } - - if (globalFuncs.urlGet('description') == null) { - } else { - $scope.filters.description = globalFuncs.urlGet('description'); - $scope.comparator = false; - } - - if (globalFuncs.urlGet('id') == null && globalFuncs.urlGet('open') == null && globalFuncs.urlGet('split') == null && globalFuncs.urlGet('description') == null ) { - $scope.filters.split = 'false'; - $scope.filters.open = 'true'; - $scope.comparator = false; - } - - $scope.$watch('filters.id', function() { - if ($scope.filters.id == '') { - $scope.comparator = false; - $scope.filters.id = ''; - } - if ($scope.filters.id == null) { - $scope.comparator = false; - } - console.log("split: " + JSON.stringify($scope.filters)); - console.log("split: comparator: " + $scope.comparator); - }); - - $scope.$watch('filters.open', function() { - if ($scope.filters.open == null) {} else { - $scope.comparator = false; - $scope.filters.id = ''; - } - console.log("open: " + JSON.stringify($scope.filters)); - console.log("open: comparator: " + $scope.comparator); - }); - $scope.$watch('filters.split', function() { - if ($scope.filters.split == null) {} else { - $scope.comparator = false; - $scope.filters.id = ''; - } - console.log("split: " + JSON.stringify($scope.filters)); - console.log("split: comparator: " + $scope.comparator); - }); - - console.log("load: " + JSON.stringify($scope.filters)); - console.log("load: comparator: " + $scope.comparator); - - - - $scope.initValues(); - $scope.showProposal = function(id) { - if (!$scope.AllProposals[id].showprop) { - var callProposal = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitProposal, [new BigNumber(id).toString(16)]); - ajaxReq.getEthCall(callProposal, function(data) { - var iobj = { - proposalID: id, - data: data.data - }; - $scope.AllProposals[id] = $scope.getProposalObj(iobj); - $scope.AllProposals[id].showprop = true; - }); - } else { - $scope.AllProposals[id].showprop = false; - } - } - $scope.generateVoteTx = function(isYes) { - if (isYes) $scope.showVoteNo = false; - else $scope.showVoteYes = false; - try { - $scope.tx.to = $scope.slockitContract; - var id = ethFuncs.padLeft(new BigNumber($scope.voteID).toString(16), 64); - var vote = isYes ? ethFuncs.padLeft("1", 64) : ethFuncs.padLeft("0", 64); - $scope.tx.data = $scope.slockitVote + id + vote; - $scope.tx.value = 0; - $scope.generateTx(); - } catch (e) { - $scope.showRaw = false; - $scope.voteTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } - } - $scope.getProposalObj = function(tProposal) { - var proposal = ethFuncs.contractOutToArray(tProposal.data); - var objProposal = { - id: tProposal.proposalID, - recipient: '0x' + proposal[0], - amount: etherUnits.toEther('0x' + proposal[1], 'wei'), - content: proposal[12] == "0" ? "" : proposal.slice(13).join(), - description: proposal[12] == "0" ? "Propsoal ID #" + tProposal.proposalID : globalFuncs.hexToAscii(proposal.slice(13).join('')).replace(/
/g, '\n').replace(/\\n/g, '\n'), - votingDeadline: new Date(new BigNumber("0x" + proposal[3]).toNumber() * 1000), - today: new Date(), - open: proposal[4] == '1' ? true : false, - proposalPassed: proposal[5] == '1' ? true : false, - proposalHash: '0x' + proposal[6], - proposalDeposit: etherUnits.toEther('0x' + proposal[7], 'wei'), - split: proposal[8] == '1' ? true : false, - yea: etherUnits.toEther('0x' + proposal[9], 'wei'), - nay: etherUnits.toEther('0x' + proposal[10], 'wei'), - creator: "0x" + proposal[11], - show: true, - showprop: false, - minQuroum: function() { - var totalInWei = etherUnits.toWei($scope.totRaised, "ether"); - return etherUnits.toEther(totalInWei / $scope.minQuorumDivisor + (etherUnits.toWei(this.amount, "ether") * totalInWei) / (3 * ($scope.actualBalance + $scope.rewardToken)), "wei"); - }, - data: proposal - }; - var yeaBN = new BigNumber(objProposal.yea); - var nayBN = new BigNumber(objProposal.nay); - objProposal.totalVotes = yeaBN.plus(nayBN) - objProposal.yeaPer = yeaBN.plus(nayBN).toNumber() == '0' ? 0 : yeaBN.div(objProposal.totalVotes).times(100).toNumber(); - objProposal.nayPer = yeaBN.plus(nayBN).toNumber() == '0' ? 0 : nayBN.div(objProposal.totalVotes).times(100).toNumber(); - - objProposal.quorumCurrent = (objProposal.totalVotes * 100) / $scope.totRaised; - objProposal.quorumPer = (objProposal.minQuroum() * 100) / $scope.totRaised; - - objProposal.openEnglish = objProposal.open == true ? "Yes" : "No"; - objProposal.splitEnglish = objProposal.split == true ? "Yes" : "No"; - objProposal.proposalPassedEnglish = objProposal.proposalPassed == true ? "Yes" : "No"; - - if (objProposal.description.indexOf('\n') > 0) { - var firstLine = objProposal.description.substring(0, objProposal.description.indexOf('\n')); - objProposal.descriptionHTML = $sce.trustAsHtml(globalFuncs.stripTags(marked(objProposal.description.substring(firstLine.length + 1) || ""))); - objProposal.description = firstLine; - } - - return objProposal; - } - $scope.generateTx = function() { - uiFuncs.generateTx($scope, $sce, function(){ - $scope.sendTx(); - }); - } - $scope.sendTx = function() { - ajaxReq.sendRawTx($scope.signedTx, function(data) { - if (data.error) { - $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(data.msg + "
" + globalFuncs.errorMsgs[17] )); - } else { - $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[4] + " " +globalFuncs.successMsgs[2] + " " + data.data)); - } - }); - } - -}; - - -module.exports = theDaoProposalCtrl; +'use strict'; +var theDaoProposalCtrl = function($scope, $sce, walletService) { + walletService.wallet = null; + walletService.password = ''; + $scope.voteModal = new Modal(document.getElementById('voteProposal')); + $scope.showVoteYes = $scope.showVoteNo = true; + $scope.AllProposals = []; + $scope.slockitContract = "0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413"; + $scope.slockitBalance = "0x70a08231"; + $scope.slockitSupply = "0x18160ddd"; + $scope.slockitTransfer = "0xa9059cbb"; + $scope.slockitProposal = "0x013cf08b"; + $scope.slockitminQuorumDivisor = "0x674ed066"; + $scope.slockitABalance = "0x39d1f908"; + $scope.slockitRToken = "0xcdef91d0"; + $scope.slockitVote = "0xc9d27afe"; + $scope.initValues = function() { + ajaxReq.getBalance($scope.slockitContract, function(data) { + if (!data.error) $scope.totRaised = etherUnits.toEther(data.data.balance, 'wei'); + var minq = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitminQuorumDivisor, []); + ajaxReq.getEthCall(minq, function(data) { + if (!data.error) $scope.minQuorumDivisor = new BigNumber(data.data).toNumber(); + var actB = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitABalance, []); + ajaxReq.getEthCall(actB, function(data) { + if (!data.error) $scope.actualBalance = new BigNumber(data.data).toNumber(); + var rToken = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitRToken, [ethFuncs.getNakedAddress($scope.slockitContract)]); + ajaxReq.getEthCall(rToken, function(data) { + if (!data.error) $scope.rewardToken = new BigNumber(data.data).toNumber(); + $scope.getAllProposals(); + }); + }); + }); + }); + } + $scope.tx = { + gasLimit: 150000, + data: '', + to: $scope.slockitContract, + unit: "ether", + value: 0, + nonce: null, + gasPrice: null, + donate: false + } + $scope.$watch(function() { + if (walletService.wallet == null) return null; + return walletService.wallet.getAddressString(); + }, function() { + if (walletService.wallet == null) return; + $scope.wallet = walletService.wallet; + }); + $scope.openVote = function(id) { + $scope.voteID = id; + $scope.showVoteYes = $scope.showVoteNo = true; + $scope.voteTxStatus = $scope.sendTxStatus = ""; + $scope.voteModal.open(); + } + $scope.getAllProposals = function() { + ajaxReq.getDAOProposals(function(proposals) { + for (var i = 0; i < proposals.length; i++) { + $scope.AllProposals.push($scope.getProposalObj(proposals[i])); + } + }); + } + + $scope.filters = { + id: globalFuncs.urlGet('id') != null ? parseInt(globalFuncs.urlGet('id')) : '', + open: globalFuncs.urlGet('open') != null ? globalFuncs.urlGet('open') : '', + split: globalFuncs.urlGet('split') != null ? globalFuncs.urlGet('split') : '', + description: globalFuncs.urlGet('description') != null ? globalFuncs.urlGet('description') : '' + }; + $scope.comparator = globalFuncs.urlGet('id') != null; + if ($scope.filters.id == '' && $scope.filters.open == '' && $scope.filters.split == '' && $scope.filters.description == '' ) { + $scope.filters.split = 'false'; + $scope.filters.open = 'true'; + } + + $scope.$watch('filters', function(newValue, oldValue) { + if ((newValue.id!=oldValue.id)&&($scope.filters.id == '' || $scope.filters.id == null)) $scope.comparator = false; + if (newValue.open!=oldValue.open && $scope.filters.open == '') $scope.filters.id = ''; + if (newValue.split!=oldValue.split && $scope.filters.split != '') $scope.filters.id = ''; + }, true); + $scope.initValues(); + $scope.showProposal = function(id) { + if (!$scope.AllProposals[id].showprop) { + var callProposal = ethFuncs.getDataObj($scope.slockitContract, $scope.slockitProposal, [new BigNumber(id).toString(16)]); + ajaxReq.getEthCall(callProposal, function(data) { + var iobj = { + proposalID: id, + data: data.data + }; + $scope.AllProposals[id] = $scope.getProposalObj(iobj); + $scope.AllProposals[id].showprop = true; + }); + } else { + $scope.AllProposals[id].showprop = false; + } + } + $scope.generateVoteTx = function(isYes) { + if (isYes) $scope.showVoteNo = false; + else $scope.showVoteYes = false; + try { + $scope.tx.to = $scope.slockitContract; + var id = ethFuncs.padLeft(new BigNumber($scope.voteID).toString(16), 64); + var vote = isYes ? ethFuncs.padLeft("1", 64) : ethFuncs.padLeft("0", 64); + $scope.tx.data = $scope.slockitVote + id + vote; + $scope.tx.value = 0; + $scope.generateTx(); + } catch (e) { + $scope.showRaw = false; + $scope.voteTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } + } + $scope.getProposalObj = function(tProposal) { + var proposal = ethFuncs.contractOutToArray(tProposal.data); + var objProposal = { + id: tProposal.proposalID, + recipient: '0x' + proposal[0], + amount: etherUnits.toEther('0x' + proposal[1], 'wei'), + content: proposal[12] == "0" ? "" : proposal.slice(13).join(), + description: proposal[12] == "0" ? "Propsoal ID #" + tProposal.proposalID : globalFuncs.stripTags(globalFuncs.hexToAscii(proposal.slice(13).join('')).replace(/
/g, '\n').replace(/\\n/g, '\n')), + votingDeadline: new Date(new BigNumber("0x" + proposal[3]).toNumber() * 1000), + today: new Date(), + open: proposal[4] == '1' ? true : false, + proposalPassed: proposal[5] == '1' ? true : false, + proposalHash: '0x' + proposal[6], + proposalDeposit: etherUnits.toEther('0x' + proposal[7], 'wei'), + split: proposal[8] == '1' ? true : false, + yea: etherUnits.toEther('0x' + proposal[9], 'wei'), + nay: etherUnits.toEther('0x' + proposal[10], 'wei'), + creator: "0x" + proposal[11], + show: true, + showprop: false, + minQuroum: function() { + var totalInWei = etherUnits.toWei($scope.totRaised, "ether"); + return etherUnits.toEther(totalInWei / $scope.minQuorumDivisor + (etherUnits.toWei(this.amount, "ether") * totalInWei) / (3 * ($scope.actualBalance + $scope.rewardToken)), "wei"); + }, + data: proposal + }; + var yeaBN = new BigNumber(objProposal.yea); + var nayBN = new BigNumber(objProposal.nay); + objProposal.totalVotes = yeaBN.plus(nayBN) + objProposal.yeaPer = yeaBN.plus(nayBN).toNumber() == '0' ? 0 : yeaBN.div(objProposal.totalVotes).times(100).toNumber(); + objProposal.nayPer = yeaBN.plus(nayBN).toNumber() == '0' ? 0 : nayBN.div(objProposal.totalVotes).times(100).toNumber(); + + objProposal.quorumCurrent = (objProposal.totalVotes * 100) / $scope.totRaised; + objProposal.quorumPer = (objProposal.minQuroum() * 100) / $scope.totRaised; + + objProposal.openEnglish = objProposal.open == true ? "Yes" : "No"; + objProposal.splitEnglish = objProposal.split == true ? "Yes" : "No"; + objProposal.proposalPassedEnglish = objProposal.proposalPassed == true ? "Yes" : "No"; + + if (objProposal.description.indexOf('\n') > 0) { + var firstLine = objProposal.description.substring(0, objProposal.description.indexOf('\n')); + objProposal.descriptionHTML = $sce.trustAsHtml(marked(objProposal.description.substring(firstLine.length + 1) || "")); + objProposal.description = firstLine; + } + return objProposal; + } + $scope.generateTx = function() { + uiFuncs.generateTx($scope, $sce, function(){ + $scope.sendTx(); + }); + } + $scope.sendTx = function() { + ajaxReq.sendRawTx($scope.signedTx, function(data) { + if (data.error) { + $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(data.msg + "
" + globalFuncs.errorMsgs[17] )); + } else { + $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[4] + " " +globalFuncs.successMsgs[2] + " " + data.data)); + } + }); + } + +}; + + +module.exports = theDaoProposalCtrl; },{}],15:[function(require,module,exports){ -'use strict'; -var viewCtrl = function($scope, globalService) { - $scope.globalService = globalService; -}; +'use strict'; +var viewCtrl = function($scope, globalService) { + $scope.globalService = globalService; +}; module.exports = viewCtrl; },{}],16:[function(require,module,exports){ -'use strict'; -var viewWalletCtrl = function($scope, walletService) { - walletService.wallet = null; - walletService.password = ''; - $scope.$watch(function() { - if (walletService.wallet == null) return null; - return walletService.wallet.getAddressString(); - }, function() { - if (walletService.wallet == null) return; - $scope.wallet = walletService.wallet; - $scope.showEnc = walletService.password != ''; - $scope.blob = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toJSON()); - if (walletService.password != '') { - $scope.blobEnc = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toV3(walletService.password, { - kdf: globalFuncs.kdf, - n: globalFuncs.scrypt.n - })); - $scope.encFileName = $scope.wallet.getV3Filename(); - } - ajaxReq.getBalance($scope.wallet.getAddressString(), function(data){ - if(data.error){ - $scope.etherBalance = data.msg; - } else { - $scope.etherBalance = etherUnits.toEther(data.data.balance,'wei'); - ajaxReq.getETHvalue(function(data){ - $scope.usdBalance = etherUnits.toFiat($scope.etherBalance,'ether',data.usd); - $scope.eurBalance = etherUnits.toFiat($scope.etherBalance,'ether',data.eur); - $scope.btcBalance = etherUnits.toFiat($scope.etherBalance,'ether',data.btc); - }); - } - }); - }); - $scope.printQRCode = function() { - globalFuncs.printPaperWallets(JSON.stringify([{ - address: $scope.wallet.getAddressString(), - private: $scope.wallet.getPrivateKeyString() - }])); - } -}; +'use strict'; +var viewWalletCtrl = function($scope, walletService) { + walletService.wallet = null; + walletService.password = ''; + $scope.$watch(function() { + if (walletService.wallet == null) return null; + return walletService.wallet.getAddressString(); + }, function() { + if (walletService.wallet == null) return; + $scope.wallet = walletService.wallet; + $scope.showEnc = walletService.password != ''; + $scope.blob = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toJSON()); + if (walletService.password != '') { + $scope.blobEnc = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toV3(walletService.password, { + kdf: globalFuncs.kdf, + n: globalFuncs.scrypt.n + })); + $scope.encFileName = $scope.wallet.getV3Filename(); + } + ajaxReq.getBalance($scope.wallet.getAddressString(), function(data){ + if(data.error){ + $scope.etherBalance = data.msg; + } else { + $scope.etherBalance = etherUnits.toEther(data.data.balance,'wei'); + ajaxReq.getETHvalue(function(data){ + $scope.usdBalance = etherUnits.toFiat($scope.etherBalance,'ether',data.usd); + $scope.eurBalance = etherUnits.toFiat($scope.etherBalance,'ether',data.eur); + $scope.btcBalance = etherUnits.toFiat($scope.etherBalance,'ether',data.btc); + }); + } + }); + }); + $scope.printQRCode = function() { + globalFuncs.printPaperWallets(JSON.stringify([{ + address: $scope.wallet.getAddressString(), + private: $scope.wallet.getPrivateKeyString() + }])); + } +}; module.exports = viewWalletCtrl; },{}],17:[function(require,module,exports){ -'use strict'; -var walletGenCtrl = function($scope) { - $scope.password = ""; - $scope.wallet = null; - $scope.showWallet = false; - $scope.blob = $scope.blobEnc = ""; - $scope.isDone = true; - $scope.showPass = true; - $scope.genNewWallet = function() { - if (!$scope.isStrongPass()) { - alert(globalFuncs.errorMsgs[1]); - } else if($scope.isDone){ - $scope.isDone = false; - $scope.wallet = Wallet.generate(false); - $scope.showWallet = true; - $scope.blob = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toJSON()); - $scope.blobEnc = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toV3($scope.password, { - kdf: globalFuncs.kdf, - n: globalFuncs.scrypt.n - })); - $scope.encFileName = $scope.wallet.getV3Filename(); - if(parent!=null) - parent.postMessage(JSON.stringify({address:$scope.wallet.getAddressString(), checksumAddress: $scope.wallet.getChecksumAddressString()}),"*"); - $scope.isDone = true; - } - } - $scope.printQRCode = function() { - globalFuncs.printPaperWallets(JSON.stringify([{ - address: $scope.wallet.getAddressString(), - private: $scope.wallet.getPrivateKeyString() - }])); - } - $scope.isStrongPass = function(){ - return globalFuncs.isStrongPass($scope.password); - } -}; +'use strict'; +var walletGenCtrl = function($scope) { + $scope.password = ""; + $scope.wallet = null; + $scope.showWallet = false; + $scope.blob = $scope.blobEnc = ""; + $scope.isDone = true; + $scope.showPass = true; + $scope.genNewWallet = function() { + if (!$scope.isStrongPass()) { + alert(globalFuncs.errorMsgs[1]); + } else if($scope.isDone){ + $scope.isDone = false; + $scope.wallet = Wallet.generate(false); + $scope.showWallet = true; + $scope.blob = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toJSON()); + $scope.blobEnc = globalFuncs.getBlob("text/json;charset=UTF-8", $scope.wallet.toV3($scope.password, { + kdf: globalFuncs.kdf, + n: globalFuncs.scrypt.n + })); + $scope.encFileName = $scope.wallet.getV3Filename(); + if(parent!=null) + parent.postMessage(JSON.stringify({address:$scope.wallet.getAddressString(), checksumAddress: $scope.wallet.getChecksumAddressString()}),"*"); + $scope.isDone = true; + } + } + $scope.printQRCode = function() { + globalFuncs.printPaperWallets(JSON.stringify([{ + address: $scope.wallet.getAddressString(), + private: $scope.wallet.getPrivateKeyString() + }])); + } + $scope.isStrongPass = function(){ + return globalFuncs.isStrongPass($scope.password); + } +}; module.exports = walletGenCtrl; },{}],18:[function(require,module,exports){ -'use strict'; -var cxFuncs = function() {} -cxFuncs.storage = chrome.storage.sync; -cxFuncs.getAllNickNames = function(callback) { - var nickNames = []; - this.storage.get(null, function(items) { - for (var key in items) { - if (items.hasOwnProperty(key)) { - var tobj = JSON.parse(items[key]); - if (tobj.type == 'wallet' || tobj.type == 'watchOnly') { - nickNames.push(tobj.nick); - nickNames.push(key); - } - } - } - callback(nickNames); - }); -} -cxFuncs.addWalletToStorage = function(address, encStr, nickname, callback) { - nickname = nickname.replace(/(<([^>]+)>)/ig, ""); - var value = { - nick: nickname, - priv: encStr, - type: 'wallet' - }; - var keyname = ethUtil.toChecksumAddress(address); - var obj = {}; - obj[keyname] = JSON.stringify(value); - this.storage.set(obj, callback); -} -cxFuncs.addWatchOnlyAddress = function(address, nickname, callback) { - nickname = nickname.replace(/(<([^>]+)>)/ig, ""); - var value = { - nick: nickname, - type: 'watchOnly' - }; - var keyname = ethUtil.toChecksumAddress(address);; - var obj = {}; - obj[keyname] = JSON.stringify(value); - this.storage.set(obj, callback); -} -cxFuncs.getStorageArr = function(filter, callback) { - var wallets = []; - this.storage.get(null, function(items) { - for (var key in items) { - if (items.hasOwnProperty(key)) { - var tobj = JSON.parse(items[key]); - if (tobj.type == filter) { - tobj['addr'] = key; - wallets.push(tobj); - } - } - } - wallets.sort(function(a, b) { - if (a.nick < b.nick) return -1; - if (a.nick > b.nick) return 1; - return 0; - }); - callback(wallets); - }); -} -cxFuncs.getWalletsArr = function(callback) { - this.getStorageArr('wallet', callback); -} -cxFuncs.getWatchOnlyArr = function(callback) { - this.getStorageArr('watchOnly', callback); -} -cxFuncs.deleteAccount = function(address,callback){ - this.storage.remove(address,function(){ - callback(address); - }); -} -cxFuncs.editNickName = function(address,newNick, callback){ - newNick = newNick.replace(/(<([^>]+)>)/ig,""); - this.storage.get(address, function(account) { - var accountInfo = account[address]; - accountInfo = JSON.parse(accountInfo); - accountInfo['nick'] = newNick; - account[address] = JSON.stringify(accountInfo); - cxFuncs.storage.set(account,function(){ - callback(newNick); - }); - }); -} +'use strict'; +var cxFuncs = function() {} +cxFuncs.storage = chrome.storage.sync; +cxFuncs.getAllNickNames = function(callback) { + var nickNames = []; + this.storage.get(null, function(items) { + for (var key in items) { + if (items.hasOwnProperty(key)) { + var tobj = JSON.parse(items[key]); + if (tobj.type == 'wallet' || tobj.type == 'watchOnly') { + nickNames.push(tobj.nick); + nickNames.push(key); + } + } + } + callback(nickNames); + }); +} +cxFuncs.addWalletToStorage = function(address, encStr, nickname, callback) { + nickname = nickname.replace(/(<([^>]+)>)/ig, ""); + var value = { + nick: nickname, + priv: encStr, + type: 'wallet' + }; + var keyname = ethUtil.toChecksumAddress(address); + var obj = {}; + obj[keyname] = JSON.stringify(value); + this.storage.set(obj, callback); +} +cxFuncs.addWatchOnlyAddress = function(address, nickname, callback) { + nickname = nickname.replace(/(<([^>]+)>)/ig, ""); + var value = { + nick: nickname, + type: 'watchOnly' + }; + var keyname = ethUtil.toChecksumAddress(address);; + var obj = {}; + obj[keyname] = JSON.stringify(value); + this.storage.set(obj, callback); +} +cxFuncs.getStorageArr = function(filter, callback) { + var wallets = []; + this.storage.get(null, function(items) { + for (var key in items) { + if (items.hasOwnProperty(key)) { + var tobj = JSON.parse(items[key]); + if (tobj.type == filter) { + tobj['addr'] = key; + wallets.push(tobj); + } + } + } + wallets.sort(function(a, b) { + if (a.nick < b.nick) return -1; + if (a.nick > b.nick) return 1; + return 0; + }); + callback(wallets); + }); +} +cxFuncs.getWalletsArr = function(callback) { + this.getStorageArr('wallet', callback); +} +cxFuncs.getWatchOnlyArr = function(callback) { + this.getStorageArr('watchOnly', callback); +} +cxFuncs.deleteAccount = function(address,callback){ + this.storage.remove(address,function(){ + callback(address); + }); +} +cxFuncs.editNickName = function(address,newNick, callback){ + newNick = newNick.replace(/(<([^>]+)>)/ig,""); + this.storage.get(address, function(account) { + var accountInfo = account[address]; + accountInfo = JSON.parse(accountInfo); + accountInfo['nick'] = newNick; + account[address] = JSON.stringify(accountInfo); + cxFuncs.storage.set(account,function(){ + callback(newNick); + }); + }); +} module.exports = cxFuncs; },{}],19:[function(require,module,exports){ -'use strict'; -var QRCodeDrtv = function() { - return function(scope, element, attrs) { - var watchVar = attrs.watchVar; - scope.$watch(watchVar, function() { - var value = attrs.qrCode; - element.empty(); - var delay = 0; - if (element[0].clientWidth == 0) delay = 200; - setTimeout(function() { - new QRCode(element[0], { - text: value, - width: element[0].clientWidth, - height: element[0].clientWidth, - colorDark: "#000000", - colorLight: "#ffffff", - correctLevel: QRCode.CorrectLevel.H - }); - }, delay); - }); - }; -}; +'use strict'; +var QRCodeDrtv = function() { + return function(scope, element, attrs) { + var watchVar = attrs.watchVar; + scope.$watch(watchVar, function() { + var value = attrs.qrCode; + element.empty(); + var delay = 0; + if (element[0].clientWidth == 0) delay = 200; + setTimeout(function() { + new QRCode(element[0], { + text: value, + width: element[0].clientWidth, + height: element[0].clientWidth, + colorDark: "#000000", + colorLight: "#ffffff", + correctLevel: QRCode.CorrectLevel.H + }); + }, delay); + }); + }; +}; module.exports = QRCodeDrtv; },{}],20:[function(require,module,exports){ -'use strict'; -var blockiesDrtv = function() { - return function(scope, element, attrs){ - var watchVar = attrs.watchVar; - scope.$watch(watchVar, function() { - var address = attrs.blockieAddress; - var content = ethFuncs.validateEtherAddress(address) ? globalFuncs.getBlockie(address):''; - element.css({ - 'background-image': 'url(' + content +')' - }); - }); - }; -}; +'use strict'; +var blockiesDrtv = function() { + return function(scope, element, attrs){ + var watchVar = attrs.watchVar; + scope.$watch(watchVar, function() { + var address = attrs.blockieAddress; + var content = ethFuncs.validateEtherAddress(address) ? globalFuncs.getBlockie(address):''; + element.css({ + 'background-image': 'url(' + content +')' + }); + }); + }; +}; module.exports = blockiesDrtv; },{}],21:[function(require,module,exports){ -'use strict'; -var cxWalletDecryptDrtv = function() { - return { - restrict : "E", - template : '
\n \ -
\n \ -

Select a Wallet:

\n \ -
\n \ - \n \ -
\n \ -
\n \ -
\n \ -

Enter the Password:

\n \ - \n \ -
\n \ -
\n \ -

Access Your Wallet:

\n \ - \n \ -
\n \ -
\n \ -
' - }; -}; -module.exports = cxWalletDecryptDrtv; +'use strict'; +var cxWalletDecryptDrtv = function() { + return { + restrict : "E", + template : '
\n \ +
\n \ +

Select a Wallet:

\n \ +
\n \ + \n \ +
\n \ +
\n \ +
\n \ +

Enter the Password:

\n \ + \n \ +
\n \ +
\n \ +

Access Your Wallet:

\n \ + \n \ +
\n \ +
\n \ +
' + }; +}; +module.exports = cxWalletDecryptDrtv; },{}],22:[function(require,module,exports){ -'use strict'; -var fileReaderDrtv = function($parse) { - return { - restrict: 'A', - scope: false, - link: function(scope, element, attrs) { - var fn = $parse(attrs.onReadFile); - element.on('change', function(onChangeEvent) { - var reader = new FileReader(); - reader.onload = function(onLoadEvent) { - scope.$apply(function() { - fn(scope, { - $fileContent: onLoadEvent.target.result - }); - }); - }; - reader.readAsText((onChangeEvent.srcElement || onChangeEvent.target).files[0]); - }); - } - }; -}; +'use strict'; +var fileReaderDrtv = function($parse) { + return { + restrict: 'A', + scope: false, + link: function(scope, element, attrs) { + var fn = $parse(attrs.onReadFile); + element.on('change', function(onChangeEvent) { + var reader = new FileReader(); + reader.onload = function(onLoadEvent) { + scope.$apply(function() { + fn(scope, { + $fileContent: onLoadEvent.target.result + }); + }); + }; + reader.readAsText((onChangeEvent.srcElement || onChangeEvent.target).files[0]); + }); + } + }; +}; module.exports = fileReaderDrtv; },{}],23:[function(require,module,exports){ -'use strict'; -var walletDecryptDrtv = function() { - return { - restrict : "E", - template : '
\n \ -
\n \ -

Select the format of your private key:

\n \ -
\n \ - \n \ -
\n \ -
\n \ - \n \ -
\n \ -
\n \ -
\n \ - \n \ -
\n \ -

Select your wallet file:

\n \ -
\n \ - \n \ - SELECT WALLET FILE... \n \ -
\n \ -
\n \ -
\n \ -

Your file is encrypted. Please enter the password:

\n \ - \n \ -
\n \ -
\n \ - \n \ - \n \ -
\n \ -

Paste / type your private key:

\n \ -
\n \ - \n \ -
\n \ -
\n \ -

Your file is encrypted. Please enter the password:

\n \ - \n \ -
\n \ -
\n \ - \n \ -
\n \ -
\n \ -

Access Your Wallet:

\n \ -

Access Your Wallet:

\n \ - \n \ -
\n \ -
\n \ -
' - }; -}; -module.exports = walletDecryptDrtv; +'use strict'; +var walletDecryptDrtv = function() { + return { + restrict : "E", + template : '
\n \ +
\n \ +

Select the format of your private key:

\n \ +
\n \ + \n \ +
\n \ +
\n \ + \n \ +
\n \ +
\n \ +
\n \ + \n \ +
\n \ +

Select your wallet file:

\n \ +
\n \ + \n \ + SELECT WALLET FILE... \n \ +
\n \ +
\n \ +
\n \ +

Your file is encrypted. Please enter the password:

\n \ + \n \ +
\n \ +
\n \ + \n \ + \n \ +
\n \ +

Paste / type your private key:

\n \ +
\n \ + \n \ +
\n \ +
\n \ +

Your file is encrypted. Please enter the password:

\n \ + \n \ +
\n \ +
\n \ + \n \ +
\n \ +
\n \ +

Access Your Wallet:

\n \ +

Access Your Wallet:

\n \ + \n \ +
\n \ +
\n \ +
' + }; +}; +module.exports = walletDecryptDrtv; },{}],24:[function(require,module,exports){ -'use strict'; -var ethFuncs = function() {} -ethFuncs.validateEtherAddress = function(address) { - if (address.substring(0, 2) != "0x") return false; - else if (!/^(0x)?[0-9a-f]{40}$/i.test(address)) return false; - else if (/^(0x)?[0-9a-f]{40}$/.test(address) || /^(0x)?[0-9A-F]{40}$/.test(address)) return true; - else - return this.isChecksumAddress(address); -} -ethFuncs.isChecksumAddress = function(address) { - return address == ethUtil.toChecksumAddress(address); -} -ethFuncs.validateHexString = function(str) { - if (str == "") return true; - str = str.substring(0, 2) == '0x' ? str.substring(2) : str; - var re = /[0-9A-Fa-f]+$/g; - return re.test(str); -} -ethFuncs.sanitizeHex = function(hex) { - hex = hex.substring(0, 2) == '0x' ? hex.substring(2) : hex; - if (hex == "") return ""; - return '0x' + this.padLeftEven(hex); -} -ethFuncs.padLeftEven = function(hex) { - hex = hex.length % 2 != 0 ? '0' + hex : hex; - return hex; -} -ethFuncs.addTinyMoreToGas = function(hex) { - hex = this.sanitizeHex(hex); - return new BigNumber(hex).plus(etherUnits.getValueOfUnit('gwei')).toDigits(2).toString(16); -} -ethFuncs.decimalToHex = function(dec) { - return new BigNumber(dec).toString(16); -} -ethFuncs.hexToDecimal = function(hex) { - return new BigNumber(this.sanitizeHex(hex)).toString(); -} -ethFuncs.contractOutToArray = function(hex) { - hex = hex.replace('0x', '').match(/.{64}/g); - for(var i=0;i= width ? n : new Array(width - n.length + 1).join(z) + n; -} -ethFuncs.getDataObj = function(to, func, arrVals) { - var val=""; - for(var i=0;i= width ? n : new Array(width - n.length + 1).join(z) + n; +} +ethFuncs.getDataObj = function(to, func, arrVals) { + var val=""; + for(var i=0;i"); -} -globalFuncs.getBlob = function(mime, str) { - var str = (typeof str === 'object') ? JSON.stringify(str) : str; - if (str == null) return ''; - var blob = new Blob([str], { - type: mime - }); - return window.URL.createObjectURL(blob); -} -globalFuncs.getSuccessText = function(str) { - return '

' + str + '

' -} -globalFuncs.getDangerText = function(str) { - return '

' + str + '

' -} -globalFuncs.errorMsgs = [ - "Please enter valid amount. ", - "Your password must be at least 9 characters. Please ensure it is a strong password. ", - "Sorry! We don't have a clue what type of wallet file this is. ", - "This is not a valid wallet file. ", - "This unit doesn\'t exists, please use the one of the following units ", - "Invalid address. ", - "Invalid password. ", - "Invalid amount. ", - "Invalid gas limit. ", - "Invalid data value. ", - "Invalid gas amount. ", - "Invalid nonce. ", - "Invalid signed transaction. ", - "A wallet with this nickname already exists. ", - "Wallet not found. ", - "Whoops. It doesnt look like a proposal with this ID exists yet or there is an error reading this proposal. ", - "A wallet with this address already exists in storage. Please check your wallets page. ", - "You need to have at some ETH in your account to cover the cost of gas. .05ETH should be more than sufficient for a few sends and votes. "]; -globalFuncs.successMsgs = ["Valid address", "Wallet successfully decrypted", "Transaction submitted. TX ID: ", "New wallet added: ", "You have successfully voted. Thank you for being an active participant in The DAO."]; -globalFuncs.scrypt = { - n: 1024 -}; -globalFuncs.postDelay = 300; -globalFuncs.kdf = "scrypt"; -globalFuncs.defaultTxGasLimit = 21000; -globalFuncs.digixClaimTxGasLimit = 150000; -globalFuncs.donateAddress = "0x7cB57B5A97eAbe94205C07890BE4c1aD31E486A8"; -globalFuncs.isNumeric = function(n) { - return !isNaN(parseFloat(n)) && isFinite(n); -} -globalFuncs.urlGet = function(name) { - if (name = (new RegExp('[?&]' + encodeURIComponent(name) + '=([^&]*)')).exec(location.search)) return this.stripTags(decodeURIComponent(name[1])); -} -globalFuncs.stripTags = function(str) { - var SCRIPT_REGEX = /)<[^<]*)*<\/script>/gi; - while (SCRIPT_REGEX.test(str)) { - str = str.replace(SCRIPT_REGEX, ""); - } - return str; -} -globalFuncs.checkAndRedirectHTTPS = function() { - var host = "myetherwallet.com"; - var githost = "kvhnuke.github.io"; - var githostw = "www.kvhnuke.github.io"; - var hostw = "www.myetherwallet.com"; - if ((host == window.location.host || githost == window.location.host || hostw == window.location.host || githostw == window.location.host) && (window.location.protocol != "https:")) window.location.protocol = "https"; -} -globalFuncs.isStrongPass = function(password) { - if (password.length > 8) { - return true; - } else { - return false; - } - //var re = /(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}/; - //return re.test(password); -} -globalFuncs.hexToAscii = function(hex) { - return hex.match(/.{1,2}/g).map(function(v) { - return String.fromCharCode(parseInt(v, 16)); - }).join(''); -} -module.exports = globalFuncs; +'use strict'; +var globalFuncs = function() {} +globalFuncs.getBlockie = function(address) { + return blockies.create({ + seed: address.toLowerCase(), + size: 8, + scale: 16 + }).toDataURL(); +} +globalFuncs.printPaperWallets = function(strJson) { + var win = window.open("about:blank", "_blank"); + var data = ""); +} +globalFuncs.getBlob = function(mime, str) { + var str = (typeof str === 'object') ? JSON.stringify(str) : str; + if (str == null) return ''; + var blob = new Blob([str], { + type: mime + }); + return window.URL.createObjectURL(blob); +} +globalFuncs.getSuccessText = function(str) { + return '

' + str + '

' +} +globalFuncs.getDangerText = function(str) { + return '

' + str + '

' +} +globalFuncs.errorMsgs = [ + "Please enter valid amount. ", + "Your password must be at least 9 characters. Please ensure it is a strong password. ", + "Sorry! We don't have a clue what type of wallet file this is. ", + "This is not a valid wallet file. ", + "This unit doesn\'t exists, please use the one of the following units ", + "Invalid address. ", + "Invalid password. ", + "Invalid amount. ", + "Invalid gas limit. ", + "Invalid data value. ", + "Invalid gas amount. ", + "Invalid nonce. ", + "Invalid signed transaction. ", + "A wallet with this nickname already exists. ", + "Wallet not found. ", + "Whoops. It doesnt look like a proposal with this ID exists yet or there is an error reading this proposal. ", + "A wallet with this address already exists in storage. Please check your wallets page. ", + "You need to have at some ETH in your account to cover the cost of gas. .05ETH should be more than sufficient for a few sends and votes. "]; +globalFuncs.successMsgs = ["Valid address", "Wallet successfully decrypted", "Transaction submitted. TX ID: ", "New wallet added: ", "You have successfully voted. Thank you for being an active participant in The DAO."]; +globalFuncs.scrypt = { + n: 1024 +}; +globalFuncs.postDelay = 300; +globalFuncs.kdf = "scrypt"; +globalFuncs.defaultTxGasLimit = 21000; +globalFuncs.digixClaimTxGasLimit = 150000; +globalFuncs.donateAddress = "0x7cB57B5A97eAbe94205C07890BE4c1aD31E486A8"; +globalFuncs.isNumeric = function(n) { + return !isNaN(parseFloat(n)) && isFinite(n); +} +globalFuncs.urlGet = function(name) { + if (name = (new RegExp('[?&]' + encodeURIComponent(name) + '=([^&]*)')).exec(location.search)) return this.stripTags(decodeURIComponent(name[1])); +} +globalFuncs.stripTags = function(str) { + var SCRIPT_REGEX = /)<[^<]*)*<\/script>/gi; + while (SCRIPT_REGEX.test(str)) { + str = str.replace(SCRIPT_REGEX, ""); + } + return str; +} +globalFuncs.checkAndRedirectHTTPS = function() { + var host = "myetherwallet.com"; + var githost = "kvhnuke.github.io"; + var githostw = "www.kvhnuke.github.io"; + var hostw = "www.myetherwallet.com"; + if ((host == window.location.host || githost == window.location.host || hostw == window.location.host || githostw == window.location.host) && (window.location.protocol != "https:")) window.location.protocol = "https"; +} +globalFuncs.isStrongPass = function(password) { + return password.length > 8; +} +globalFuncs.hexToAscii = function(hex) { + return hex.match(/.{1,2}/g).map(function(v) { + return String.fromCharCode(parseInt(v, 16)); + }).join(''); +} +module.exports = globalFuncs; },{}],27:[function(require,module,exports){ -'use strict'; -var IS_CX = false; -if(typeof chrome != 'undefined') - IS_CX = chrome.windows === undefined ? false : true; -require("babel-polyfill"); -var angular = require('angular'); -var BigNumber = require('bignumber.js'); -window.BigNumber = BigNumber; -var marked = require('marked'); -window.marked = marked; -var ethUtil = require('ethereumjs-util'); -ethUtil.crypto = require('crypto'); -ethUtil.Tx = require('ethereumjs-tx'); -ethUtil.scrypt = require('scryptsy'); -ethUtil.uuid = require('uuid'); -window.ethUtil = ethUtil; -var Wallet = require('./myetherwallet'); -window.Wallet = Wallet; -var globalFuncs = require('./globalFuncs'); -window.globalFuncs = globalFuncs; -var uiFuncs = require('./uiFuncs'); -window.uiFuncs = uiFuncs; -var etherUnits = require('./etherUnits'); -window.etherUnits = etherUnits; -var ajaxReq = require('./ajaxReq'); -window.ajaxReq = ajaxReq; -var ethFuncs = require('./ethFuncs'); -window.ethFuncs = ethFuncs; -if(IS_CX){ - var cxFuncs = require('./cxFuncs'); - window.cxFuncs = cxFuncs; -} -var tabsCtrl = require('./controllers/tabsCtrl'); -var viewCtrl = require('./controllers/viewCtrl'); -var walletGenCtrl = require('./controllers/walletGenCtrl'); -var bulkGenCtrl = require('./controllers/bulkGenCtrl'); -var decryptWalletCtrl = require('./controllers/decryptWalletCtrl'); -var viewWalletCtrl = require('./controllers/viewWalletCtrl'); -var sendTxCtrl = require('./controllers/sendTxCtrl'); -var digixCtrl = require('./controllers/digixCtrl'); -var theDaoCtrl = require('./controllers/theDaoCtrl'); -var theDaoProposalCtrl = require('./controllers/theDaoProposalCtrl'); -var sendOfflineTxCtrl = require('./controllers/sendOfflineTxCtrl'); -var globalService = require('./services/globalService'); -var walletService = require('./services/walletService'); -var blockiesDrtv = require('./directives/blockiesDrtv'); -var QRCodeDrtv = require('./directives/QRCodeDrtv'); -var walletDecryptDrtv = require('./directives/walletDecryptDrtv'); -var cxWalletDecryptDrtv = require('./directives/cxWalletDecryptDrtv'); -var fileReaderDrtv = require('./directives/fileReaderDrtv'); -if(IS_CX){ - var addWalletCtrl = require('./controllers/CX/addWalletCtrl'); - var cxDecryptWalletCtrl = require('./controllers/CX/cxDecryptWalletCtrl'); - var myWalletsCtrl = require('./controllers/CX/myWalletsCtrl'); - var mainPopCtrl = require('./controllers/CX/mainPopCtrl'); - var quickSendCtrl = require('./controllers/CX/quickSendCtrl'); -} -var app = angular.module('mewApp', []); -app.config(['$compileProvider', function($compileProvider) { - $compileProvider.aHrefSanitizationWhitelist(/^\s*(|blob|):/); -}]); -app.factory('globalService', ['$http','$httpParamSerializerJQLike',globalService]); -app.factory('walletService', walletService); -app.directive('blockieAddress', blockiesDrtv); -app.directive('qrCode', QRCodeDrtv); -app.directive('onReadFile', fileReaderDrtv); -app.directive('walletDecryptDrtv', walletDecryptDrtv); -app.directive('cxWalletDecryptDrtv', cxWalletDecryptDrtv); -app.controller('tabsCtrl', ['$scope', 'globalService', tabsCtrl]); -app.controller('viewCtrl', ['$scope', 'globalService', viewCtrl]); -app.controller('walletGenCtrl', ['$scope', walletGenCtrl]); -app.controller('bulkGenCtrl', ['$scope', bulkGenCtrl]); -app.controller('decryptWalletCtrl', ['$scope','$sce','walletService', decryptWalletCtrl]); -app.controller('viewWalletCtrl', ['$scope','walletService', viewWalletCtrl]); -app.controller('sendTxCtrl', ['$scope','$sce','walletService', sendTxCtrl]); -app.controller('digixCtrl', ['$scope','$sce','walletService', digixCtrl]); -app.controller('theDaoCtrl', ['$scope','$sce','walletService', theDaoCtrl]); -app.controller('theDaoProposalCtrl', ['$scope','$sce','walletService', theDaoProposalCtrl]); -app.controller('sendOfflineTxCtrl', ['$scope','$sce','walletService', sendOfflineTxCtrl]); -if(IS_CX){ - app.controller('addWalletCtrl', ['$scope','$sce', addWalletCtrl]); - app.controller('myWalletsCtrl', ['$scope','$sce', myWalletsCtrl]); - app.controller('mainPopCtrl', ['$scope','$sce', mainPopCtrl]); - app.controller('quickSendCtrl', ['$scope','$sce', quickSendCtrl]); - app.controller('cxDecryptWalletCtrl', ['$scope','$sce','walletService', cxDecryptWalletCtrl]); -} - -},{"./ajaxReq":1,"./controllers/CX/addWalletCtrl":2,"./controllers/CX/cxDecryptWalletCtrl":3,"./controllers/CX/mainPopCtrl":4,"./controllers/CX/myWalletsCtrl":5,"./controllers/CX/quickSendCtrl":6,"./controllers/bulkGenCtrl":7,"./controllers/decryptWalletCtrl":8,"./controllers/digixCtrl":9,"./controllers/sendOfflineTxCtrl":10,"./controllers/sendTxCtrl":11,"./controllers/tabsCtrl":12,"./controllers/theDaoCtrl":13,"./controllers/theDaoProposalCtrl":14,"./controllers/viewCtrl":15,"./controllers/viewWalletCtrl":16,"./controllers/walletGenCtrl":17,"./cxFuncs":18,"./directives/QRCodeDrtv":19,"./directives/blockiesDrtv":20,"./directives/cxWalletDecryptDrtv":21,"./directives/fileReaderDrtv":22,"./directives/walletDecryptDrtv":23,"./ethFuncs":24,"./etherUnits":25,"./globalFuncs":26,"./myetherwallet":28,"./services/globalService":29,"./services/walletService":30,"./uiFuncs":31,"angular":33,"babel-polyfill":49,"bignumber.js":51,"crypto":386,"ethereumjs-tx":416,"ethereumjs-util":417,"marked":433,"scryptsy":463,"uuid":483}],28:[function(require,module,exports){ +'use strict'; +var IS_CX = false; +if(typeof chrome != 'undefined') + IS_CX = chrome.windows === undefined ? false : true; +require("babel-polyfill"); +var angular = require('angular'); +var BigNumber = require('bignumber.js'); +window.BigNumber = BigNumber; +var marked = require('marked'); +window.marked = marked; +var ethUtil = require('ethereumjs-util'); +ethUtil.crypto = require('crypto'); +ethUtil.Tx = require('ethereumjs-tx'); +ethUtil.scrypt = require('scryptsy'); +ethUtil.uuid = require('uuid'); +window.ethUtil = ethUtil; +var Wallet = require('./myetherwallet'); +window.Wallet = Wallet; +var globalFuncs = require('./globalFuncs'); +window.globalFuncs = globalFuncs; +var uiFuncs = require('./uiFuncs'); +window.uiFuncs = uiFuncs; +var etherUnits = require('./etherUnits'); +window.etherUnits = etherUnits; +var ajaxReq = require('./ajaxReq'); +window.ajaxReq = ajaxReq; +var ethFuncs = require('./ethFuncs'); +window.ethFuncs = ethFuncs; +if(IS_CX){ + var cxFuncs = require('./cxFuncs'); + window.cxFuncs = cxFuncs; +} +var tabsCtrl = require('./controllers/tabsCtrl'); +var viewCtrl = require('./controllers/viewCtrl'); +var walletGenCtrl = require('./controllers/walletGenCtrl'); +var bulkGenCtrl = require('./controllers/bulkGenCtrl'); +var decryptWalletCtrl = require('./controllers/decryptWalletCtrl'); +var viewWalletCtrl = require('./controllers/viewWalletCtrl'); +var sendTxCtrl = require('./controllers/sendTxCtrl'); +var digixCtrl = require('./controllers/digixCtrl'); +var theDaoCtrl = require('./controllers/theDaoCtrl'); +var theDaoProposalCtrl = require('./controllers/theDaoProposalCtrl'); +var sendOfflineTxCtrl = require('./controllers/sendOfflineTxCtrl'); +var globalService = require('./services/globalService'); +var walletService = require('./services/walletService'); +var blockiesDrtv = require('./directives/blockiesDrtv'); +var QRCodeDrtv = require('./directives/QRCodeDrtv'); +var walletDecryptDrtv = require('./directives/walletDecryptDrtv'); +var cxWalletDecryptDrtv = require('./directives/cxWalletDecryptDrtv'); +var fileReaderDrtv = require('./directives/fileReaderDrtv'); +if(IS_CX){ + var addWalletCtrl = require('./controllers/CX/addWalletCtrl'); + var cxDecryptWalletCtrl = require('./controllers/CX/cxDecryptWalletCtrl'); + var myWalletsCtrl = require('./controllers/CX/myWalletsCtrl'); + var mainPopCtrl = require('./controllers/CX/mainPopCtrl'); + var quickSendCtrl = require('./controllers/CX/quickSendCtrl'); +} +var app = angular.module('mewApp', []); +app.config(['$compileProvider', function($compileProvider) { + $compileProvider.aHrefSanitizationWhitelist(/^\s*(|blob|):/); +}]); +app.factory('globalService', ['$http','$httpParamSerializerJQLike',globalService]); +app.factory('walletService', walletService); +app.directive('blockieAddress', blockiesDrtv); +app.directive('qrCode', QRCodeDrtv); +app.directive('onReadFile', fileReaderDrtv); +app.directive('walletDecryptDrtv', walletDecryptDrtv); +app.directive('cxWalletDecryptDrtv', cxWalletDecryptDrtv); +app.controller('tabsCtrl', ['$scope', 'globalService', tabsCtrl]); +app.controller('viewCtrl', ['$scope', 'globalService', viewCtrl]); +app.controller('walletGenCtrl', ['$scope', walletGenCtrl]); +app.controller('bulkGenCtrl', ['$scope', bulkGenCtrl]); +app.controller('decryptWalletCtrl', ['$scope','$sce','walletService', decryptWalletCtrl]); +app.controller('viewWalletCtrl', ['$scope','walletService', viewWalletCtrl]); +app.controller('sendTxCtrl', ['$scope','$sce','walletService', sendTxCtrl]); +app.controller('digixCtrl', ['$scope','$sce','walletService', digixCtrl]); +app.controller('theDaoCtrl', ['$scope','$sce','walletService', theDaoCtrl]); +app.controller('theDaoProposalCtrl', ['$scope','$sce','walletService', theDaoProposalCtrl]); +app.controller('sendOfflineTxCtrl', ['$scope','$sce','walletService', sendOfflineTxCtrl]); +if(IS_CX){ + app.controller('addWalletCtrl', ['$scope','$sce', addWalletCtrl]); + app.controller('myWalletsCtrl', ['$scope','$sce', myWalletsCtrl]); + app.controller('mainPopCtrl', ['$scope','$sce', mainPopCtrl]); + app.controller('quickSendCtrl', ['$scope','$sce', quickSendCtrl]); + app.controller('cxDecryptWalletCtrl', ['$scope','$sce','walletService', cxDecryptWalletCtrl]); +} + +},{"./ajaxReq":1,"./controllers/CX/addWalletCtrl":2,"./controllers/CX/cxDecryptWalletCtrl":3,"./controllers/CX/mainPopCtrl":4,"./controllers/CX/myWalletsCtrl":5,"./controllers/CX/quickSendCtrl":6,"./controllers/bulkGenCtrl":7,"./controllers/decryptWalletCtrl":8,"./controllers/digixCtrl":9,"./controllers/sendOfflineTxCtrl":10,"./controllers/sendTxCtrl":11,"./controllers/tabsCtrl":12,"./controllers/theDaoCtrl":13,"./controllers/theDaoProposalCtrl":14,"./controllers/viewCtrl":15,"./controllers/viewWalletCtrl":16,"./controllers/walletGenCtrl":17,"./cxFuncs":18,"./directives/QRCodeDrtv":19,"./directives/blockiesDrtv":20,"./directives/cxWalletDecryptDrtv":21,"./directives/fileReaderDrtv":22,"./directives/walletDecryptDrtv":23,"./ethFuncs":24,"./etherUnits":25,"./globalFuncs":26,"./myetherwallet":28,"./services/globalService":29,"./services/walletService":30,"./uiFuncs":31,"angular":33,"babel-polyfill":49,"bignumber.js":52,"crypto":387,"ethereumjs-tx":417,"ethereumjs-util":418,"marked":434,"scryptsy":463,"uuid":483}],28:[function(require,module,exports){ (function (Buffer){ -'use strict'; -var Wallet = function(priv) { - this.privKey = priv.length == 32 ? priv : Buffer(priv, 'hex') -} -Wallet.generate = function(icapDirect) { - if (icapDirect) { - while (true) { - var privKey = ethUtil.crypto.randomBytes(32) - if (ethUtil.privateToAddress(privKey)[0] === 0) { - return new Wallet(privKey) - } - } - } else { - return new Wallet(ethUtil.crypto.randomBytes(32)) - } -} -Wallet.prototype.getPrivateKey = function() { - return this.privKey -} -Wallet.prototype.getPrivateKeyString = function() { - return this.getPrivateKey().toString('hex') -} -Wallet.prototype.getPublicKey = function() { - return ethUtil.privateToPublic(this.privKey) -} -Wallet.prototype.getPublicKeyString = function() { - return '0x' + this.getPublicKey().toString('hex') -} -Wallet.prototype.getAddress = function() { - return ethUtil.privateToAddress(this.privKey) -} -Wallet.prototype.getAddressString = function() { - return '0x' + this.getAddress().toString('hex') -} -Wallet.prototype.getChecksumAddressString = function() { - return ethUtil.toChecksumAddress(this.getAddressString()) -} -Wallet.fromPrivateKey = function(priv) { - return new Wallet(priv) -} -Wallet.prototype.toV3 = function(password, opts) { - opts = opts || {} - var salt = opts.salt || ethUtil.crypto.randomBytes(32) - var iv = opts.iv || ethUtil.crypto.randomBytes(16) - var derivedKey - var kdf = opts.kdf || 'scrypt' - var kdfparams = { - dklen: opts.dklen || 32, - salt: salt.toString('hex') - } - if (kdf === 'pbkdf2') { - kdfparams.c = opts.c || 262144 - kdfparams.prf = 'hmac-sha256' - derivedKey = ethUtil.crypto.pbkdf2Sync(new Buffer(password), salt, kdfparams.c, kdfparams.dklen, 'sha256') - } else if (kdf === 'scrypt') { - // FIXME: support progress reporting callback - kdfparams.n = opts.n || 262144 - kdfparams.r = opts.r || 8 - kdfparams.p = opts.p || 1 - derivedKey = ethUtil.scrypt(new Buffer(password), salt, kdfparams.n, kdfparams.r, kdfparams.p, kdfparams.dklen) - } else { - throw new Error('Unsupported kdf') - } - var cipher = ethUtil.crypto.createCipheriv(opts.cipher || 'aes-128-ctr', derivedKey.slice(0, 16), iv) - if (!cipher) { - throw new Error('Unsupported cipher') - } - var ciphertext = Buffer.concat([cipher.update(this.privKey), cipher.final()]) - var mac = ethUtil.sha3(Buffer.concat([derivedKey.slice(16, 32), new Buffer(ciphertext, 'hex')])) - return { - version: 3, - id: ethUtil.uuid.v4({ - random: opts.uuid || ethUtil.crypto.randomBytes(16) - }), - address: this.getAddress().toString('hex'), - Crypto: { - ciphertext: ciphertext.toString('hex'), - cipherparams: { - iv: iv.toString('hex') - }, - cipher: opts.cipher || 'aes-128-ctr', - kdf: kdf, - kdfparams: kdfparams, - mac: mac.toString('hex') - } - } -} -Wallet.prototype.toJSON = function() { - return { - address: this.getAddressString(), - checksumAddress: this.getChecksumAddressString(), - privKey: this.getPrivateKeyString(), - pubKey: this.getPublicKeyString(), - publisher:"MyEtherWallet", - encrypted:false, - version:2 - } -} -Wallet.fromMyEtherWallet = function(input, password) { - var json = (typeof input === 'object') ? input : JSON.parse(input) - var privKey - if (!json.locked) { - if (json.private.length !== 64) { - throw new Error('Invalid private key length') - } - privKey = new Buffer(json.private, 'hex') - } else { - if (typeof password !== 'string') { - throw new Error('Password required') - } - if (password.length < 7) { - throw new Error('Password must be at least 7 characters') - } - var cipher = json.encrypted ? json.private.slice(0, 128) : json.private - cipher = Wallet.decodeCryptojsSalt(cipher) - var evp = Wallet.evp_kdf(new Buffer(password), cipher.salt, { - keysize: 32, - ivsize: 16 - }) - var decipher = ethUtil.crypto.createDecipheriv('aes-256-cbc', evp.key, evp.iv) - privKey = Wallet.decipherBuffer(decipher, new Buffer(cipher.ciphertext)) - privKey = new Buffer((privKey.toString()), 'hex') - } - var wallet = new Wallet(privKey) - if (wallet.getAddressString() !== json.address) { - throw new Error('Invalid private key or address') - } - return wallet -} -Wallet.fromMyEtherWalletV2 = function (input){ - var json = (typeof input === 'object') ? input : JSON.parse(input); - if (json.privKey.length !== 64) { - throw new Error('Invalid private key length'); - }; - var privKey = new Buffer(json.privKey, 'hex'); - return new Wallet(privKey); -} -Wallet.fromEthSale = function(input, password) { - var json = (typeof input === 'object') ? input : JSON.parse(input) - var encseed = new Buffer(json.encseed, 'hex') - var derivedKey = ethUtil.crypto.pbkdf2Sync(Buffer(password), Buffer(password), 2000, 32, 'sha256').slice(0, 16) - var decipher = ethUtil.crypto.createDecipheriv('aes-128-cbc', derivedKey, encseed.slice(0, 16)) - var seed = Wallet.decipherBuffer(decipher, encseed.slice(16)) - var wallet = new Wallet(ethUtil.sha3(seed)) - if (wallet.getAddress().toString('hex') !== json.ethaddr) { - throw new Error('Decoded key mismatch - possibly wrong passphrase') - } - return wallet -} -Wallet.fromMyEtherWalletKey = function(input, password) { - var cipher = input.slice(0, 128) - cipher = Wallet.decodeCryptojsSalt(cipher) - var evp = Wallet.evp_kdf(new Buffer(password), cipher.salt, { - keysize: 32, - ivsize: 16 - }) - var decipher = ethUtil.crypto.createDecipheriv('aes-256-cbc', evp.key, evp.iv) - var privKey = Wallet.decipherBuffer(decipher, new Buffer(cipher.ciphertext)) - privKey = new Buffer((privKey.toString()), 'hex') - return new Wallet(privKey) -} -Wallet.fromV3 = function(input, password, nonStrict) { - var json = (typeof input === 'object') ? input : JSON.parse(nonStrict ? input.toLowerCase() : input) - if (json.version !== 3) { - throw new Error('Not a V3 wallet') - } - var derivedKey - var kdfparams - if (json.crypto.kdf === 'scrypt') { - kdfparams = json.crypto.kdfparams - derivedKey = ethUtil.scrypt(new Buffer(password), new Buffer(kdfparams.salt, 'hex'), kdfparams.n, kdfparams.r, kdfparams.p, kdfparams.dklen) - } else if (json.crypto.kdf === 'pbkdf2') { - kdfparams = json.crypto.kdfparams - if (kdfparams.prf !== 'hmac-sha256') { - throw new Error('Unsupported parameters to PBKDF2') - } - derivedKey = ethUtil.crypto.pbkdf2Sync(new Buffer(password), new Buffer(kdfparams.salt, 'hex'), kdfparams.c, kdfparams.dklen, 'sha256') - } else { - throw new Error('Unsupported key derivation scheme') - } - var ciphertext = new Buffer(json.crypto.ciphertext, 'hex') - var mac = ethUtil.sha3(Buffer.concat([derivedKey.slice(16, 32), ciphertext])) - if (mac.toString('hex') !== json.crypto.mac) { - throw new Error('Key derivation failed - possibly wrong passphrase') - } - var decipher = ethUtil.crypto.createDecipheriv(json.crypto.cipher, derivedKey.slice(0, 16), new Buffer(json.crypto.cipherparams.iv, 'hex')) - var seed = Wallet.decipherBuffer(decipher, ciphertext, 'hex') - return new Wallet(seed) -} -Wallet.prototype.toV3String = function(password, opts) { - return JSON.stringify(this.toV3(password, opts)) -} -Wallet.prototype.getV3Filename = function (timestamp) { - var ts = timestamp ? new Date(timestamp) : new Date() - return [ - 'UTC--', - ts.toJSON().replace(/:/g, '-'), - '--', - this.getAddress().toString('hex') - ].join('') -} -Wallet.decipherBuffer = function(decipher, data) { - return Buffer.concat([decipher.update(data), decipher.final()]) -} -Wallet.decodeCryptojsSalt = function(input) { - var ciphertext = new Buffer(input, 'base64') - if (ciphertext.slice(0, 8).toString() === 'Salted__') { - return { - salt: ciphertext.slice(8, 16), - ciphertext: ciphertext.slice(16) - } - } else { - return { - ciphertext: ciphertext - } - } -} -Wallet.evp_kdf = function(data, salt, opts) { - // A single EVP iteration, returns `D_i`, where block equlas to `D_(i-1)` - - function iter(block) { - var hash = ethUtil.crypto.createHash(opts.digest || 'md5') - hash.update(block) - hash.update(data) - hash.update(salt) - block = hash.digest() - for (var i = 1; i < (opts.count || 1); i++) { - hash = ethUtil.crypto.createHash(opts.digest || 'md5') - hash.update(block) - block = hash.digest() - } - return block - } - var keysize = opts.keysize || 16 - var ivsize = opts.ivsize || 16 - var ret = [] - var i = 0 - while (Buffer.concat(ret).length < (keysize + ivsize)) { - ret[i] = iter((i === 0) ? new Buffer(0) : ret[i - 1]) - i++ - } - var tmp = Buffer.concat(ret) - return { - key: tmp.slice(0, keysize), - iv: tmp.slice(keysize, keysize + ivsize) - } -} -Wallet.walletRequirePass = function(ethjson) { - var jsonArr; - try { - jsonArr = JSON.parse(ethjson); - } catch (err) { - throw globalFuncs.errorMsgs[3]; - } - if (jsonArr.encseed != null) return true; - else if (jsonArr.Crypto != null || jsonArr.crypto != null) return true - else if (jsonArr.hash != null && jsonArr.locked) return true; - else if (jsonArr.hash != null && !jsonArr.locked) return false; - else if (jsonArr.publisher == "MyEtherWallet" && !jsonArr.encrypted) return false; - else - throw globalFuncs.errorMsgs[2]; -} -Wallet.getWalletFromPrivKeyFile = function(strjson, password) { - var jsonArr = JSON.parse(strjson); - if (jsonArr.encseed != null) return Wallet.fromEthSale(strjson, password); - else if (jsonArr.Crypto != null || jsonArr.crypto != null) return Wallet.fromV3(strjson, password, true); - else if (jsonArr.hash != null) return Wallet.fromMyEtherWallet(strjson, password); - else if (jsonArr.publisher == "MyEtherWallet") return Wallet.fromMyEtherWalletV2(strjson); - else - throw globalFuncs.errorMsgs[2]; -} +'use strict'; +var Wallet = function(priv) { + this.privKey = priv.length == 32 ? priv : Buffer(priv, 'hex') +} +Wallet.generate = function(icapDirect) { + if (icapDirect) { + while (true) { + var privKey = ethUtil.crypto.randomBytes(32) + if (ethUtil.privateToAddress(privKey)[0] === 0) { + return new Wallet(privKey) + } + } + } else { + return new Wallet(ethUtil.crypto.randomBytes(32)) + } +} +Wallet.prototype.getPrivateKey = function() { + return this.privKey +} +Wallet.prototype.getPrivateKeyString = function() { + return this.getPrivateKey().toString('hex') +} +Wallet.prototype.getPublicKey = function() { + return ethUtil.privateToPublic(this.privKey) +} +Wallet.prototype.getPublicKeyString = function() { + return '0x' + this.getPublicKey().toString('hex') +} +Wallet.prototype.getAddress = function() { + return ethUtil.privateToAddress(this.privKey) +} +Wallet.prototype.getAddressString = function() { + return '0x' + this.getAddress().toString('hex') +} +Wallet.prototype.getChecksumAddressString = function() { + return ethUtil.toChecksumAddress(this.getAddressString()) +} +Wallet.fromPrivateKey = function(priv) { + return new Wallet(priv) +} +Wallet.prototype.toV3 = function(password, opts) { + opts = opts || {} + var salt = opts.salt || ethUtil.crypto.randomBytes(32) + var iv = opts.iv || ethUtil.crypto.randomBytes(16) + var derivedKey + var kdf = opts.kdf || 'scrypt' + var kdfparams = { + dklen: opts.dklen || 32, + salt: salt.toString('hex') + } + if (kdf === 'pbkdf2') { + kdfparams.c = opts.c || 262144 + kdfparams.prf = 'hmac-sha256' + derivedKey = ethUtil.crypto.pbkdf2Sync(new Buffer(password), salt, kdfparams.c, kdfparams.dklen, 'sha256') + } else if (kdf === 'scrypt') { + // FIXME: support progress reporting callback + kdfparams.n = opts.n || 262144 + kdfparams.r = opts.r || 8 + kdfparams.p = opts.p || 1 + derivedKey = ethUtil.scrypt(new Buffer(password), salt, kdfparams.n, kdfparams.r, kdfparams.p, kdfparams.dklen) + } else { + throw new Error('Unsupported kdf') + } + var cipher = ethUtil.crypto.createCipheriv(opts.cipher || 'aes-128-ctr', derivedKey.slice(0, 16), iv) + if (!cipher) { + throw new Error('Unsupported cipher') + } + var ciphertext = Buffer.concat([cipher.update(this.privKey), cipher.final()]) + var mac = ethUtil.sha3(Buffer.concat([derivedKey.slice(16, 32), new Buffer(ciphertext, 'hex')])) + return { + version: 3, + id: ethUtil.uuid.v4({ + random: opts.uuid || ethUtil.crypto.randomBytes(16) + }), + address: this.getAddress().toString('hex'), + Crypto: { + ciphertext: ciphertext.toString('hex'), + cipherparams: { + iv: iv.toString('hex') + }, + cipher: opts.cipher || 'aes-128-ctr', + kdf: kdf, + kdfparams: kdfparams, + mac: mac.toString('hex') + } + } +} +Wallet.prototype.toJSON = function() { + return { + address: this.getAddressString(), + checksumAddress: this.getChecksumAddressString(), + privKey: this.getPrivateKeyString(), + pubKey: this.getPublicKeyString(), + publisher:"MyEtherWallet", + encrypted:false, + version:2 + } +} +Wallet.fromMyEtherWallet = function(input, password) { + var json = (typeof input === 'object') ? input : JSON.parse(input) + var privKey + if (!json.locked) { + if (json.private.length !== 64) { + throw new Error('Invalid private key length') + } + privKey = new Buffer(json.private, 'hex') + } else { + if (typeof password !== 'string') { + throw new Error('Password required') + } + if (password.length < 7) { + throw new Error('Password must be at least 7 characters') + } + var cipher = json.encrypted ? json.private.slice(0, 128) : json.private + cipher = Wallet.decodeCryptojsSalt(cipher) + var evp = Wallet.evp_kdf(new Buffer(password), cipher.salt, { + keysize: 32, + ivsize: 16 + }) + var decipher = ethUtil.crypto.createDecipheriv('aes-256-cbc', evp.key, evp.iv) + privKey = Wallet.decipherBuffer(decipher, new Buffer(cipher.ciphertext)) + privKey = new Buffer((privKey.toString()), 'hex') + } + var wallet = new Wallet(privKey) + if (wallet.getAddressString() !== json.address) { + throw new Error('Invalid private key or address') + } + return wallet +} +Wallet.fromMyEtherWalletV2 = function (input){ + var json = (typeof input === 'object') ? input : JSON.parse(input); + if (json.privKey.length !== 64) { + throw new Error('Invalid private key length'); + }; + var privKey = new Buffer(json.privKey, 'hex'); + return new Wallet(privKey); +} +Wallet.fromEthSale = function(input, password) { + var json = (typeof input === 'object') ? input : JSON.parse(input) + var encseed = new Buffer(json.encseed, 'hex') + var derivedKey = ethUtil.crypto.pbkdf2Sync(Buffer(password), Buffer(password), 2000, 32, 'sha256').slice(0, 16) + var decipher = ethUtil.crypto.createDecipheriv('aes-128-cbc', derivedKey, encseed.slice(0, 16)) + var seed = Wallet.decipherBuffer(decipher, encseed.slice(16)) + var wallet = new Wallet(ethUtil.sha3(seed)) + if (wallet.getAddress().toString('hex') !== json.ethaddr) { + throw new Error('Decoded key mismatch - possibly wrong passphrase') + } + return wallet +} +Wallet.fromMyEtherWalletKey = function(input, password) { + var cipher = input.slice(0, 128) + cipher = Wallet.decodeCryptojsSalt(cipher) + var evp = Wallet.evp_kdf(new Buffer(password), cipher.salt, { + keysize: 32, + ivsize: 16 + }) + var decipher = ethUtil.crypto.createDecipheriv('aes-256-cbc', evp.key, evp.iv) + var privKey = Wallet.decipherBuffer(decipher, new Buffer(cipher.ciphertext)) + privKey = new Buffer((privKey.toString()), 'hex') + return new Wallet(privKey) +} +Wallet.fromV3 = function(input, password, nonStrict) { + var json = (typeof input === 'object') ? input : JSON.parse(nonStrict ? input.toLowerCase() : input) + if (json.version !== 3) { + throw new Error('Not a V3 wallet') + } + var derivedKey + var kdfparams + if (json.crypto.kdf === 'scrypt') { + kdfparams = json.crypto.kdfparams + derivedKey = ethUtil.scrypt(new Buffer(password), new Buffer(kdfparams.salt, 'hex'), kdfparams.n, kdfparams.r, kdfparams.p, kdfparams.dklen) + } else if (json.crypto.kdf === 'pbkdf2') { + kdfparams = json.crypto.kdfparams + if (kdfparams.prf !== 'hmac-sha256') { + throw new Error('Unsupported parameters to PBKDF2') + } + derivedKey = ethUtil.crypto.pbkdf2Sync(new Buffer(password), new Buffer(kdfparams.salt, 'hex'), kdfparams.c, kdfparams.dklen, 'sha256') + } else { + throw new Error('Unsupported key derivation scheme') + } + var ciphertext = new Buffer(json.crypto.ciphertext, 'hex') + var mac = ethUtil.sha3(Buffer.concat([derivedKey.slice(16, 32), ciphertext])) + if (mac.toString('hex') !== json.crypto.mac) { + throw new Error('Key derivation failed - possibly wrong passphrase') + } + var decipher = ethUtil.crypto.createDecipheriv(json.crypto.cipher, derivedKey.slice(0, 16), new Buffer(json.crypto.cipherparams.iv, 'hex')) + var seed = Wallet.decipherBuffer(decipher, ciphertext, 'hex') + return new Wallet(seed) +} +Wallet.prototype.toV3String = function(password, opts) { + return JSON.stringify(this.toV3(password, opts)) +} +Wallet.prototype.getV3Filename = function (timestamp) { + var ts = timestamp ? new Date(timestamp) : new Date() + return [ + 'UTC--', + ts.toJSON().replace(/:/g, '-'), + '--', + this.getAddress().toString('hex') + ].join('') +} +Wallet.decipherBuffer = function(decipher, data) { + return Buffer.concat([decipher.update(data), decipher.final()]) +} +Wallet.decodeCryptojsSalt = function(input) { + var ciphertext = new Buffer(input, 'base64') + if (ciphertext.slice(0, 8).toString() === 'Salted__') { + return { + salt: ciphertext.slice(8, 16), + ciphertext: ciphertext.slice(16) + } + } else { + return { + ciphertext: ciphertext + } + } +} +Wallet.evp_kdf = function(data, salt, opts) { + // A single EVP iteration, returns `D_i`, where block equlas to `D_(i-1)` + + function iter(block) { + var hash = ethUtil.crypto.createHash(opts.digest || 'md5') + hash.update(block) + hash.update(data) + hash.update(salt) + block = hash.digest() + for (var i = 1; i < (opts.count || 1); i++) { + hash = ethUtil.crypto.createHash(opts.digest || 'md5') + hash.update(block) + block = hash.digest() + } + return block + } + var keysize = opts.keysize || 16 + var ivsize = opts.ivsize || 16 + var ret = [] + var i = 0 + while (Buffer.concat(ret).length < (keysize + ivsize)) { + ret[i] = iter((i === 0) ? new Buffer(0) : ret[i - 1]) + i++ + } + var tmp = Buffer.concat(ret) + return { + key: tmp.slice(0, keysize), + iv: tmp.slice(keysize, keysize + ivsize) + } +} +Wallet.walletRequirePass = function(ethjson) { + var jsonArr; + try { + jsonArr = JSON.parse(ethjson); + } catch (err) { + throw globalFuncs.errorMsgs[3]; + } + if (jsonArr.encseed != null) return true; + else if (jsonArr.Crypto != null || jsonArr.crypto != null) return true + else if (jsonArr.hash != null && jsonArr.locked) return true; + else if (jsonArr.hash != null && !jsonArr.locked) return false; + else if (jsonArr.publisher == "MyEtherWallet" && !jsonArr.encrypted) return false; + else + throw globalFuncs.errorMsgs[2]; +} +Wallet.getWalletFromPrivKeyFile = function(strjson, password) { + var jsonArr = JSON.parse(strjson); + if (jsonArr.encseed != null) return Wallet.fromEthSale(strjson, password); + else if (jsonArr.Crypto != null || jsonArr.crypto != null) return Wallet.fromV3(strjson, password, true); + else if (jsonArr.hash != null) return Wallet.fromMyEtherWallet(strjson, password); + else if (jsonArr.publisher == "MyEtherWallet") return Wallet.fromMyEtherWalletV2(strjson); + else + throw globalFuncs.errorMsgs[2]; +} module.exports = Wallet; }).call(this,require("buffer").Buffer) -},{"buffer":83}],29:[function(require,module,exports){ -'use strict'; -var globalService = function($http, $httpParamSerializerJQLike) { - globalFuncs.checkAndRedirectHTTPS(); - ajaxReq.http = $http; - ajaxReq.postSerializer = $httpParamSerializerJQLike; - - var tabs = { - generateWallet: { - id: 0, - name: "Generate Wallet", - url: "generate-wallet", - mew: true, - cx: false - }, - bulkGenerate: { - id: 1, - name: "Bulk Generate", - url: "bulk-generate", - mew: false, - cx: false - }, - viewWalletInfo: { - id: 2, - name: "View Wallet Info", - url: "view-wallet-info", - mew: true, - cx: false - }, - myWallet: { - id: 3, - name: "My Wallets", - url: "my-wallet", - mew: false, - cx: true - }, - addWallet: { - id: 4, - name: "Add Wallet", - url: "add-wallet", - mew: false, - cx: true - }, - sendTransaction: { - id: 5, - name: "Send Transaction", - url: "send-transaction", - mew: true, - cx: true - }, - offlineTransaction: { - id: 6, - name: "Offline Transaction", - url:"offline-transaction", - mew: true, - cx: false - }, - dao: { - id: 7, - name: "The DAO", - url: "the-dao", - mew: true, - cx: true - }, - daoproposals: { - id: 8, - name: "DAO Proposals", - url: "dao-proposals", - mew: true, - cx: true - }, - digix: { - id: 9, - name: "Digix", - url: "digix", - mew: true, - cx: true - }, - contracts: { - id: 10, - name: "Contracts", - url:"contracts", - mew: false, - cx: false - }, - help: { - id: 11, - name: "Help", - url: "help", - mew: true, - cx: true - } - }; - var currentTab = 0; - if(typeof chrome != 'undefined') - currentTab = chrome.windows === undefined ? 0 : 3; - return { - tabs: tabs, - currentTab: currentTab - }; -}; -module.exports = globalService; - - +},{"buffer":84}],29:[function(require,module,exports){ +'use strict'; +var globalService = function($http, $httpParamSerializerJQLike) { + globalFuncs.checkAndRedirectHTTPS(); + ajaxReq.http = $http; + ajaxReq.postSerializer = $httpParamSerializerJQLike; + + var tabs = { + generateWallet: { + id: 0, + name: "Generate Wallet", + url: "generate-wallet", + mew: true, + cx: false + }, + bulkGenerate: { + id: 1, + name: "Bulk Generate", + url: "bulk-generate", + mew: false, + cx: false + }, + viewWalletInfo: { + id: 2, + name: "View Wallet Info", + url: "view-wallet-info", + mew: true, + cx: false + }, + myWallet: { + id: 3, + name: "My Wallets", + url: "my-wallet", + mew: false, + cx: true + }, + addWallet: { + id: 4, + name: "Add Wallet", + url: "add-wallet", + mew: false, + cx: true + }, + sendTransaction: { + id: 5, + name: "Send Transaction", + url: "send-transaction", + mew: true, + cx: true + }, + offlineTransaction: { + id: 6, + name: "Offline Transaction", + url:"offline-transaction", + mew: true, + cx: false + }, + dao: { + id: 7, + name: "The DAO", + url: "the-dao", + mew: true, + cx: true + }, + daoproposals: { + id: 8, + name: "DAO Proposals", + url: "dao-proposals", + mew: true, + cx: true + }, + digix: { + id: 9, + name: "Digix", + url: "digix", + mew: true, + cx: true + }, + contracts: { + id: 10, + name: "Contracts", + url:"contracts", + mew: false, + cx: false + }, + help: { + id: 11, + name: "Help", + url: "help", + mew: true, + cx: true + } + }; + var currentTab = 0; + if(typeof chrome != 'undefined') + currentTab = chrome.windows === undefined ? 0 : 3; + return { + tabs: tabs, + currentTab: currentTab + }; +}; +module.exports = globalService; + + },{}],30:[function(require,module,exports){ -'use strict'; -var walletService = function() { - return { - wallet: null, - password:'' - } -}; +'use strict'; +var walletService = function() { + return { + wallet: null, + password:'' + } +}; module.exports = walletService; },{}],31:[function(require,module,exports){ (function (Buffer){ -'use strict'; -var uiFuncs = function() {} -uiFuncs.generateTx = function($scope, $sce, callback) { - try { - if (!ethFuncs.validateEtherAddress($scope.tx.to)) throw globalFuncs.errorMsgs[5]; - else if (!globalFuncs.isNumeric($scope.tx.value) || parseFloat($scope.tx.value) < 0) throw globalFuncs.errorMsgs[7]; - else if (!globalFuncs.isNumeric($scope.tx.gasLimit) || parseFloat($scope.tx.gasLimit) <= 0) throw globalFuncs.errorMsgs[8]; - else if (!ethFuncs.validateHexString($scope.tx.data)) throw globalFuncs.errorMsgs[9]; - ajaxReq.getTransactionData($scope.wallet.getAddressString(), function(data) { - if (data.error) throw data.msg; - data = data.data; - var rawTx = { - nonce: ethFuncs.sanitizeHex(data.nonce), - gasPrice: ethFuncs.sanitizeHex(ethFuncs.addTinyMoreToGas(data.gasprice)), - gasLimit: ethFuncs.sanitizeHex(ethFuncs.decimalToHex($scope.tx.gasLimit)), - to: ethFuncs.sanitizeHex($scope.tx.to), - value: ethFuncs.sanitizeHex(ethFuncs.decimalToHex(etherUnits.toWei($scope.tx.value, $scope.tx.unit))), - data: ethFuncs.sanitizeHex($scope.tx.data) - } - var eTx = new ethUtil.Tx(rawTx); - eTx.sign(new Buffer($scope.wallet.getPrivateKeyString(), 'hex')); - $scope.rawTx = JSON.stringify(rawTx); - $scope.signedTx = '0x' + eTx.serialize().toString('hex'); - $scope.showRaw = true; - if($scope.autoSend){ - uiFuncs.sendTx($scope, $sce); - $scope.autoSend = false; - } - if(callback !== undefined) callback(); - }); - $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText('')); - } catch (e) { - $scope.showRaw = false; - $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } -} -uiFuncs.sendTx = function($scope, $sce) { - if(document.getElementById('sendTransaction')!=null) - new Modal(document.getElementById('sendTransaction')).close(); - ajaxReq.sendRawTx($scope.signedTx, function(data) { - if (data.error) { - $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(data.msg)); - } else { - if( $scope.setBalance !== undefined ) $scope.setBalance(); - $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[2] + " " + data.data)); - } - }); -} -uiFuncs.transferAllBalance = function($scope, $sce) { - try { - ajaxReq.getTransactionData($scope.wallet.getAddressString(), function(data) { - if (data.error) throw data.msg; - data = data.data; - var gasPrice = new BigNumber(ethFuncs.sanitizeHex(ethFuncs.addTinyMoreToGas(data.gasprice))).times($scope.tx.gasLimit); - var maxVal = new BigNumber(data.balance).minus(gasPrice); - $scope.tx.unit = "ether"; - $scope.tx.value = etherUnits.toEther(maxVal, 'wei'); - $scope.tx.value = $scope.tx.value < 0 ? 0 : $scope.tx.value; - }); - } catch (e) { - $scope.showRaw = false; - $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); - } -} +'use strict'; +var uiFuncs = function() {} +uiFuncs.generateTx = function($scope, $sce, callback) { + try { + if (!ethFuncs.validateEtherAddress($scope.tx.to)) throw globalFuncs.errorMsgs[5]; + else if (!globalFuncs.isNumeric($scope.tx.value) || parseFloat($scope.tx.value) < 0) throw globalFuncs.errorMsgs[7]; + else if (!globalFuncs.isNumeric($scope.tx.gasLimit) || parseFloat($scope.tx.gasLimit) <= 0) throw globalFuncs.errorMsgs[8]; + else if (!ethFuncs.validateHexString($scope.tx.data)) throw globalFuncs.errorMsgs[9]; + ajaxReq.getTransactionData($scope.wallet.getAddressString(), function(data) { + if (data.error) throw data.msg; + data = data.data; + var rawTx = { + nonce: ethFuncs.sanitizeHex(data.nonce), + gasPrice: ethFuncs.sanitizeHex(ethFuncs.addTinyMoreToGas(data.gasprice)), + gasLimit: ethFuncs.sanitizeHex(ethFuncs.decimalToHex($scope.tx.gasLimit)), + to: ethFuncs.sanitizeHex($scope.tx.to), + value: ethFuncs.sanitizeHex(ethFuncs.decimalToHex(etherUnits.toWei($scope.tx.value, $scope.tx.unit))), + data: ethFuncs.sanitizeHex($scope.tx.data) + } + var eTx = new ethUtil.Tx(rawTx); + eTx.sign(new Buffer($scope.wallet.getPrivateKeyString(), 'hex')); + $scope.rawTx = JSON.stringify(rawTx); + $scope.signedTx = '0x' + eTx.serialize().toString('hex'); + $scope.showRaw = true; + if($scope.autoSend){ + uiFuncs.sendTx($scope, $sce); + $scope.autoSend = false; + } + if(callback !== undefined) callback(); + }); + $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText('')); + } catch (e) { + $scope.showRaw = false; + $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } +} +uiFuncs.sendTx = function($scope, $sce) { + if(document.getElementById('sendTransaction')!=null) + new Modal(document.getElementById('sendTransaction')).close(); + ajaxReq.sendRawTx($scope.signedTx, function(data) { + if (data.error) { + $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(data.msg)); + } else { + if( $scope.setBalance !== undefined ) $scope.setBalance(); + $scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[2] + " " + data.data)); + } + }); +} +uiFuncs.transferAllBalance = function($scope, $sce) { + try { + ajaxReq.getTransactionData($scope.wallet.getAddressString(), function(data) { + if (data.error) throw data.msg; + data = data.data; + var gasPrice = new BigNumber(ethFuncs.sanitizeHex(ethFuncs.addTinyMoreToGas(data.gasprice))).times($scope.tx.gasLimit); + var maxVal = new BigNumber(data.balance).minus(gasPrice); + $scope.tx.unit = "ether"; + $scope.tx.value = etherUnits.toEther(maxVal, 'wei'); + $scope.tx.value = $scope.tx.value < 0 ? 0 : $scope.tx.value; + }); + } catch (e) { + $scope.showRaw = false; + $scope.validateTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(e)); + } +} module.exports = uiFuncs; }).call(this,require("buffer").Buffer) -},{"buffer":83}],32:[function(require,module,exports){ +},{"buffer":84}],32:[function(require,module,exports){ /** * @license AngularJS v1.5.6 * (c) 2010-2016 Google, Inc. http://angularjs.org @@ -33565,7 +33507,7 @@ asn1.constants = require('./asn1/constants'); asn1.decoders = require('./asn1/decoders'); asn1.encoders = require('./asn1/encoders'); -},{"./asn1/api":35,"./asn1/base":37,"./asn1/constants":41,"./asn1/decoders":43,"./asn1/encoders":46,"bn.js":53}],35:[function(require,module,exports){ +},{"./asn1/api":35,"./asn1/base":37,"./asn1/constants":41,"./asn1/decoders":43,"./asn1/encoders":46,"bn.js":54}],35:[function(require,module,exports){ var asn1 = require('../asn1'); var inherits = require('inherits'); @@ -33628,7 +33570,7 @@ Entity.prototype.encode = function encode(data, enc, /* internal */ reporter) { return this._getEncoder(enc).encode(data, reporter); }; -},{"../asn1":34,"inherits":428,"vm":484}],36:[function(require,module,exports){ +},{"../asn1":34,"inherits":429,"vm":484}],36:[function(require,module,exports){ var inherits = require('inherits'); var Reporter = require('../base').Reporter; var Buffer = require('buffer').Buffer; @@ -33746,7 +33688,7 @@ EncoderBuffer.prototype.join = function join(out, offset) { return out; }; -},{"../base":37,"buffer":83,"inherits":428}],37:[function(require,module,exports){ +},{"../base":37,"buffer":84,"inherits":429}],37:[function(require,module,exports){ var base = exports; base.Reporter = require('./reporter').Reporter; @@ -34371,7 +34313,7 @@ Node.prototype._isPrintstr = function isPrintstr(str) { return /^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(str); }; -},{"../base":37,"minimalistic-assert":435}],39:[function(require,module,exports){ +},{"../base":37,"minimalistic-assert":436}],39:[function(require,module,exports){ var inherits = require('inherits'); function Reporter(options) { @@ -34475,7 +34417,7 @@ ReporterError.prototype.rethrow = function rethrow(msg) { return this; }; -},{"inherits":428}],40:[function(require,module,exports){ +},{"inherits":429}],40:[function(require,module,exports){ var constants = require('../constants'); exports.tagClass = { @@ -34863,7 +34805,7 @@ function derDecodeLen(buf, primitive, fail) { return len; } -},{"../../asn1":34,"inherits":428}],43:[function(require,module,exports){ +},{"../../asn1":34,"inherits":429}],43:[function(require,module,exports){ var decoders = exports; decoders.der = require('./der'); @@ -34920,7 +34862,7 @@ PEMDecoder.prototype.decode = function decode(data, options) { return DERDecoder.prototype.decode.call(this, input, options); }; -},{"./der":42,"buffer":83,"inherits":428}],45:[function(require,module,exports){ +},{"./der":42,"buffer":84,"inherits":429}],45:[function(require,module,exports){ var inherits = require('inherits'); var Buffer = require('buffer').Buffer; @@ -35215,7 +35157,7 @@ function encodeTag(tag, primitive, cls, reporter) { return res; } -},{"../../asn1":34,"buffer":83,"inherits":428}],46:[function(require,module,exports){ +},{"../../asn1":34,"buffer":84,"inherits":429}],46:[function(require,module,exports){ var encoders = exports; encoders.der = require('./der'); @@ -35244,7 +35186,7 @@ PEMEncoder.prototype.encode = function encode(data, options) { return out.join('\n'); }; -},{"./der":45,"inherits":428}],48:[function(require,module,exports){ +},{"./der":45,"inherits":429}],48:[function(require,module,exports){ // http://wiki.commonjs.org/wiki/Unit_Testing/1.0 // // THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8! @@ -35607,13 +35549,13 @@ var objectKeys = Object.keys || function (obj) { },{"util/":481}],49:[function(require,module,exports){ (function (global){ -"use strict"; +/*istanbul ignore next*/"use strict"; -require("core-js/shim"); +/*istanbul ignore next*/require("core-js/shim"); -require("regenerator-runtime/runtime"); +/*istanbul ignore next*/require("babel-regenerator-runtime"); -require("core-js/fn/regexp/escape"); +/*istanbul ignore next*/require("core-js/fn/regexp/escape"); /* eslint max-len: 0 */ @@ -35640,7 +35582,668 @@ define(String.prototype, "padRight", "".padEnd); [][key] && define(Array, key, Function.call.bind([][key])); }); }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"core-js/fn/regexp/escape":85,"core-js/shim":379,"regenerator-runtime/runtime":460}],50:[function(require,module,exports){ +},{"babel-regenerator-runtime":50,"core-js/fn/regexp/escape":86,"core-js/shim":380}],50:[function(require,module,exports){ +(function (process,global){ +/** + * Copyright (c) 2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * https://raw.github.com/facebook/regenerator/master/LICENSE file. An + * additional grant of patent rights can be found in the PATENTS file in + * the same directory. + */ + +!(function(global) { + "use strict"; + + var hasOwn = Object.prototype.hasOwnProperty; + var undefined; // More compressible than void 0. + var iteratorSymbol = + typeof Symbol === "function" && Symbol.iterator || "@@iterator"; + + var inModule = typeof module === "object"; + var runtime = global.regeneratorRuntime; + if (runtime) { + if (inModule) { + // If regeneratorRuntime is defined globally and we're in a module, + // make the exports object identical to regeneratorRuntime. + module.exports = runtime; + } + // Don't bother evaluating the rest of this file if the runtime was + // already defined globally. + return; + } + + // Define the runtime globally (as expected by generated code) as either + // module.exports (if we're in a module) or a new, empty object. + runtime = global.regeneratorRuntime = inModule ? module.exports : {}; + + function wrap(innerFn, outerFn, self, tryLocsList) { + // If outerFn provided, then outerFn.prototype instanceof Generator. + var generator = Object.create((outerFn || Generator).prototype); + var context = new Context(tryLocsList || []); + + // The ._invoke method unifies the implementations of the .next, + // .throw, and .return methods. + generator._invoke = makeInvokeMethod(innerFn, self, context); + + return generator; + } + runtime.wrap = wrap; + + // Try/catch helper to minimize deoptimizations. Returns a completion + // record like context.tryEntries[i].completion. This interface could + // have been (and was previously) designed to take a closure to be + // invoked without arguments, but in all the cases we care about we + // already have an existing method we want to call, so there's no need + // to create a new function object. We can even get away with assuming + // the method takes exactly one argument, since that happens to be true + // in every case, so we don't have to touch the arguments object. The + // only additional allocation required is the completion record, which + // has a stable shape and so hopefully should be cheap to allocate. + function tryCatch(fn, obj, arg) { + try { + return { type: "normal", arg: fn.call(obj, arg) }; + } catch (err) { + return { type: "throw", arg: err }; + } + } + + var GenStateSuspendedStart = "suspendedStart"; + var GenStateSuspendedYield = "suspendedYield"; + var GenStateExecuting = "executing"; + var GenStateCompleted = "completed"; + + // Returning this object from the innerFn has the same effect as + // breaking out of the dispatch switch statement. + var ContinueSentinel = {}; + + // Dummy constructor functions that we use as the .constructor and + // .constructor.prototype properties for functions that return Generator + // objects. For full spec compliance, you may wish to configure your + // minifier not to mangle the names of these two functions. + function Generator() {} + function GeneratorFunction() {} + function GeneratorFunctionPrototype() {} + + var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype; + GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; + GeneratorFunctionPrototype.constructor = GeneratorFunction; + GeneratorFunction.displayName = "GeneratorFunction"; + + // Helper for defining the .next, .throw, and .return methods of the + // Iterator interface in terms of a single ._invoke method. + function defineIteratorMethods(prototype) { + ["next", "throw", "return"].forEach(function(method) { + prototype[method] = function(arg) { + return this._invoke(method, arg); + }; + }); + } + + runtime.isGeneratorFunction = function(genFun) { + var ctor = typeof genFun === "function" && genFun.constructor; + return ctor + ? ctor === GeneratorFunction || + // For the native GeneratorFunction constructor, the best we can + // do is to check its .name property. + (ctor.displayName || ctor.name) === "GeneratorFunction" + : false; + }; + + runtime.mark = function(genFun) { + if (Object.setPrototypeOf) { + Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); + } else { + genFun.__proto__ = GeneratorFunctionPrototype; + } + genFun.prototype = Object.create(Gp); + return genFun; + }; + + // Within the body of any async function, `await x` is transformed to + // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test + // `value instanceof AwaitArgument` to determine if the yielded value is + // meant to be awaited. Some may consider the name of this method too + // cutesy, but they are curmudgeons. + runtime.awrap = function(arg) { + return new AwaitArgument(arg); + }; + + function AwaitArgument(arg) { + this.arg = arg; + } + + function AsyncIterator(generator) { + // This invoke function is written in a style that assumes some + // calling function (or Promise) will handle exceptions. + function invoke(method, arg) { + var result = generator[method](arg); + var value = result.value; + return value instanceof AwaitArgument + ? Promise.resolve(value.arg).then(invokeNext, invokeThrow) + : Promise.resolve(value).then(function(unwrapped) { + // When a yielded Promise is resolved, its final value becomes + // the .value of the Promise<{value,done}> result for the + // current iteration. If the Promise is rejected, however, the + // result for this iteration will be rejected with the same + // reason. Note that rejections of yielded Promises are not + // thrown back into the generator function, as is the case + // when an awaited Promise is rejected. This difference in + // behavior between yield and await is important, because it + // allows the consumer to decide what to do with the yielded + // rejection (swallow it and continue, manually .throw it back + // into the generator, abandon iteration, whatever). With + // await, by contrast, there is no opportunity to examine the + // rejection reason outside the generator function, so the + // only option is to throw it from the await expression, and + // let the generator function handle the exception. + result.value = unwrapped; + return result; + }); + } + + if (typeof process === "object" && process.domain) { + invoke = process.domain.bind(invoke); + } + + var invokeNext = invoke.bind(generator, "next"); + var invokeThrow = invoke.bind(generator, "throw"); + var invokeReturn = invoke.bind(generator, "return"); + var previousPromise; + + function enqueue(method, arg) { + function callInvokeWithMethodAndArg() { + return invoke(method, arg); + } + + return previousPromise = + // If enqueue has been called before, then we want to wait until + // all previous Promises have been resolved before calling invoke, + // so that results are always delivered in the correct order. If + // enqueue has not been called before, then it is important to + // call invoke immediately, without waiting on a callback to fire, + // so that the async generator function has the opportunity to do + // any necessary setup in a predictable way. This predictability + // is why the Promise constructor synchronously invokes its + // executor callback, and why async functions synchronously + // execute code before the first await. Since we implement simple + // async functions in terms of async generators, it is especially + // important to get this right, even though it requires care. + previousPromise ? previousPromise.then( + callInvokeWithMethodAndArg, + // Avoid propagating failures to Promises returned by later + // invocations of the iterator. + callInvokeWithMethodAndArg + ) : new Promise(function (resolve) { + resolve(callInvokeWithMethodAndArg()); + }); + } + + // Define the unified helper method that is used to implement .next, + // .throw, and .return (see defineIteratorMethods). + this._invoke = enqueue; + } + + defineIteratorMethods(AsyncIterator.prototype); + + // Note that simple async functions are implemented on top of + // AsyncIterator objects; they just return a Promise for the value of + // the final result produced by the iterator. + runtime.async = function(innerFn, outerFn, self, tryLocsList) { + var iter = new AsyncIterator( + wrap(innerFn, outerFn, self, tryLocsList) + ); + + return runtime.isGeneratorFunction(outerFn) + ? iter // If outerFn is a generator, return the full iterator. + : iter.next().then(function(result) { + return result.done ? result.value : iter.next(); + }); + }; + + function makeInvokeMethod(innerFn, self, context) { + var state = GenStateSuspendedStart; + + return function invoke(method, arg) { + if (state === GenStateExecuting) { + throw new Error("Generator is already running"); + } + + if (state === GenStateCompleted) { + if (method === "throw") { + throw arg; + } + + // Be forgiving, per 25.3.3.3.3 of the spec: + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume + return doneResult(); + } + + while (true) { + var delegate = context.delegate; + if (delegate) { + if (method === "return" || + (method === "throw" && delegate.iterator[method] === undefined)) { + // A return or throw (when the delegate iterator has no throw + // method) always terminates the yield* loop. + context.delegate = null; + + // If the delegate iterator has a return method, give it a + // chance to clean up. + var returnMethod = delegate.iterator["return"]; + if (returnMethod) { + var record = tryCatch(returnMethod, delegate.iterator, arg); + if (record.type === "throw") { + // If the return method threw an exception, let that + // exception prevail over the original return or throw. + method = "throw"; + arg = record.arg; + continue; + } + } + + if (method === "return") { + // Continue with the outer return, now that the delegate + // iterator has been terminated. + continue; + } + } + + var record = tryCatch( + delegate.iterator[method], + delegate.iterator, + arg + ); + + if (record.type === "throw") { + context.delegate = null; + + // Like returning generator.throw(uncaught), but without the + // overhead of an extra function call. + method = "throw"; + arg = record.arg; + continue; + } + + // Delegate generator ran and handled its own exceptions so + // regardless of what the method was, we continue as if it is + // "next" with an undefined arg. + method = "next"; + arg = undefined; + + var info = record.arg; + if (info.done) { + context[delegate.resultName] = info.value; + context.next = delegate.nextLoc; + } else { + state = GenStateSuspendedYield; + return info; + } + + context.delegate = null; + } + + if (method === "next") { + context._sent = arg; + + if (state === GenStateSuspendedYield) { + context.sent = arg; + } else { + context.sent = undefined; + } + } else if (method === "throw") { + if (state === GenStateSuspendedStart) { + state = GenStateCompleted; + throw arg; + } + + if (context.dispatchException(arg)) { + // If the dispatched exception was caught by a catch block, + // then let that catch block handle the exception normally. + method = "next"; + arg = undefined; + } + + } else if (method === "return") { + context.abrupt("return", arg); + } + + state = GenStateExecuting; + + var record = tryCatch(innerFn, self, context); + if (record.type === "normal") { + // If an exception is thrown from innerFn, we leave state === + // GenStateExecuting and loop back for another invocation. + state = context.done + ? GenStateCompleted + : GenStateSuspendedYield; + + var info = { + value: record.arg, + done: context.done + }; + + if (record.arg === ContinueSentinel) { + if (context.delegate && method === "next") { + // Deliberately forget the last sent value so that we don't + // accidentally pass it on to the delegate. + arg = undefined; + } + } else { + return info; + } + + } else if (record.type === "throw") { + state = GenStateCompleted; + // Dispatch the exception by looping back around to the + // context.dispatchException(arg) call above. + method = "throw"; + arg = record.arg; + } + } + }; + } + + // Define Generator.prototype.{next,throw,return} in terms of the + // unified ._invoke helper method. + defineIteratorMethods(Gp); + + Gp[iteratorSymbol] = function() { + return this; + }; + + Gp.toString = function() { + return "[object Generator]"; + }; + + function pushTryEntry(locs) { + var entry = { tryLoc: locs[0] }; + + if (1 in locs) { + entry.catchLoc = locs[1]; + } + + if (2 in locs) { + entry.finallyLoc = locs[2]; + entry.afterLoc = locs[3]; + } + + this.tryEntries.push(entry); + } + + function resetTryEntry(entry) { + var record = entry.completion || {}; + record.type = "normal"; + delete record.arg; + entry.completion = record; + } + + function Context(tryLocsList) { + // The root entry object (effectively a try statement without a catch + // or a finally block) gives us a place to store values thrown from + // locations where there is no enclosing try statement. + this.tryEntries = [{ tryLoc: "root" }]; + tryLocsList.forEach(pushTryEntry, this); + this.reset(true); + } + + runtime.keys = function(object) { + var keys = []; + for (var key in object) { + keys.push(key); + } + keys.reverse(); + + // Rather than returning an object with a next method, we keep + // things simple and return the next function itself. + return function next() { + while (keys.length) { + var key = keys.pop(); + if (key in object) { + next.value = key; + next.done = false; + return next; + } + } + + // To avoid creating an additional object, we just hang the .value + // and .done properties off the next function object itself. This + // also ensures that the minifier will not anonymize the function. + next.done = true; + return next; + }; + }; + + function values(iterable) { + if (iterable) { + var iteratorMethod = iterable[iteratorSymbol]; + if (iteratorMethod) { + return iteratorMethod.call(iterable); + } + + if (typeof iterable.next === "function") { + return iterable; + } + + if (!isNaN(iterable.length)) { + var i = -1, next = function next() { + while (++i < iterable.length) { + if (hasOwn.call(iterable, i)) { + next.value = iterable[i]; + next.done = false; + return next; + } + } + + next.value = undefined; + next.done = true; + + return next; + }; + + return next.next = next; + } + } + + // Return an iterator with no values. + return { next: doneResult }; + } + runtime.values = values; + + function doneResult() { + return { value: undefined, done: true }; + } + + Context.prototype = { + constructor: Context, + + reset: function(skipTempReset) { + this.prev = 0; + this.next = 0; + this.sent = undefined; + this.done = false; + this.delegate = null; + + this.tryEntries.forEach(resetTryEntry); + + if (!skipTempReset) { + for (var name in this) { + // Not sure about the optimal order of these conditions: + if (name.charAt(0) === "t" && + hasOwn.call(this, name) && + !isNaN(+name.slice(1))) { + this[name] = undefined; + } + } + } + }, + + stop: function() { + this.done = true; + + var rootEntry = this.tryEntries[0]; + var rootRecord = rootEntry.completion; + if (rootRecord.type === "throw") { + throw rootRecord.arg; + } + + return this.rval; + }, + + dispatchException: function(exception) { + if (this.done) { + throw exception; + } + + var context = this; + function handle(loc, caught) { + record.type = "throw"; + record.arg = exception; + context.next = loc; + return !!caught; + } + + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + var record = entry.completion; + + if (entry.tryLoc === "root") { + // Exception thrown outside of any try block that could handle + // it, so set the completion value of the entire function to + // throw the exception. + return handle("end"); + } + + if (entry.tryLoc <= this.prev) { + var hasCatch = hasOwn.call(entry, "catchLoc"); + var hasFinally = hasOwn.call(entry, "finallyLoc"); + + if (hasCatch && hasFinally) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } else if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + + } else if (hasCatch) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } + + } else if (hasFinally) { + if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + + } else { + throw new Error("try statement without catch or finally"); + } + } + } + }, + + abrupt: function(type, arg) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc <= this.prev && + hasOwn.call(entry, "finallyLoc") && + this.prev < entry.finallyLoc) { + var finallyEntry = entry; + break; + } + } + + if (finallyEntry && + (type === "break" || + type === "continue") && + finallyEntry.tryLoc <= arg && + arg <= finallyEntry.finallyLoc) { + // Ignore the finally entry if control is not jumping to a + // location outside the try/catch block. + finallyEntry = null; + } + + var record = finallyEntry ? finallyEntry.completion : {}; + record.type = type; + record.arg = arg; + + if (finallyEntry) { + this.next = finallyEntry.finallyLoc; + } else { + this.complete(record); + } + + return ContinueSentinel; + }, + + complete: function(record, afterLoc) { + if (record.type === "throw") { + throw record.arg; + } + + if (record.type === "break" || + record.type === "continue") { + this.next = record.arg; + } else if (record.type === "return") { + this.rval = record.arg; + this.next = "end"; + } else if (record.type === "normal" && afterLoc) { + this.next = afterLoc; + } + }, + + finish: function(finallyLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.finallyLoc === finallyLoc) { + this.complete(entry.completion, entry.afterLoc); + resetTryEntry(entry); + return ContinueSentinel; + } + } + }, + + "catch": function(tryLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc === tryLoc) { + var record = entry.completion; + if (record.type === "throw") { + var thrown = record.arg; + resetTryEntry(entry); + } + return thrown; + } + } + + // The context.catch method must only be called with a location + // argument that corresponds to a known catch block. + throw new Error("illegal catch attempt"); + }, + + delegateYield: function(iterable, resultName, nextLoc) { + this.delegate = { + iterator: values(iterable), + resultName: resultName, + nextLoc: nextLoc + }; + + return ContinueSentinel; + } + }; +})( + // Among the various tricks for obtaining a reference to the global + // object, this seems to be the most reliable technique that does not + // use indirect eval (which violates Content Security Policy). + typeof global === "object" ? global : + typeof window === "object" ? window : + typeof self === "object" ? self : this +); + +}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"_process":443}],51:[function(require,module,exports){ 'use strict' exports.toByteArray = toByteArray @@ -35751,7 +36354,7 @@ function fromByteArray (uint8) { return parts.join('') } -},{}],51:[function(require,module,exports){ +},{}],52:[function(require,module,exports){ /*! bignumber.js v2.3.0 https://github.com/MikeMcl/bignumber.js/LICENCE */ ;(function (globalObj) { @@ -38486,7 +39089,7 @@ function fromByteArray (uint8) { } })(this); -},{}],52:[function(require,module,exports){ +},{}],53:[function(require,module,exports){ (function (Buffer){ // Reference https://github.com/bitcoin/bips/blob/master/bip-0066.mediawiki // Format: 0x30 [total-length] 0x02 [R-length] [R] 0x02 [S-length] [S] @@ -38601,7 +39204,7 @@ module.exports = { } }).call(this,require("buffer").Buffer) -},{"buffer":83}],53:[function(require,module,exports){ +},{"buffer":84}],54:[function(require,module,exports){ (function (module, exports) { 'use strict'; @@ -42022,7 +42625,7 @@ module.exports = { }; })(typeof module === 'undefined' || module, this); -},{}],54:[function(require,module,exports){ +},{}],55:[function(require,module,exports){ var r; module.exports = function rand(len) { @@ -42081,9 +42684,9 @@ if (typeof window === 'object') { } } -},{}],55:[function(require,module,exports){ - },{}],56:[function(require,module,exports){ + +},{}],57:[function(require,module,exports){ (function (Buffer){ // based on the aes implimentation in triple sec // https://github.com/keybase/triplesec @@ -42264,7 +42867,7 @@ AES.prototype._doCryptBlock = function (M, keySchedule, SUB_MIX, SBOX) { exports.AES = AES }).call(this,require("buffer").Buffer) -},{"buffer":83}],57:[function(require,module,exports){ +},{"buffer":84}],58:[function(require,module,exports){ (function (Buffer){ var aes = require('./aes') var Transform = require('cipher-base') @@ -42365,7 +42968,7 @@ function xorTest (a, b) { } }).call(this,require("buffer").Buffer) -},{"./aes":56,"./ghash":61,"buffer":83,"buffer-xor":82,"cipher-base":84,"inherits":428}],58:[function(require,module,exports){ +},{"./aes":57,"./ghash":62,"buffer":84,"buffer-xor":83,"cipher-base":85,"inherits":429}],59:[function(require,module,exports){ var ciphers = require('./encrypter') exports.createCipher = exports.Cipher = ciphers.createCipher exports.createCipheriv = exports.Cipheriv = ciphers.createCipheriv @@ -42378,7 +42981,7 @@ function getCiphers () { } exports.listCiphers = exports.getCiphers = getCiphers -},{"./decrypter":59,"./encrypter":60,"./modes":62}],59:[function(require,module,exports){ +},{"./decrypter":60,"./encrypter":61,"./modes":63}],60:[function(require,module,exports){ (function (Buffer){ var aes = require('./aes') var Transform = require('cipher-base') @@ -42519,7 +43122,7 @@ exports.createDecipher = createDecipher exports.createDecipheriv = createDecipheriv }).call(this,require("buffer").Buffer) -},{"./aes":56,"./authCipher":57,"./modes":62,"./modes/cbc":63,"./modes/cfb":64,"./modes/cfb1":65,"./modes/cfb8":66,"./modes/ctr":67,"./modes/ecb":68,"./modes/ofb":69,"./streamCipher":70,"buffer":83,"cipher-base":84,"evp_bytestokey":419,"inherits":428}],60:[function(require,module,exports){ +},{"./aes":57,"./authCipher":58,"./modes":63,"./modes/cbc":64,"./modes/cfb":65,"./modes/cfb1":66,"./modes/cfb8":67,"./modes/ctr":68,"./modes/ecb":69,"./modes/ofb":70,"./streamCipher":71,"buffer":84,"cipher-base":85,"evp_bytestokey":420,"inherits":429}],61:[function(require,module,exports){ (function (Buffer){ var aes = require('./aes') var Transform = require('cipher-base') @@ -42645,7 +43248,7 @@ exports.createCipheriv = createCipheriv exports.createCipher = createCipher }).call(this,require("buffer").Buffer) -},{"./aes":56,"./authCipher":57,"./modes":62,"./modes/cbc":63,"./modes/cfb":64,"./modes/cfb1":65,"./modes/cfb8":66,"./modes/ctr":67,"./modes/ecb":68,"./modes/ofb":69,"./streamCipher":70,"buffer":83,"cipher-base":84,"evp_bytestokey":419,"inherits":428}],61:[function(require,module,exports){ +},{"./aes":57,"./authCipher":58,"./modes":63,"./modes/cbc":64,"./modes/cfb":65,"./modes/cfb1":66,"./modes/cfb8":67,"./modes/ctr":68,"./modes/ecb":69,"./modes/ofb":70,"./streamCipher":71,"buffer":84,"cipher-base":85,"evp_bytestokey":420,"inherits":429}],62:[function(require,module,exports){ (function (Buffer){ var zeros = new Buffer(16) zeros.fill(0) @@ -42747,7 +43350,7 @@ function xor (a, b) { } }).call(this,require("buffer").Buffer) -},{"buffer":83}],62:[function(require,module,exports){ +},{"buffer":84}],63:[function(require,module,exports){ exports['aes-128-ecb'] = { cipher: 'AES', key: 128, @@ -42920,7 +43523,7 @@ exports['aes-256-gcm'] = { type: 'auth' } -},{}],63:[function(require,module,exports){ +},{}],64:[function(require,module,exports){ var xor = require('buffer-xor') exports.encrypt = function (self, block) { @@ -42939,7 +43542,7 @@ exports.decrypt = function (self, block) { return xor(out, pad) } -},{"buffer-xor":82}],64:[function(require,module,exports){ +},{"buffer-xor":83}],65:[function(require,module,exports){ (function (Buffer){ var xor = require('buffer-xor') @@ -42974,7 +43577,7 @@ function encryptStart (self, data, decrypt) { } }).call(this,require("buffer").Buffer) -},{"buffer":83,"buffer-xor":82}],65:[function(require,module,exports){ +},{"buffer":84,"buffer-xor":83}],66:[function(require,module,exports){ (function (Buffer){ function encryptByte (self, byteParam, decrypt) { var pad @@ -43012,7 +43615,7 @@ function shiftIn (buffer, value) { } }).call(this,require("buffer").Buffer) -},{"buffer":83}],66:[function(require,module,exports){ +},{"buffer":84}],67:[function(require,module,exports){ (function (Buffer){ function encryptByte (self, byteParam, decrypt) { var pad = self._cipher.encryptBlock(self._prev) @@ -43031,7 +43634,7 @@ exports.encrypt = function (self, chunk, decrypt) { } }).call(this,require("buffer").Buffer) -},{"buffer":83}],67:[function(require,module,exports){ +},{"buffer":84}],68:[function(require,module,exports){ (function (Buffer){ var xor = require('buffer-xor') @@ -43066,7 +43669,7 @@ exports.encrypt = function (self, chunk) { } }).call(this,require("buffer").Buffer) -},{"buffer":83,"buffer-xor":82}],68:[function(require,module,exports){ +},{"buffer":84,"buffer-xor":83}],69:[function(require,module,exports){ exports.encrypt = function (self, block) { return self._cipher.encryptBlock(block) } @@ -43074,7 +43677,7 @@ exports.decrypt = function (self, block) { return self._cipher.decryptBlock(block) } -},{}],69:[function(require,module,exports){ +},{}],70:[function(require,module,exports){ (function (Buffer){ var xor = require('buffer-xor') @@ -43094,7 +43697,7 @@ exports.encrypt = function (self, chunk) { } }).call(this,require("buffer").Buffer) -},{"buffer":83,"buffer-xor":82}],70:[function(require,module,exports){ +},{"buffer":84,"buffer-xor":83}],71:[function(require,module,exports){ (function (Buffer){ var aes = require('./aes') var Transform = require('cipher-base') @@ -43123,7 +43726,7 @@ StreamCipher.prototype._final = function () { } }).call(this,require("buffer").Buffer) -},{"./aes":56,"buffer":83,"cipher-base":84,"inherits":428}],71:[function(require,module,exports){ +},{"./aes":57,"buffer":84,"cipher-base":85,"inherits":429}],72:[function(require,module,exports){ var ebtk = require('evp_bytestokey') var aes = require('browserify-aes/browser') var DES = require('browserify-des') @@ -43198,7 +43801,7 @@ function getCiphers () { } exports.listCiphers = exports.getCiphers = getCiphers -},{"browserify-aes/browser":58,"browserify-aes/modes":62,"browserify-des":72,"browserify-des/modes":73,"evp_bytestokey":419}],72:[function(require,module,exports){ +},{"browserify-aes/browser":59,"browserify-aes/modes":63,"browserify-des":73,"browserify-des/modes":74,"evp_bytestokey":420}],73:[function(require,module,exports){ (function (Buffer){ var CipherBase = require('cipher-base') var des = require('des.js') @@ -43245,7 +43848,7 @@ DES.prototype._final = function () { } }).call(this,require("buffer").Buffer) -},{"buffer":83,"cipher-base":84,"des.js":387,"inherits":428}],73:[function(require,module,exports){ +},{"buffer":84,"cipher-base":85,"des.js":388,"inherits":429}],74:[function(require,module,exports){ exports['des-ecb'] = { key: 8, iv: 0 @@ -43271,7 +43874,7 @@ exports['des-ede'] = { iv: 0 } -},{}],74:[function(require,module,exports){ +},{}],75:[function(require,module,exports){ (function (Buffer){ var bn = require('bn.js'); var randomBytes = require('randombytes'); @@ -43315,7 +43918,7 @@ function getr(priv) { } }).call(this,require("buffer").Buffer) -},{"bn.js":53,"buffer":83,"randombytes":449}],75:[function(require,module,exports){ +},{"bn.js":54,"buffer":84,"randombytes":450}],76:[function(require,module,exports){ (function (Buffer){ const Sha3 = require('js-sha3') @@ -43353,7 +43956,7 @@ module.exports = { } }).call(this,require("buffer").Buffer) -},{"buffer":83,"js-sha3":431}],76:[function(require,module,exports){ +},{"buffer":84,"js-sha3":432}],77:[function(require,module,exports){ (function (Buffer){ 'use strict' exports['RSA-SHA224'] = exports.sha224WithRSAEncryption = { @@ -43429,7 +44032,7 @@ exports['RSA-MD5'] = exports.md5WithRSAEncryption = { } }).call(this,require("buffer").Buffer) -},{"buffer":83}],77:[function(require,module,exports){ +},{"buffer":84}],78:[function(require,module,exports){ (function (Buffer){ var _algos = require('./algos') var createHash = require('create-hash') @@ -43536,7 +44139,7 @@ module.exports = { } }).call(this,require("buffer").Buffer) -},{"./algos":76,"./sign":79,"./verify":80,"buffer":83,"create-hash":382,"inherits":428,"stream":477}],78:[function(require,module,exports){ +},{"./algos":77,"./sign":80,"./verify":81,"buffer":84,"create-hash":383,"inherits":429,"stream":477}],79:[function(require,module,exports){ 'use strict' exports['1.3.132.0.10'] = 'secp256k1' @@ -43550,7 +44153,7 @@ exports['1.3.132.0.34'] = 'p384' exports['1.3.132.0.35'] = 'p521' -},{}],79:[function(require,module,exports){ +},{}],80:[function(require,module,exports){ (function (Buffer){ // much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js var createHmac = require('create-hmac') @@ -43739,7 +44342,7 @@ module.exports.getKey = getKey module.exports.makeKey = makeKey }).call(this,require("buffer").Buffer) -},{"./curves":78,"bn.js":53,"browserify-rsa":74,"buffer":83,"create-hmac":385,"elliptic":397,"parse-asn1":439}],80:[function(require,module,exports){ +},{"./curves":79,"bn.js":54,"browserify-rsa":75,"buffer":84,"create-hmac":386,"elliptic":398,"parse-asn1":440}],81:[function(require,module,exports){ (function (Buffer){ // much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js var curves = require('./curves') @@ -43846,7 +44449,7 @@ function checkValue (b, q) { module.exports = verify }).call(this,require("buffer").Buffer) -},{"./curves":78,"bn.js":53,"buffer":83,"elliptic":397,"parse-asn1":439}],81:[function(require,module,exports){ +},{"./curves":79,"bn.js":54,"buffer":84,"elliptic":398,"parse-asn1":440}],82:[function(require,module,exports){ (function (global){ 'use strict'; @@ -43958,7 +44561,7 @@ exports.allocUnsafeSlow = function allocUnsafeSlow(size) { } }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"buffer":83}],82:[function(require,module,exports){ +},{"buffer":84}],83:[function(require,module,exports){ (function (Buffer){ module.exports = function xor (a, b) { var length = Math.min(a.length, b.length) @@ -43972,7 +44575,7 @@ module.exports = function xor (a, b) { } }).call(this,require("buffer").Buffer) -},{"buffer":83}],83:[function(require,module,exports){ +},{"buffer":84}],84:[function(require,module,exports){ (function (global){ /*! * The buffer module from node.js, for the browser. @@ -45687,7 +46290,7 @@ function isnan (val) { } }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"base64-js":50,"ieee754":426,"isarray":430}],84:[function(require,module,exports){ +},{"base64-js":51,"ieee754":427,"isarray":431}],85:[function(require,module,exports){ (function (Buffer){ var Transform = require('stream').Transform var inherits = require('inherits') @@ -45781,21 +46384,21 @@ CipherBase.prototype._toString = function (value, enc, final) { } }).call(this,require("buffer").Buffer) -},{"buffer":83,"inherits":428,"stream":477,"string_decoder":478}],85:[function(require,module,exports){ +},{"buffer":84,"inherits":429,"stream":477,"string_decoder":478}],86:[function(require,module,exports){ require('../../modules/core.regexp.escape'); module.exports = require('../../modules/_core').RegExp.escape; -},{"../../modules/_core":106,"../../modules/core.regexp.escape":203}],86:[function(require,module,exports){ +},{"../../modules/_core":107,"../../modules/core.regexp.escape":204}],87:[function(require,module,exports){ module.exports = function(it){ if(typeof it != 'function')throw TypeError(it + ' is not a function!'); return it; }; -},{}],87:[function(require,module,exports){ +},{}],88:[function(require,module,exports){ var cof = require('./_cof'); module.exports = function(it, msg){ if(typeof it != 'number' && cof(it) != 'Number')throw TypeError(msg); return +it; }; -},{"./_cof":101}],88:[function(require,module,exports){ +},{"./_cof":102}],89:[function(require,module,exports){ // 22.1.3.31 Array.prototype[@@unscopables] var UNSCOPABLES = require('./_wks')('unscopables') , ArrayProto = Array.prototype; @@ -45803,19 +46406,19 @@ if(ArrayProto[UNSCOPABLES] == undefined)require('./_hide')(ArrayProto, UNSCOPABL module.exports = function(key){ ArrayProto[UNSCOPABLES][key] = true; }; -},{"./_hide":123,"./_wks":200}],89:[function(require,module,exports){ +},{"./_hide":124,"./_wks":201}],90:[function(require,module,exports){ module.exports = function(it, Constructor, name, forbiddenField){ if(!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)){ throw TypeError(name + ': incorrect invocation!'); } return it; }; -},{}],90:[function(require,module,exports){ +},{}],91:[function(require,module,exports){ var isObject = require('./_is-object'); module.exports = function(it){ if(!isObject(it))throw TypeError(it + ' is not an object!'); return it; }; -},{"./_is-object":132}],91:[function(require,module,exports){ +},{"./_is-object":133}],92:[function(require,module,exports){ // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) 'use strict'; var toObject = require('./_to-object') @@ -45842,7 +46445,7 @@ module.exports = [].copyWithin || function copyWithin(target/*= 0*/, start/*= 0, from += inc; } return O; }; -},{"./_to-index":188,"./_to-length":191,"./_to-object":192}],92:[function(require,module,exports){ +},{"./_to-index":189,"./_to-length":192,"./_to-object":193}],93:[function(require,module,exports){ // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) 'use strict'; var toObject = require('./_to-object') @@ -45858,7 +46461,7 @@ module.exports = function fill(value /*, start = 0, end = @length */){ while(endPos > index)O[index++] = value; return O; }; -},{"./_to-index":188,"./_to-length":191,"./_to-object":192}],93:[function(require,module,exports){ +},{"./_to-index":189,"./_to-length":192,"./_to-object":193}],94:[function(require,module,exports){ var forOf = require('./_for-of'); module.exports = function(iter, ITERATOR){ @@ -45867,7 +46470,7 @@ module.exports = function(iter, ITERATOR){ return result; }; -},{"./_for-of":120}],94:[function(require,module,exports){ +},{"./_for-of":121}],95:[function(require,module,exports){ // false -> Array#indexOf // true -> Array#includes var toIObject = require('./_to-iobject') @@ -45889,7 +46492,7 @@ module.exports = function(IS_INCLUDES){ } return !IS_INCLUDES && -1; }; }; -},{"./_to-index":188,"./_to-iobject":190,"./_to-length":191}],95:[function(require,module,exports){ +},{"./_to-index":189,"./_to-iobject":191,"./_to-length":192}],96:[function(require,module,exports){ // 0 -> Array#forEach // 1 -> Array#map // 2 -> Array#filter @@ -45934,7 +46537,7 @@ module.exports = function(TYPE, $create){ return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; }; }; -},{"./_array-species-create":98,"./_ctx":108,"./_iobject":128,"./_to-length":191,"./_to-object":192}],96:[function(require,module,exports){ +},{"./_array-species-create":99,"./_ctx":109,"./_iobject":129,"./_to-length":192,"./_to-object":193}],97:[function(require,module,exports){ var aFunction = require('./_a-function') , toObject = require('./_to-object') , IObject = require('./_iobject') @@ -45963,7 +46566,7 @@ module.exports = function(that, callbackfn, aLen, memo, isRight){ } return memo; }; -},{"./_a-function":86,"./_iobject":128,"./_to-length":191,"./_to-object":192}],97:[function(require,module,exports){ +},{"./_a-function":87,"./_iobject":129,"./_to-length":192,"./_to-object":193}],98:[function(require,module,exports){ var isObject = require('./_is-object') , isArray = require('./_is-array') , SPECIES = require('./_wks')('species'); @@ -45980,14 +46583,14 @@ module.exports = function(original){ } } return C === undefined ? Array : C; }; -},{"./_is-array":130,"./_is-object":132,"./_wks":200}],98:[function(require,module,exports){ +},{"./_is-array":131,"./_is-object":133,"./_wks":201}],99:[function(require,module,exports){ // 9.4.2.3 ArraySpeciesCreate(originalArray, length) var speciesConstructor = require('./_array-species-constructor'); module.exports = function(original, length){ return new (speciesConstructor(original))(length); }; -},{"./_array-species-constructor":97}],99:[function(require,module,exports){ +},{"./_array-species-constructor":98}],100:[function(require,module,exports){ 'use strict'; var aFunction = require('./_a-function') , isObject = require('./_is-object') @@ -46012,7 +46615,7 @@ module.exports = Function.bind || function bind(that /*, args... */){ if(isObject(fn.prototype))bound.prototype = fn.prototype; return bound; }; -},{"./_a-function":86,"./_invoke":127,"./_is-object":132}],100:[function(require,module,exports){ +},{"./_a-function":87,"./_invoke":128,"./_is-object":133}],101:[function(require,module,exports){ // getting tag from 19.1.3.6 Object.prototype.toString() var cof = require('./_cof') , TAG = require('./_wks')('toStringTag') @@ -46036,13 +46639,13 @@ module.exports = function(it){ // ES3 arguments fallback : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; }; -},{"./_cof":101,"./_wks":200}],101:[function(require,module,exports){ +},{"./_cof":102,"./_wks":201}],102:[function(require,module,exports){ var toString = {}.toString; module.exports = function(it){ return toString.call(it).slice(8, -1); }; -},{}],102:[function(require,module,exports){ +},{}],103:[function(require,module,exports){ 'use strict'; var dP = require('./_object-dp').f , create = require('./_object-create') @@ -46186,7 +46789,7 @@ module.exports = { setSpecies(NAME); } }; -},{"./_an-instance":89,"./_ctx":108,"./_defined":110,"./_descriptors":111,"./_for-of":120,"./_hide":123,"./_iter-define":136,"./_iter-step":138,"./_meta":145,"./_object-create":149,"./_object-dp":150,"./_redefine-all":169,"./_set-species":174}],103:[function(require,module,exports){ +},{"./_an-instance":90,"./_ctx":109,"./_defined":111,"./_descriptors":112,"./_for-of":121,"./_hide":124,"./_iter-define":137,"./_iter-step":139,"./_meta":146,"./_object-create":150,"./_object-dp":151,"./_redefine-all":170,"./_set-species":175}],104:[function(require,module,exports){ // https://github.com/DavidBruant/Map-Set.prototype.toJSON var classof = require('./_classof') , from = require('./_array-from-iterable'); @@ -46196,7 +46799,7 @@ module.exports = function(NAME){ return from(this); }; }; -},{"./_array-from-iterable":93,"./_classof":100}],104:[function(require,module,exports){ +},{"./_array-from-iterable":94,"./_classof":101}],105:[function(require,module,exports){ 'use strict'; var redefineAll = require('./_redefine-all') , getWeak = require('./_meta').getWeak @@ -46280,7 +46883,7 @@ module.exports = { }, ufstore: uncaughtFrozenStore }; -},{"./_an-instance":89,"./_an-object":90,"./_array-methods":95,"./_for-of":120,"./_has":122,"./_is-object":132,"./_meta":145,"./_redefine-all":169}],105:[function(require,module,exports){ +},{"./_an-instance":90,"./_an-object":91,"./_array-methods":96,"./_for-of":121,"./_has":123,"./_is-object":133,"./_meta":146,"./_redefine-all":170}],106:[function(require,module,exports){ 'use strict'; var global = require('./_global') , $export = require('./_export') @@ -46366,10 +46969,10 @@ module.exports = function(NAME, wrapper, methods, common, IS_MAP, IS_WEAK){ return C; }; -},{"./_an-instance":89,"./_export":115,"./_fails":117,"./_for-of":120,"./_global":121,"./_inherit-if-required":126,"./_is-object":132,"./_iter-detect":137,"./_meta":145,"./_redefine":170,"./_redefine-all":169,"./_set-to-string-tag":175}],106:[function(require,module,exports){ +},{"./_an-instance":90,"./_export":116,"./_fails":118,"./_for-of":121,"./_global":122,"./_inherit-if-required":127,"./_is-object":133,"./_iter-detect":138,"./_meta":146,"./_redefine":171,"./_redefine-all":170,"./_set-to-string-tag":176}],107:[function(require,module,exports){ var core = module.exports = {version: '2.4.0'}; if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef -},{}],107:[function(require,module,exports){ +},{}],108:[function(require,module,exports){ 'use strict'; var $defineProperty = require('./_object-dp') , createDesc = require('./_property-desc'); @@ -46378,7 +46981,7 @@ module.exports = function(object, index, value){ if(index in object)$defineProperty.f(object, index, createDesc(0, value)); else object[index] = value; }; -},{"./_object-dp":150,"./_property-desc":168}],108:[function(require,module,exports){ +},{"./_object-dp":151,"./_property-desc":169}],109:[function(require,module,exports){ // optional / simple context binding var aFunction = require('./_a-function'); module.exports = function(fn, that, length){ @@ -46399,7 +47002,7 @@ module.exports = function(fn, that, length){ return fn.apply(that, arguments); }; }; -},{"./_a-function":86}],109:[function(require,module,exports){ +},{"./_a-function":87}],110:[function(require,module,exports){ 'use strict'; var anObject = require('./_an-object') , toPrimitive = require('./_to-primitive') @@ -46409,18 +47012,18 @@ module.exports = function(hint){ if(hint !== 'string' && hint !== NUMBER && hint !== 'default')throw TypeError('Incorrect hint'); return toPrimitive(anObject(this), hint != NUMBER); }; -},{"./_an-object":90,"./_to-primitive":193}],110:[function(require,module,exports){ +},{"./_an-object":91,"./_to-primitive":194}],111:[function(require,module,exports){ // 7.2.1 RequireObjectCoercible(argument) module.exports = function(it){ if(it == undefined)throw TypeError("Can't call method on " + it); return it; }; -},{}],111:[function(require,module,exports){ +},{}],112:[function(require,module,exports){ // Thank's IE8 for his funny defineProperty module.exports = !require('./_fails')(function(){ return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7; }); -},{"./_fails":117}],112:[function(require,module,exports){ +},{"./_fails":118}],113:[function(require,module,exports){ var isObject = require('./_is-object') , document = require('./_global').document // in old IE typeof document.createElement is 'object' @@ -46428,12 +47031,12 @@ var isObject = require('./_is-object') module.exports = function(it){ return is ? document.createElement(it) : {}; }; -},{"./_global":121,"./_is-object":132}],113:[function(require,module,exports){ +},{"./_global":122,"./_is-object":133}],114:[function(require,module,exports){ // IE 8- don't enum bug keys module.exports = ( 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' ).split(','); -},{}],114:[function(require,module,exports){ +},{}],115:[function(require,module,exports){ // all enumerable object keys, includes symbols var getKeys = require('./_object-keys') , gOPS = require('./_object-gops') @@ -46449,7 +47052,7 @@ module.exports = function(it){ while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))result.push(key); } return result; }; -},{"./_object-gops":156,"./_object-keys":159,"./_object-pie":160}],115:[function(require,module,exports){ +},{"./_object-gops":157,"./_object-keys":160,"./_object-pie":161}],116:[function(require,module,exports){ var global = require('./_global') , core = require('./_core') , hide = require('./_hide') @@ -46493,7 +47096,7 @@ $export.W = 32; // wrap $export.U = 64; // safe $export.R = 128; // real proto method for `library` module.exports = $export; -},{"./_core":106,"./_ctx":108,"./_global":121,"./_hide":123,"./_redefine":170}],116:[function(require,module,exports){ +},{"./_core":107,"./_ctx":109,"./_global":122,"./_hide":124,"./_redefine":171}],117:[function(require,module,exports){ var MATCH = require('./_wks')('match'); module.exports = function(KEY){ var re = /./; @@ -46506,7 +47109,7 @@ module.exports = function(KEY){ } catch(f){ /* empty */ } } return true; }; -},{"./_wks":200}],117:[function(require,module,exports){ +},{"./_wks":201}],118:[function(require,module,exports){ module.exports = function(exec){ try { return !!exec(); @@ -46514,7 +47117,7 @@ module.exports = function(exec){ return true; } }; -},{}],118:[function(require,module,exports){ +},{}],119:[function(require,module,exports){ 'use strict'; var hide = require('./_hide') , redefine = require('./_redefine') @@ -46543,7 +47146,7 @@ module.exports = function(KEY, length, exec){ ); } }; -},{"./_defined":110,"./_fails":117,"./_hide":123,"./_redefine":170,"./_wks":200}],119:[function(require,module,exports){ +},{"./_defined":111,"./_fails":118,"./_hide":124,"./_redefine":171,"./_wks":201}],120:[function(require,module,exports){ 'use strict'; // 21.2.5.3 get RegExp.prototype.flags var anObject = require('./_an-object'); @@ -46557,7 +47160,7 @@ module.exports = function(){ if(that.sticky) result += 'y'; return result; }; -},{"./_an-object":90}],120:[function(require,module,exports){ +},{"./_an-object":91}],121:[function(require,module,exports){ var ctx = require('./_ctx') , call = require('./_iter-call') , isArrayIter = require('./_is-array-iter') @@ -46583,17 +47186,17 @@ var exports = module.exports = function(iterable, entries, fn, that, ITERATOR){ }; exports.BREAK = BREAK; exports.RETURN = RETURN; -},{"./_an-object":90,"./_ctx":108,"./_is-array-iter":129,"./_iter-call":134,"./_to-length":191,"./core.get-iterator-method":201}],121:[function(require,module,exports){ +},{"./_an-object":91,"./_ctx":109,"./_is-array-iter":130,"./_iter-call":135,"./_to-length":192,"./core.get-iterator-method":202}],122:[function(require,module,exports){ // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 var global = module.exports = typeof window != 'undefined' && window.Math == Math ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')(); if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef -},{}],122:[function(require,module,exports){ +},{}],123:[function(require,module,exports){ var hasOwnProperty = {}.hasOwnProperty; module.exports = function(it, key){ return hasOwnProperty.call(it, key); }; -},{}],123:[function(require,module,exports){ +},{}],124:[function(require,module,exports){ var dP = require('./_object-dp') , createDesc = require('./_property-desc'); module.exports = require('./_descriptors') ? function(object, key, value){ @@ -46602,13 +47205,13 @@ module.exports = require('./_descriptors') ? function(object, key, value){ object[key] = value; return object; }; -},{"./_descriptors":111,"./_object-dp":150,"./_property-desc":168}],124:[function(require,module,exports){ +},{"./_descriptors":112,"./_object-dp":151,"./_property-desc":169}],125:[function(require,module,exports){ module.exports = require('./_global').document && document.documentElement; -},{"./_global":121}],125:[function(require,module,exports){ +},{"./_global":122}],126:[function(require,module,exports){ module.exports = !require('./_descriptors') && !require('./_fails')(function(){ return Object.defineProperty(require('./_dom-create')('div'), 'a', {get: function(){ return 7; }}).a != 7; }); -},{"./_descriptors":111,"./_dom-create":112,"./_fails":117}],126:[function(require,module,exports){ +},{"./_descriptors":112,"./_dom-create":113,"./_fails":118}],127:[function(require,module,exports){ var isObject = require('./_is-object') , setPrototypeOf = require('./_set-proto').set; module.exports = function(that, target, C){ @@ -46617,7 +47220,7 @@ module.exports = function(that, target, C){ setPrototypeOf(that, P); } return that; }; -},{"./_is-object":132,"./_set-proto":173}],127:[function(require,module,exports){ +},{"./_is-object":133,"./_set-proto":174}],128:[function(require,module,exports){ // fast apply, http://jsperf.lnkit.com/fast-apply/5 module.exports = function(fn, args, that){ var un = that === undefined; @@ -46634,13 +47237,13 @@ module.exports = function(fn, args, that){ : fn.call(that, args[0], args[1], args[2], args[3]); } return fn.apply(that, args); }; -},{}],128:[function(require,module,exports){ +},{}],129:[function(require,module,exports){ // fallback for non-array-like ES3 and non-enumerable old V8 strings var cof = require('./_cof'); module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){ return cof(it) == 'String' ? it.split('') : Object(it); }; -},{"./_cof":101}],129:[function(require,module,exports){ +},{"./_cof":102}],130:[function(require,module,exports){ // check on default Array iterator var Iterators = require('./_iterators') , ITERATOR = require('./_wks')('iterator') @@ -46649,24 +47252,24 @@ var Iterators = require('./_iterators') module.exports = function(it){ return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); }; -},{"./_iterators":139,"./_wks":200}],130:[function(require,module,exports){ +},{"./_iterators":140,"./_wks":201}],131:[function(require,module,exports){ // 7.2.2 IsArray(argument) var cof = require('./_cof'); module.exports = Array.isArray || function isArray(arg){ return cof(arg) == 'Array'; }; -},{"./_cof":101}],131:[function(require,module,exports){ +},{"./_cof":102}],132:[function(require,module,exports){ // 20.1.2.3 Number.isInteger(number) var isObject = require('./_is-object') , floor = Math.floor; module.exports = function isInteger(it){ return !isObject(it) && isFinite(it) && floor(it) === it; }; -},{"./_is-object":132}],132:[function(require,module,exports){ +},{"./_is-object":133}],133:[function(require,module,exports){ module.exports = function(it){ return typeof it === 'object' ? it !== null : typeof it === 'function'; }; -},{}],133:[function(require,module,exports){ +},{}],134:[function(require,module,exports){ // 7.2.8 IsRegExp(argument) var isObject = require('./_is-object') , cof = require('./_cof') @@ -46675,7 +47278,7 @@ module.exports = function(it){ var isRegExp; return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp'); }; -},{"./_cof":101,"./_is-object":132,"./_wks":200}],134:[function(require,module,exports){ +},{"./_cof":102,"./_is-object":133,"./_wks":201}],135:[function(require,module,exports){ // call something on iterator step with safe closing on error var anObject = require('./_an-object'); module.exports = function(iterator, fn, value, entries){ @@ -46688,7 +47291,7 @@ module.exports = function(iterator, fn, value, entries){ throw e; } }; -},{"./_an-object":90}],135:[function(require,module,exports){ +},{"./_an-object":91}],136:[function(require,module,exports){ 'use strict'; var create = require('./_object-create') , descriptor = require('./_property-desc') @@ -46702,7 +47305,7 @@ module.exports = function(Constructor, NAME, next){ Constructor.prototype = create(IteratorPrototype, {next: descriptor(1, next)}); setToStringTag(Constructor, NAME + ' Iterator'); }; -},{"./_hide":123,"./_object-create":149,"./_property-desc":168,"./_set-to-string-tag":175,"./_wks":200}],136:[function(require,module,exports){ +},{"./_hide":124,"./_object-create":150,"./_property-desc":169,"./_set-to-string-tag":176,"./_wks":201}],137:[function(require,module,exports){ 'use strict'; var LIBRARY = require('./_library') , $export = require('./_export') @@ -46773,7 +47376,7 @@ module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED } return methods; }; -},{"./_export":115,"./_has":122,"./_hide":123,"./_iter-create":135,"./_iterators":139,"./_library":141,"./_object-gpo":157,"./_redefine":170,"./_set-to-string-tag":175,"./_wks":200}],137:[function(require,module,exports){ +},{"./_export":116,"./_has":123,"./_hide":124,"./_iter-create":136,"./_iterators":140,"./_library":142,"./_object-gpo":158,"./_redefine":171,"./_set-to-string-tag":176,"./_wks":201}],138:[function(require,module,exports){ var ITERATOR = require('./_wks')('iterator') , SAFE_CLOSING = false; @@ -46795,13 +47398,13 @@ module.exports = function(exec, skipClosing){ } catch(e){ /* empty */ } return safe; }; -},{"./_wks":200}],138:[function(require,module,exports){ +},{"./_wks":201}],139:[function(require,module,exports){ module.exports = function(done, value){ return {value: value, done: !!done}; }; -},{}],139:[function(require,module,exports){ -module.exports = {}; },{}],140:[function(require,module,exports){ +module.exports = {}; +},{}],141:[function(require,module,exports){ var getKeys = require('./_object-keys') , toIObject = require('./_to-iobject'); module.exports = function(object, el){ @@ -46812,9 +47415,9 @@ module.exports = function(object, el){ , key; while(length > index)if(O[key = keys[index++]] === el)return key; }; -},{"./_object-keys":159,"./_to-iobject":190}],141:[function(require,module,exports){ +},{"./_object-keys":160,"./_to-iobject":191}],142:[function(require,module,exports){ module.exports = false; -},{}],142:[function(require,module,exports){ +},{}],143:[function(require,module,exports){ // 20.2.2.14 Math.expm1(x) var $expm1 = Math.expm1; module.exports = (!$expm1 @@ -46825,17 +47428,17 @@ module.exports = (!$expm1 ) ? function expm1(x){ return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1; } : $expm1; -},{}],143:[function(require,module,exports){ +},{}],144:[function(require,module,exports){ // 20.2.2.20 Math.log1p(x) module.exports = Math.log1p || function log1p(x){ return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x); }; -},{}],144:[function(require,module,exports){ +},{}],145:[function(require,module,exports){ // 20.2.2.28 Math.sign(x) module.exports = Math.sign || function sign(x){ return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; }; -},{}],145:[function(require,module,exports){ +},{}],146:[function(require,module,exports){ var META = require('./_uid')('meta') , isObject = require('./_is-object') , has = require('./_has') @@ -46889,7 +47492,7 @@ var meta = module.exports = { getWeak: getWeak, onFreeze: onFreeze }; -},{"./_fails":117,"./_has":122,"./_is-object":132,"./_object-dp":150,"./_uid":197}],146:[function(require,module,exports){ +},{"./_fails":118,"./_has":123,"./_is-object":133,"./_object-dp":151,"./_uid":198}],147:[function(require,module,exports){ var Map = require('./es6.map') , $export = require('./_export') , shared = require('./_shared')('metadata') @@ -46941,7 +47544,7 @@ module.exports = { key: toMetaKey, exp: exp }; -},{"./_export":115,"./_shared":177,"./es6.map":233,"./es6.weak-map":339}],147:[function(require,module,exports){ +},{"./_export":116,"./_shared":178,"./es6.map":234,"./es6.weak-map":340}],148:[function(require,module,exports){ var global = require('./_global') , macrotask = require('./_task').set , Observer = global.MutationObserver || global.WebKitMutationObserver @@ -47010,7 +47613,7 @@ module.exports = function(){ } last = task; }; }; -},{"./_cof":101,"./_global":121,"./_task":187}],148:[function(require,module,exports){ +},{"./_cof":102,"./_global":122,"./_task":188}],149:[function(require,module,exports){ 'use strict'; // 19.1.2.1 Object.assign(target, source, ...) var getKeys = require('./_object-keys') @@ -47044,7 +47647,7 @@ module.exports = !$assign || require('./_fails')(function(){ while(length > j)if(isEnum.call(S, key = keys[j++]))T[key] = S[key]; } return T; } : $assign; -},{"./_fails":117,"./_iobject":128,"./_object-gops":156,"./_object-keys":159,"./_object-pie":160,"./_to-object":192}],149:[function(require,module,exports){ +},{"./_fails":118,"./_iobject":129,"./_object-gops":157,"./_object-keys":160,"./_object-pie":161,"./_to-object":193}],150:[function(require,module,exports){ // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) var anObject = require('./_an-object') , dPs = require('./_object-dps') @@ -47085,7 +47688,7 @@ module.exports = Object.create || function create(O, Properties){ } else result = createDict(); return Properties === undefined ? result : dPs(result, Properties); }; -},{"./_an-object":90,"./_dom-create":112,"./_enum-bug-keys":113,"./_html":124,"./_object-dps":151,"./_shared-key":176}],150:[function(require,module,exports){ +},{"./_an-object":91,"./_dom-create":113,"./_enum-bug-keys":114,"./_html":125,"./_object-dps":152,"./_shared-key":177}],151:[function(require,module,exports){ var anObject = require('./_an-object') , IE8_DOM_DEFINE = require('./_ie8-dom-define') , toPrimitive = require('./_to-primitive') @@ -47102,7 +47705,7 @@ exports.f = require('./_descriptors') ? Object.defineProperty : function defineP if('value' in Attributes)O[P] = Attributes.value; return O; }; -},{"./_an-object":90,"./_descriptors":111,"./_ie8-dom-define":125,"./_to-primitive":193}],151:[function(require,module,exports){ +},{"./_an-object":91,"./_descriptors":112,"./_ie8-dom-define":126,"./_to-primitive":194}],152:[function(require,module,exports){ var dP = require('./_object-dp') , anObject = require('./_an-object') , getKeys = require('./_object-keys'); @@ -47116,7 +47719,7 @@ module.exports = require('./_descriptors') ? Object.defineProperties : function while(length > i)dP.f(O, P = keys[i++], Properties[P]); return O; }; -},{"./_an-object":90,"./_descriptors":111,"./_object-dp":150,"./_object-keys":159}],152:[function(require,module,exports){ +},{"./_an-object":91,"./_descriptors":112,"./_object-dp":151,"./_object-keys":160}],153:[function(require,module,exports){ // Forced replacement prototype accessors methods module.exports = require('./_library')|| !require('./_fails')(function(){ var K = Math.random(); @@ -47124,7 +47727,7 @@ module.exports = require('./_library')|| !require('./_fails')(function(){ __defineSetter__.call(null, K, function(){ /* empty */}); delete require('./_global')[K]; }); -},{"./_fails":117,"./_global":121,"./_library":141}],153:[function(require,module,exports){ +},{"./_fails":118,"./_global":122,"./_library":142}],154:[function(require,module,exports){ var pIE = require('./_object-pie') , createDesc = require('./_property-desc') , toIObject = require('./_to-iobject') @@ -47141,7 +47744,7 @@ exports.f = require('./_descriptors') ? gOPD : function getOwnPropertyDescriptor } catch(e){ /* empty */ } if(has(O, P))return createDesc(!pIE.f.call(O, P), O[P]); }; -},{"./_descriptors":111,"./_has":122,"./_ie8-dom-define":125,"./_object-pie":160,"./_property-desc":168,"./_to-iobject":190,"./_to-primitive":193}],154:[function(require,module,exports){ +},{"./_descriptors":112,"./_has":123,"./_ie8-dom-define":126,"./_object-pie":161,"./_property-desc":169,"./_to-iobject":191,"./_to-primitive":194}],155:[function(require,module,exports){ // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window var toIObject = require('./_to-iobject') , gOPN = require('./_object-gopn').f @@ -47162,7 +47765,7 @@ module.exports.f = function getOwnPropertyNames(it){ return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it)); }; -},{"./_object-gopn":155,"./_to-iobject":190}],155:[function(require,module,exports){ +},{"./_object-gopn":156,"./_to-iobject":191}],156:[function(require,module,exports){ // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) var $keys = require('./_object-keys-internal') , hiddenKeys = require('./_enum-bug-keys').concat('length', 'prototype'); @@ -47170,9 +47773,9 @@ var $keys = require('./_object-keys-internal') exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O){ return $keys(O, hiddenKeys); }; -},{"./_enum-bug-keys":113,"./_object-keys-internal":158}],156:[function(require,module,exports){ +},{"./_enum-bug-keys":114,"./_object-keys-internal":159}],157:[function(require,module,exports){ exports.f = Object.getOwnPropertySymbols; -},{}],157:[function(require,module,exports){ +},{}],158:[function(require,module,exports){ // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) var has = require('./_has') , toObject = require('./_to-object') @@ -47186,7 +47789,7 @@ module.exports = Object.getPrototypeOf || function(O){ return O.constructor.prototype; } return O instanceof Object ? ObjectProto : null; }; -},{"./_has":122,"./_shared-key":176,"./_to-object":192}],158:[function(require,module,exports){ +},{"./_has":123,"./_shared-key":177,"./_to-object":193}],159:[function(require,module,exports){ var has = require('./_has') , toIObject = require('./_to-iobject') , arrayIndexOf = require('./_array-includes')(false) @@ -47204,7 +47807,7 @@ module.exports = function(object, names){ } return result; }; -},{"./_array-includes":94,"./_has":122,"./_shared-key":176,"./_to-iobject":190}],159:[function(require,module,exports){ +},{"./_array-includes":95,"./_has":123,"./_shared-key":177,"./_to-iobject":191}],160:[function(require,module,exports){ // 19.1.2.14 / 15.2.3.14 Object.keys(O) var $keys = require('./_object-keys-internal') , enumBugKeys = require('./_enum-bug-keys'); @@ -47212,9 +47815,9 @@ var $keys = require('./_object-keys-internal') module.exports = Object.keys || function keys(O){ return $keys(O, enumBugKeys); }; -},{"./_enum-bug-keys":113,"./_object-keys-internal":158}],160:[function(require,module,exports){ +},{"./_enum-bug-keys":114,"./_object-keys-internal":159}],161:[function(require,module,exports){ exports.f = {}.propertyIsEnumerable; -},{}],161:[function(require,module,exports){ +},{}],162:[function(require,module,exports){ // most Object methods by ES6 should accept primitives var $export = require('./_export') , core = require('./_core') @@ -47225,7 +47828,7 @@ module.exports = function(KEY, exec){ exp[KEY] = exec(fn); $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp); }; -},{"./_core":106,"./_export":115,"./_fails":117}],162:[function(require,module,exports){ +},{"./_core":107,"./_export":116,"./_fails":118}],163:[function(require,module,exports){ var getKeys = require('./_object-keys') , toIObject = require('./_to-iobject') , isEnum = require('./_object-pie').f; @@ -47242,7 +47845,7 @@ module.exports = function(isEntries){ } return result; }; }; -},{"./_object-keys":159,"./_object-pie":160,"./_to-iobject":190}],163:[function(require,module,exports){ +},{"./_object-keys":160,"./_object-pie":161,"./_to-iobject":191}],164:[function(require,module,exports){ // all object keys, includes non-enumerable and symbols var gOPN = require('./_object-gopn') , gOPS = require('./_object-gops') @@ -47253,7 +47856,7 @@ module.exports = Reflect && Reflect.ownKeys || function ownKeys(it){ , getSymbols = gOPS.f; return getSymbols ? keys.concat(getSymbols(it)) : keys; }; -},{"./_an-object":90,"./_global":121,"./_object-gopn":155,"./_object-gops":156}],164:[function(require,module,exports){ +},{"./_an-object":91,"./_global":122,"./_object-gopn":156,"./_object-gops":157}],165:[function(require,module,exports){ var $parseFloat = require('./_global').parseFloat , $trim = require('./_string-trim').trim; @@ -47262,7 +47865,7 @@ module.exports = 1 / $parseFloat(require('./_string-ws') + '-0') !== -Infinity ? , result = $parseFloat(string); return result === 0 && string.charAt(0) == '-' ? -0 : result; } : $parseFloat; -},{"./_global":121,"./_string-trim":185,"./_string-ws":186}],165:[function(require,module,exports){ +},{"./_global":122,"./_string-trim":186,"./_string-ws":187}],166:[function(require,module,exports){ var $parseInt = require('./_global').parseInt , $trim = require('./_string-trim').trim , ws = require('./_string-ws') @@ -47272,7 +47875,7 @@ module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? f var string = $trim(String(str), 3); return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10)); } : $parseInt; -},{"./_global":121,"./_string-trim":185,"./_string-ws":186}],166:[function(require,module,exports){ +},{"./_global":122,"./_string-trim":186,"./_string-ws":187}],167:[function(require,module,exports){ 'use strict'; var path = require('./_path') , invoke = require('./_invoke') @@ -47296,9 +47899,9 @@ module.exports = function(/* ...pargs */){ return invoke(fn, args, that); }; }; -},{"./_a-function":86,"./_invoke":127,"./_path":167}],167:[function(require,module,exports){ +},{"./_a-function":87,"./_invoke":128,"./_path":168}],168:[function(require,module,exports){ module.exports = require('./_global'); -},{"./_global":121}],168:[function(require,module,exports){ +},{"./_global":122}],169:[function(require,module,exports){ module.exports = function(bitmap, value){ return { enumerable : !(bitmap & 1), @@ -47307,13 +47910,13 @@ module.exports = function(bitmap, value){ value : value }; }; -},{}],169:[function(require,module,exports){ +},{}],170:[function(require,module,exports){ var redefine = require('./_redefine'); module.exports = function(target, src, safe){ for(var key in src)redefine(target, key, src[key], safe); return target; }; -},{"./_redefine":170}],170:[function(require,module,exports){ +},{"./_redefine":171}],171:[function(require,module,exports){ var global = require('./_global') , hide = require('./_hide') , has = require('./_has') @@ -47346,7 +47949,7 @@ require('./_core').inspectSource = function(it){ })(Function.prototype, TO_STRING, function toString(){ return typeof this == 'function' && this[SRC] || $toString.call(this); }); -},{"./_core":106,"./_global":121,"./_has":122,"./_hide":123,"./_uid":197}],171:[function(require,module,exports){ +},{"./_core":107,"./_global":122,"./_has":123,"./_hide":124,"./_uid":198}],172:[function(require,module,exports){ module.exports = function(regExp, replace){ var replacer = replace === Object(replace) ? function(part){ return replace[part]; @@ -47355,12 +47958,12 @@ module.exports = function(regExp, replace){ return String(it).replace(regExp, replacer); }; }; -},{}],172:[function(require,module,exports){ +},{}],173:[function(require,module,exports){ // 7.2.9 SameValue(x, y) module.exports = Object.is || function is(x, y){ return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; }; -},{}],173:[function(require,module,exports){ +},{}],174:[function(require,module,exports){ // Works with __proto__ only. Old v8 can't work with null proto objects. /* eslint-disable no-proto */ var isObject = require('./_is-object') @@ -47386,7 +47989,7 @@ module.exports = { }({}, false) : undefined), check: check }; -},{"./_an-object":90,"./_ctx":108,"./_is-object":132,"./_object-gopd":153}],174:[function(require,module,exports){ +},{"./_an-object":91,"./_ctx":109,"./_is-object":133,"./_object-gopd":154}],175:[function(require,module,exports){ 'use strict'; var global = require('./_global') , dP = require('./_object-dp') @@ -47400,7 +48003,7 @@ module.exports = function(KEY){ get: function(){ return this; } }); }; -},{"./_descriptors":111,"./_global":121,"./_object-dp":150,"./_wks":200}],175:[function(require,module,exports){ +},{"./_descriptors":112,"./_global":122,"./_object-dp":151,"./_wks":201}],176:[function(require,module,exports){ var def = require('./_object-dp').f , has = require('./_has') , TAG = require('./_wks')('toStringTag'); @@ -47408,20 +48011,20 @@ var def = require('./_object-dp').f module.exports = function(it, tag, stat){ if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag}); }; -},{"./_has":122,"./_object-dp":150,"./_wks":200}],176:[function(require,module,exports){ +},{"./_has":123,"./_object-dp":151,"./_wks":201}],177:[function(require,module,exports){ var shared = require('./_shared')('keys') , uid = require('./_uid'); module.exports = function(key){ return shared[key] || (shared[key] = uid(key)); }; -},{"./_shared":177,"./_uid":197}],177:[function(require,module,exports){ +},{"./_shared":178,"./_uid":198}],178:[function(require,module,exports){ var global = require('./_global') , SHARED = '__core-js_shared__' , store = global[SHARED] || (global[SHARED] = {}); module.exports = function(key){ return store[key] || (store[key] = {}); }; -},{"./_global":121}],178:[function(require,module,exports){ +},{"./_global":122}],179:[function(require,module,exports){ // 7.3.20 SpeciesConstructor(O, defaultConstructor) var anObject = require('./_an-object') , aFunction = require('./_a-function') @@ -47430,7 +48033,7 @@ module.exports = function(O, D){ var C = anObject(O).constructor, S; return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); }; -},{"./_a-function":86,"./_an-object":90,"./_wks":200}],179:[function(require,module,exports){ +},{"./_a-function":87,"./_an-object":91,"./_wks":201}],180:[function(require,module,exports){ var fails = require('./_fails'); module.exports = function(method, arg){ @@ -47438,7 +48041,7 @@ module.exports = function(method, arg){ arg ? method.call(null, function(){}, 1) : method.call(null); }); }; -},{"./_fails":117}],180:[function(require,module,exports){ +},{"./_fails":118}],181:[function(require,module,exports){ var toInteger = require('./_to-integer') , defined = require('./_defined'); // true -> String#at @@ -47456,7 +48059,7 @@ module.exports = function(TO_STRING){ : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; }; }; -},{"./_defined":110,"./_to-integer":189}],181:[function(require,module,exports){ +},{"./_defined":111,"./_to-integer":190}],182:[function(require,module,exports){ // helper for String#{startsWith, endsWith, includes} var isRegExp = require('./_is-regexp') , defined = require('./_defined'); @@ -47465,7 +48068,7 @@ module.exports = function(that, searchString, NAME){ if(isRegExp(searchString))throw TypeError('String#' + NAME + " doesn't accept regex!"); return String(defined(that)); }; -},{"./_defined":110,"./_is-regexp":133}],182:[function(require,module,exports){ +},{"./_defined":111,"./_is-regexp":134}],183:[function(require,module,exports){ var $export = require('./_export') , fails = require('./_fails') , defined = require('./_defined') @@ -47485,7 +48088,7 @@ module.exports = function(NAME, exec){ return test !== test.toLowerCase() || test.split('"').length > 3; }), 'String', O); }; -},{"./_defined":110,"./_export":115,"./_fails":117}],183:[function(require,module,exports){ +},{"./_defined":111,"./_export":116,"./_fails":118}],184:[function(require,module,exports){ // https://github.com/tc39/proposal-string-pad-start-end var toLength = require('./_to-length') , repeat = require('./_string-repeat') @@ -47503,7 +48106,7 @@ module.exports = function(that, maxLength, fillString, left){ return left ? stringFiller + S : S + stringFiller; }; -},{"./_defined":110,"./_string-repeat":184,"./_to-length":191}],184:[function(require,module,exports){ +},{"./_defined":111,"./_string-repeat":185,"./_to-length":192}],185:[function(require,module,exports){ 'use strict'; var toInteger = require('./_to-integer') , defined = require('./_defined'); @@ -47516,7 +48119,7 @@ module.exports = function repeat(count){ for(;n > 0; (n >>>= 1) && (str += str))if(n & 1)res += str; return res; }; -},{"./_defined":110,"./_to-integer":189}],185:[function(require,module,exports){ +},{"./_defined":111,"./_to-integer":190}],186:[function(require,module,exports){ var $export = require('./_export') , defined = require('./_defined') , fails = require('./_fails') @@ -47547,10 +48150,10 @@ var trim = exporter.trim = function(string, TYPE){ }; module.exports = exporter; -},{"./_defined":110,"./_export":115,"./_fails":117,"./_string-ws":186}],186:[function(require,module,exports){ +},{"./_defined":111,"./_export":116,"./_fails":118,"./_string-ws":187}],187:[function(require,module,exports){ module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; -},{}],187:[function(require,module,exports){ +},{}],188:[function(require,module,exports){ var ctx = require('./_ctx') , invoke = require('./_invoke') , html = require('./_html') @@ -47626,7 +48229,7 @@ module.exports = { set: setTask, clear: clearTask }; -},{"./_cof":101,"./_ctx":108,"./_dom-create":112,"./_global":121,"./_html":124,"./_invoke":127}],188:[function(require,module,exports){ +},{"./_cof":102,"./_ctx":109,"./_dom-create":113,"./_global":122,"./_html":125,"./_invoke":128}],189:[function(require,module,exports){ var toInteger = require('./_to-integer') , max = Math.max , min = Math.min; @@ -47634,34 +48237,34 @@ module.exports = function(index, length){ index = toInteger(index); return index < 0 ? max(index + length, 0) : min(index, length); }; -},{"./_to-integer":189}],189:[function(require,module,exports){ +},{"./_to-integer":190}],190:[function(require,module,exports){ // 7.1.4 ToInteger var ceil = Math.ceil , floor = Math.floor; module.exports = function(it){ return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); }; -},{}],190:[function(require,module,exports){ +},{}],191:[function(require,module,exports){ // to indexed object, toObject with fallback for non-array-like ES3 strings var IObject = require('./_iobject') , defined = require('./_defined'); module.exports = function(it){ return IObject(defined(it)); }; -},{"./_defined":110,"./_iobject":128}],191:[function(require,module,exports){ +},{"./_defined":111,"./_iobject":129}],192:[function(require,module,exports){ // 7.1.15 ToLength var toInteger = require('./_to-integer') , min = Math.min; module.exports = function(it){ return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 }; -},{"./_to-integer":189}],192:[function(require,module,exports){ +},{"./_to-integer":190}],193:[function(require,module,exports){ // 7.1.13 ToObject(argument) var defined = require('./_defined'); module.exports = function(it){ return Object(defined(it)); }; -},{"./_defined":110}],193:[function(require,module,exports){ +},{"./_defined":111}],194:[function(require,module,exports){ // 7.1.1 ToPrimitive(input [, PreferredType]) var isObject = require('./_is-object'); // instead of the ES6 spec version, we didn't implement @@toPrimitive case @@ -47674,7 +48277,7 @@ module.exports = function(it, S){ if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; throw TypeError("Can't convert object to primitive value"); }; -},{"./_is-object":132}],194:[function(require,module,exports){ +},{"./_is-object":133}],195:[function(require,module,exports){ 'use strict'; if(require('./_descriptors')){ var LIBRARY = require('./_library') @@ -48156,7 +48759,7 @@ if(require('./_descriptors')){ if(!LIBRARY && !CORRECT_ITER_NAME)hide(TypedArrayPrototype, ITERATOR, $iterator); }; } else module.exports = function(){ /* empty */ }; -},{"./_an-instance":89,"./_array-copy-within":91,"./_array-fill":92,"./_array-includes":94,"./_array-methods":95,"./_classof":100,"./_ctx":108,"./_descriptors":111,"./_export":115,"./_fails":117,"./_global":121,"./_has":122,"./_hide":123,"./_is-array-iter":129,"./_is-integer":131,"./_is-object":132,"./_iter-detect":137,"./_iterators":139,"./_library":141,"./_object-create":149,"./_object-dp":150,"./_object-gopd":153,"./_object-gopn":155,"./_object-gpo":157,"./_property-desc":168,"./_redefine-all":169,"./_same-value":172,"./_set-species":174,"./_species-constructor":178,"./_to-index":188,"./_to-integer":189,"./_to-length":191,"./_to-object":192,"./_to-primitive":193,"./_typed":196,"./_typed-buffer":195,"./_uid":197,"./_wks":200,"./core.get-iterator-method":201,"./core.is-iterable":202,"./es6.array.iterator":214}],195:[function(require,module,exports){ +},{"./_an-instance":90,"./_array-copy-within":92,"./_array-fill":93,"./_array-includes":95,"./_array-methods":96,"./_classof":101,"./_ctx":109,"./_descriptors":112,"./_export":116,"./_fails":118,"./_global":122,"./_has":123,"./_hide":124,"./_is-array-iter":130,"./_is-integer":132,"./_is-object":133,"./_iter-detect":138,"./_iterators":140,"./_library":142,"./_object-create":150,"./_object-dp":151,"./_object-gopd":154,"./_object-gopn":156,"./_object-gpo":158,"./_property-desc":169,"./_redefine-all":170,"./_same-value":173,"./_set-species":175,"./_species-constructor":179,"./_to-index":189,"./_to-integer":190,"./_to-length":192,"./_to-object":193,"./_to-primitive":194,"./_typed":197,"./_typed-buffer":196,"./_uid":198,"./_wks":201,"./core.get-iterator-method":202,"./core.is-iterable":203,"./es6.array.iterator":215}],196:[function(require,module,exports){ 'use strict'; var global = require('./_global') , DESCRIPTORS = require('./_descriptors') @@ -48432,7 +49035,7 @@ setToStringTag($DataView, DATA_VIEW); hide($DataView[PROTOTYPE], $typed.VIEW, true); exports[ARRAY_BUFFER] = $ArrayBuffer; exports[DATA_VIEW] = $DataView; -},{"./_an-instance":89,"./_array-fill":92,"./_descriptors":111,"./_fails":117,"./_global":121,"./_hide":123,"./_library":141,"./_object-dp":150,"./_object-gopn":155,"./_redefine-all":169,"./_set-to-string-tag":175,"./_to-integer":189,"./_to-length":191,"./_typed":196}],196:[function(require,module,exports){ +},{"./_an-instance":90,"./_array-fill":93,"./_descriptors":112,"./_fails":118,"./_global":122,"./_hide":124,"./_library":142,"./_object-dp":151,"./_object-gopn":156,"./_redefine-all":170,"./_set-to-string-tag":176,"./_to-integer":190,"./_to-length":192,"./_typed":197}],197:[function(require,module,exports){ var global = require('./_global') , hide = require('./_hide') , uid = require('./_uid') @@ -48459,13 +49062,13 @@ module.exports = { TYPED: TYPED, VIEW: VIEW }; -},{"./_global":121,"./_hide":123,"./_uid":197}],197:[function(require,module,exports){ +},{"./_global":122,"./_hide":124,"./_uid":198}],198:[function(require,module,exports){ var id = 0 , px = Math.random(); module.exports = function(key){ return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); }; -},{}],198:[function(require,module,exports){ +},{}],199:[function(require,module,exports){ var global = require('./_global') , core = require('./_core') , LIBRARY = require('./_library') @@ -48475,9 +49078,9 @@ module.exports = function(name){ var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); if(name.charAt(0) != '_' && !(name in $Symbol))defineProperty($Symbol, name, {value: wksExt.f(name)}); }; -},{"./_core":106,"./_global":121,"./_library":141,"./_object-dp":150,"./_wks-ext":199}],199:[function(require,module,exports){ +},{"./_core":107,"./_global":122,"./_library":142,"./_object-dp":151,"./_wks-ext":200}],200:[function(require,module,exports){ exports.f = require('./_wks'); -},{"./_wks":200}],200:[function(require,module,exports){ +},{"./_wks":201}],201:[function(require,module,exports){ var store = require('./_shared')('wks') , uid = require('./_uid') , Symbol = require('./_global').Symbol @@ -48489,7 +49092,7 @@ var $exports = module.exports = function(name){ }; $exports.store = store; -},{"./_global":121,"./_shared":177,"./_uid":197}],201:[function(require,module,exports){ +},{"./_global":122,"./_shared":178,"./_uid":198}],202:[function(require,module,exports){ var classof = require('./_classof') , ITERATOR = require('./_wks')('iterator') , Iterators = require('./_iterators'); @@ -48498,7 +49101,7 @@ module.exports = require('./_core').getIteratorMethod = function(it){ || it['@@iterator'] || Iterators[classof(it)]; }; -},{"./_classof":100,"./_core":106,"./_iterators":139,"./_wks":200}],202:[function(require,module,exports){ +},{"./_classof":101,"./_core":107,"./_iterators":140,"./_wks":201}],203:[function(require,module,exports){ var classof = require('./_classof') , ITERATOR = require('./_wks')('iterator') , Iterators = require('./_iterators'); @@ -48508,21 +49111,21 @@ module.exports = require('./_core').isIterable = function(it){ || '@@iterator' in O || Iterators.hasOwnProperty(classof(O)); }; -},{"./_classof":100,"./_core":106,"./_iterators":139,"./_wks":200}],203:[function(require,module,exports){ +},{"./_classof":101,"./_core":107,"./_iterators":140,"./_wks":201}],204:[function(require,module,exports){ // https://github.com/benjamingr/RexExp.escape var $export = require('./_export') , $re = require('./_replacer')(/[\\^$*+?.()|[\]{}]/g, '\\$&'); $export($export.S, 'RegExp', {escape: function escape(it){ return $re(it); }}); -},{"./_export":115,"./_replacer":171}],204:[function(require,module,exports){ +},{"./_export":116,"./_replacer":172}],205:[function(require,module,exports){ // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) var $export = require('./_export'); $export($export.P, 'Array', {copyWithin: require('./_array-copy-within')}); require('./_add-to-unscopables')('copyWithin'); -},{"./_add-to-unscopables":88,"./_array-copy-within":91,"./_export":115}],205:[function(require,module,exports){ +},{"./_add-to-unscopables":89,"./_array-copy-within":92,"./_export":116}],206:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $every = require('./_array-methods')(4); @@ -48533,14 +49136,14 @@ $export($export.P + $export.F * !require('./_strict-method')([].every, true), 'A return $every(this, callbackfn, arguments[1]); } }); -},{"./_array-methods":95,"./_export":115,"./_strict-method":179}],206:[function(require,module,exports){ +},{"./_array-methods":96,"./_export":116,"./_strict-method":180}],207:[function(require,module,exports){ // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) var $export = require('./_export'); $export($export.P, 'Array', {fill: require('./_array-fill')}); require('./_add-to-unscopables')('fill'); -},{"./_add-to-unscopables":88,"./_array-fill":92,"./_export":115}],207:[function(require,module,exports){ +},{"./_add-to-unscopables":89,"./_array-fill":93,"./_export":116}],208:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $filter = require('./_array-methods')(2); @@ -48551,7 +49154,7 @@ $export($export.P + $export.F * !require('./_strict-method')([].filter, true), ' return $filter(this, callbackfn, arguments[1]); } }); -},{"./_array-methods":95,"./_export":115,"./_strict-method":179}],208:[function(require,module,exports){ +},{"./_array-methods":96,"./_export":116,"./_strict-method":180}],209:[function(require,module,exports){ 'use strict'; // 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined) var $export = require('./_export') @@ -48566,7 +49169,7 @@ $export($export.P + $export.F * forced, 'Array', { } }); require('./_add-to-unscopables')(KEY); -},{"./_add-to-unscopables":88,"./_array-methods":95,"./_export":115}],209:[function(require,module,exports){ +},{"./_add-to-unscopables":89,"./_array-methods":96,"./_export":116}],210:[function(require,module,exports){ 'use strict'; // 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined) var $export = require('./_export') @@ -48581,7 +49184,7 @@ $export($export.P + $export.F * forced, 'Array', { } }); require('./_add-to-unscopables')(KEY); -},{"./_add-to-unscopables":88,"./_array-methods":95,"./_export":115}],210:[function(require,module,exports){ +},{"./_add-to-unscopables":89,"./_array-methods":96,"./_export":116}],211:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $forEach = require('./_array-methods')(0) @@ -48593,7 +49196,7 @@ $export($export.P + $export.F * !STRICT, 'Array', { return $forEach(this, callbackfn, arguments[1]); } }); -},{"./_array-methods":95,"./_export":115,"./_strict-method":179}],211:[function(require,module,exports){ +},{"./_array-methods":96,"./_export":116,"./_strict-method":180}],212:[function(require,module,exports){ 'use strict'; var ctx = require('./_ctx') , $export = require('./_export') @@ -48632,7 +49235,7 @@ $export($export.S + $export.F * !require('./_iter-detect')(function(iter){ Array } }); -},{"./_create-property":107,"./_ctx":108,"./_export":115,"./_is-array-iter":129,"./_iter-call":134,"./_iter-detect":137,"./_to-length":191,"./_to-object":192,"./core.get-iterator-method":201}],212:[function(require,module,exports){ +},{"./_create-property":108,"./_ctx":109,"./_export":116,"./_is-array-iter":130,"./_iter-call":135,"./_iter-detect":138,"./_to-length":192,"./_to-object":193,"./core.get-iterator-method":202}],213:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $indexOf = require('./_array-includes')(false) @@ -48648,12 +49251,12 @@ $export($export.P + $export.F * (NEGATIVE_ZERO || !require('./_strict-method')($ : $indexOf(this, searchElement, arguments[1]); } }); -},{"./_array-includes":94,"./_export":115,"./_strict-method":179}],213:[function(require,module,exports){ +},{"./_array-includes":95,"./_export":116,"./_strict-method":180}],214:[function(require,module,exports){ // 22.1.2.2 / 15.4.3.2 Array.isArray(arg) var $export = require('./_export'); $export($export.S, 'Array', {isArray: require('./_is-array')}); -},{"./_export":115,"./_is-array":130}],214:[function(require,module,exports){ +},{"./_export":116,"./_is-array":131}],215:[function(require,module,exports){ 'use strict'; var addToUnscopables = require('./_add-to-unscopables') , step = require('./_iter-step') @@ -48688,7 +49291,7 @@ Iterators.Arguments = Iterators.Array; addToUnscopables('keys'); addToUnscopables('values'); addToUnscopables('entries'); -},{"./_add-to-unscopables":88,"./_iter-define":136,"./_iter-step":138,"./_iterators":139,"./_to-iobject":190}],215:[function(require,module,exports){ +},{"./_add-to-unscopables":89,"./_iter-define":137,"./_iter-step":139,"./_iterators":140,"./_to-iobject":191}],216:[function(require,module,exports){ 'use strict'; // 22.1.3.13 Array.prototype.join(separator) var $export = require('./_export') @@ -48701,7 +49304,7 @@ $export($export.P + $export.F * (require('./_iobject') != Object || !require('./ return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator); } }); -},{"./_export":115,"./_iobject":128,"./_strict-method":179,"./_to-iobject":190}],216:[function(require,module,exports){ +},{"./_export":116,"./_iobject":129,"./_strict-method":180,"./_to-iobject":191}],217:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , toIObject = require('./_to-iobject') @@ -48724,7 +49327,7 @@ $export($export.P + $export.F * (NEGATIVE_ZERO || !require('./_strict-method')($ return -1; } }); -},{"./_export":115,"./_strict-method":179,"./_to-integer":189,"./_to-iobject":190,"./_to-length":191}],217:[function(require,module,exports){ +},{"./_export":116,"./_strict-method":180,"./_to-integer":190,"./_to-iobject":191,"./_to-length":192}],218:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $map = require('./_array-methods')(1); @@ -48735,7 +49338,7 @@ $export($export.P + $export.F * !require('./_strict-method')([].map, true), 'Arr return $map(this, callbackfn, arguments[1]); } }); -},{"./_array-methods":95,"./_export":115,"./_strict-method":179}],218:[function(require,module,exports){ +},{"./_array-methods":96,"./_export":116,"./_strict-method":180}],219:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , createProperty = require('./_create-property'); @@ -48755,7 +49358,7 @@ $export($export.S + $export.F * require('./_fails')(function(){ return result; } }); -},{"./_create-property":107,"./_export":115,"./_fails":117}],219:[function(require,module,exports){ +},{"./_create-property":108,"./_export":116,"./_fails":118}],220:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $reduce = require('./_array-reduce'); @@ -48766,7 +49369,7 @@ $export($export.P + $export.F * !require('./_strict-method')([].reduceRight, tru return $reduce(this, callbackfn, arguments.length, arguments[1], true); } }); -},{"./_array-reduce":96,"./_export":115,"./_strict-method":179}],220:[function(require,module,exports){ +},{"./_array-reduce":97,"./_export":116,"./_strict-method":180}],221:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $reduce = require('./_array-reduce'); @@ -48777,7 +49380,7 @@ $export($export.P + $export.F * !require('./_strict-method')([].reduce, true), ' return $reduce(this, callbackfn, arguments.length, arguments[1], false); } }); -},{"./_array-reduce":96,"./_export":115,"./_strict-method":179}],221:[function(require,module,exports){ +},{"./_array-reduce":97,"./_export":116,"./_strict-method":180}],222:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , html = require('./_html') @@ -48806,7 +49409,7 @@ $export($export.P + $export.F * require('./_fails')(function(){ return cloned; } }); -},{"./_cof":101,"./_export":115,"./_fails":117,"./_html":124,"./_to-index":188,"./_to-length":191}],222:[function(require,module,exports){ +},{"./_cof":102,"./_export":116,"./_fails":118,"./_html":125,"./_to-index":189,"./_to-length":192}],223:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $some = require('./_array-methods')(3); @@ -48817,7 +49420,7 @@ $export($export.P + $export.F * !require('./_strict-method')([].some, true), 'Ar return $some(this, callbackfn, arguments[1]); } }); -},{"./_array-methods":95,"./_export":115,"./_strict-method":179}],223:[function(require,module,exports){ +},{"./_array-methods":96,"./_export":116,"./_strict-method":180}],224:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , aFunction = require('./_a-function') @@ -48841,14 +49444,14 @@ $export($export.P + $export.F * (fails(function(){ : $sort.call(toObject(this), aFunction(comparefn)); } }); -},{"./_a-function":86,"./_export":115,"./_fails":117,"./_strict-method":179,"./_to-object":192}],224:[function(require,module,exports){ +},{"./_a-function":87,"./_export":116,"./_fails":118,"./_strict-method":180,"./_to-object":193}],225:[function(require,module,exports){ require('./_set-species')('Array'); -},{"./_set-species":174}],225:[function(require,module,exports){ +},{"./_set-species":175}],226:[function(require,module,exports){ // 20.3.3.1 / 15.9.4.4 Date.now() var $export = require('./_export'); $export($export.S, 'Date', {now: function(){ return new Date().getTime(); }}); -},{"./_export":115}],226:[function(require,module,exports){ +},{"./_export":116}],227:[function(require,module,exports){ 'use strict'; // 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() var $export = require('./_export') @@ -48877,7 +49480,7 @@ $export($export.P + $export.F * (fails(function(){ ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z'; } }); -},{"./_export":115,"./_fails":117}],227:[function(require,module,exports){ +},{"./_export":116,"./_fails":118}],228:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , toObject = require('./_to-object') @@ -48892,12 +49495,12 @@ $export($export.P + $export.F * require('./_fails')(function(){ return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString(); } }); -},{"./_export":115,"./_fails":117,"./_to-object":192,"./_to-primitive":193}],228:[function(require,module,exports){ +},{"./_export":116,"./_fails":118,"./_to-object":193,"./_to-primitive":194}],229:[function(require,module,exports){ var TO_PRIMITIVE = require('./_wks')('toPrimitive') , proto = Date.prototype; if(!(TO_PRIMITIVE in proto))require('./_hide')(proto, TO_PRIMITIVE, require('./_date-to-primitive')); -},{"./_date-to-primitive":109,"./_hide":123,"./_wks":200}],229:[function(require,module,exports){ +},{"./_date-to-primitive":110,"./_hide":124,"./_wks":201}],230:[function(require,module,exports){ var DateProto = Date.prototype , INVALID_DATE = 'Invalid Date' , TO_STRING = 'toString' @@ -48909,12 +49512,12 @@ if(new Date(NaN) + '' != INVALID_DATE){ return value === value ? $toString.call(this) : INVALID_DATE; }); } -},{"./_redefine":170}],230:[function(require,module,exports){ +},{"./_redefine":171}],231:[function(require,module,exports){ // 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...) var $export = require('./_export'); $export($export.P, 'Function', {bind: require('./_bind')}); -},{"./_bind":99,"./_export":115}],231:[function(require,module,exports){ +},{"./_bind":100,"./_export":116}],232:[function(require,module,exports){ 'use strict'; var isObject = require('./_is-object') , getPrototypeOf = require('./_object-gpo') @@ -48928,7 +49531,7 @@ if(!(HAS_INSTANCE in FunctionProto))require('./_object-dp').f(FunctionProto, HAS while(O = getPrototypeOf(O))if(this.prototype === O)return true; return false; }}); -},{"./_is-object":132,"./_object-dp":150,"./_object-gpo":157,"./_wks":200}],232:[function(require,module,exports){ +},{"./_is-object":133,"./_object-dp":151,"./_object-gpo":158,"./_wks":201}],233:[function(require,module,exports){ var dP = require('./_object-dp').f , createDesc = require('./_property-desc') , has = require('./_has') @@ -48954,7 +49557,7 @@ NAME in FProto || require('./_descriptors') && dP(FProto, NAME, { } } }); -},{"./_descriptors":111,"./_has":122,"./_object-dp":150,"./_property-desc":168}],233:[function(require,module,exports){ +},{"./_descriptors":112,"./_has":123,"./_object-dp":151,"./_property-desc":169}],234:[function(require,module,exports){ 'use strict'; var strong = require('./_collection-strong'); @@ -48972,7 +49575,7 @@ module.exports = require('./_collection')('Map', function(get){ return strong.def(this, key === 0 ? 0 : key, value); } }, strong, true); -},{"./_collection":105,"./_collection-strong":102}],234:[function(require,module,exports){ +},{"./_collection":106,"./_collection-strong":103}],235:[function(require,module,exports){ // 20.2.2.3 Math.acosh(x) var $export = require('./_export') , log1p = require('./_math-log1p') @@ -48991,7 +49594,7 @@ $export($export.S + $export.F * !($acosh : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1)); } }); -},{"./_export":115,"./_math-log1p":143}],235:[function(require,module,exports){ +},{"./_export":116,"./_math-log1p":144}],236:[function(require,module,exports){ // 20.2.2.5 Math.asinh(x) var $export = require('./_export') , $asinh = Math.asinh; @@ -49002,7 +49605,7 @@ function asinh(x){ // Tor Browser bug: Math.asinh(0) -> -0 $export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', {asinh: asinh}); -},{"./_export":115}],236:[function(require,module,exports){ +},{"./_export":116}],237:[function(require,module,exports){ // 20.2.2.7 Math.atanh(x) var $export = require('./_export') , $atanh = Math.atanh; @@ -49013,7 +49616,7 @@ $export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', { return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2; } }); -},{"./_export":115}],237:[function(require,module,exports){ +},{"./_export":116}],238:[function(require,module,exports){ // 20.2.2.9 Math.cbrt(x) var $export = require('./_export') , sign = require('./_math-sign'); @@ -49023,7 +49626,7 @@ $export($export.S, 'Math', { return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3); } }); -},{"./_export":115,"./_math-sign":144}],238:[function(require,module,exports){ +},{"./_export":116,"./_math-sign":145}],239:[function(require,module,exports){ // 20.2.2.11 Math.clz32(x) var $export = require('./_export'); @@ -49032,7 +49635,7 @@ $export($export.S, 'Math', { return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32; } }); -},{"./_export":115}],239:[function(require,module,exports){ +},{"./_export":116}],240:[function(require,module,exports){ // 20.2.2.12 Math.cosh(x) var $export = require('./_export') , exp = Math.exp; @@ -49042,13 +49645,13 @@ $export($export.S, 'Math', { return (exp(x = +x) + exp(-x)) / 2; } }); -},{"./_export":115}],240:[function(require,module,exports){ +},{"./_export":116}],241:[function(require,module,exports){ // 20.2.2.14 Math.expm1(x) var $export = require('./_export') , $expm1 = require('./_math-expm1'); $export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', {expm1: $expm1}); -},{"./_export":115,"./_math-expm1":142}],241:[function(require,module,exports){ +},{"./_export":116,"./_math-expm1":143}],242:[function(require,module,exports){ // 20.2.2.16 Math.fround(x) var $export = require('./_export') , sign = require('./_math-sign') @@ -49075,7 +49678,7 @@ $export($export.S, 'Math', { return $sign * result; } }); -},{"./_export":115,"./_math-sign":144}],242:[function(require,module,exports){ +},{"./_export":116,"./_math-sign":145}],243:[function(require,module,exports){ // 20.2.2.17 Math.hypot([value1[, value2[, … ]]]) var $export = require('./_export') , abs = Math.abs; @@ -49101,7 +49704,7 @@ $export($export.S, 'Math', { return larg === Infinity ? Infinity : larg * Math.sqrt(sum); } }); -},{"./_export":115}],243:[function(require,module,exports){ +},{"./_export":116}],244:[function(require,module,exports){ // 20.2.2.18 Math.imul(x, y) var $export = require('./_export') , $imul = Math.imul; @@ -49119,7 +49722,7 @@ $export($export.S + $export.F * require('./_fails')(function(){ return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0); } }); -},{"./_export":115,"./_fails":117}],244:[function(require,module,exports){ +},{"./_export":116,"./_fails":118}],245:[function(require,module,exports){ // 20.2.2.21 Math.log10(x) var $export = require('./_export'); @@ -49128,12 +49731,12 @@ $export($export.S, 'Math', { return Math.log(x) / Math.LN10; } }); -},{"./_export":115}],245:[function(require,module,exports){ +},{"./_export":116}],246:[function(require,module,exports){ // 20.2.2.20 Math.log1p(x) var $export = require('./_export'); $export($export.S, 'Math', {log1p: require('./_math-log1p')}); -},{"./_export":115,"./_math-log1p":143}],246:[function(require,module,exports){ +},{"./_export":116,"./_math-log1p":144}],247:[function(require,module,exports){ // 20.2.2.22 Math.log2(x) var $export = require('./_export'); @@ -49142,12 +49745,12 @@ $export($export.S, 'Math', { return Math.log(x) / Math.LN2; } }); -},{"./_export":115}],247:[function(require,module,exports){ +},{"./_export":116}],248:[function(require,module,exports){ // 20.2.2.28 Math.sign(x) var $export = require('./_export'); $export($export.S, 'Math', {sign: require('./_math-sign')}); -},{"./_export":115,"./_math-sign":144}],248:[function(require,module,exports){ +},{"./_export":116,"./_math-sign":145}],249:[function(require,module,exports){ // 20.2.2.30 Math.sinh(x) var $export = require('./_export') , expm1 = require('./_math-expm1') @@ -49163,7 +49766,7 @@ $export($export.S + $export.F * require('./_fails')(function(){ : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2); } }); -},{"./_export":115,"./_fails":117,"./_math-expm1":142}],249:[function(require,module,exports){ +},{"./_export":116,"./_fails":118,"./_math-expm1":143}],250:[function(require,module,exports){ // 20.2.2.33 Math.tanh(x) var $export = require('./_export') , expm1 = require('./_math-expm1') @@ -49176,7 +49779,7 @@ $export($export.S, 'Math', { return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x)); } }); -},{"./_export":115,"./_math-expm1":142}],250:[function(require,module,exports){ +},{"./_export":116,"./_math-expm1":143}],251:[function(require,module,exports){ // 20.2.2.34 Math.trunc(x) var $export = require('./_export'); @@ -49185,7 +49788,7 @@ $export($export.S, 'Math', { return (it > 0 ? Math.floor : Math.ceil)(it); } }); -},{"./_export":115}],251:[function(require,module,exports){ +},{"./_export":116}],252:[function(require,module,exports){ 'use strict'; var global = require('./_global') , has = require('./_has') @@ -49255,12 +49858,12 @@ if(!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')){ proto.constructor = $Number; require('./_redefine')(global, NUMBER, $Number); } -},{"./_cof":101,"./_descriptors":111,"./_fails":117,"./_global":121,"./_has":122,"./_inherit-if-required":126,"./_object-create":149,"./_object-dp":150,"./_object-gopd":153,"./_object-gopn":155,"./_redefine":170,"./_string-trim":185,"./_to-primitive":193}],252:[function(require,module,exports){ +},{"./_cof":102,"./_descriptors":112,"./_fails":118,"./_global":122,"./_has":123,"./_inherit-if-required":127,"./_object-create":150,"./_object-dp":151,"./_object-gopd":154,"./_object-gopn":156,"./_redefine":171,"./_string-trim":186,"./_to-primitive":194}],253:[function(require,module,exports){ // 20.1.2.1 Number.EPSILON var $export = require('./_export'); $export($export.S, 'Number', {EPSILON: Math.pow(2, -52)}); -},{"./_export":115}],253:[function(require,module,exports){ +},{"./_export":116}],254:[function(require,module,exports){ // 20.1.2.2 Number.isFinite(number) var $export = require('./_export') , _isFinite = require('./_global').isFinite; @@ -49270,12 +49873,12 @@ $export($export.S, 'Number', { return typeof it == 'number' && _isFinite(it); } }); -},{"./_export":115,"./_global":121}],254:[function(require,module,exports){ +},{"./_export":116,"./_global":122}],255:[function(require,module,exports){ // 20.1.2.3 Number.isInteger(number) var $export = require('./_export'); $export($export.S, 'Number', {isInteger: require('./_is-integer')}); -},{"./_export":115,"./_is-integer":131}],255:[function(require,module,exports){ +},{"./_export":116,"./_is-integer":132}],256:[function(require,module,exports){ // 20.1.2.4 Number.isNaN(number) var $export = require('./_export'); @@ -49284,7 +49887,7 @@ $export($export.S, 'Number', { return number != number; } }); -},{"./_export":115}],256:[function(require,module,exports){ +},{"./_export":116}],257:[function(require,module,exports){ // 20.1.2.5 Number.isSafeInteger(number) var $export = require('./_export') , isInteger = require('./_is-integer') @@ -49295,27 +49898,27 @@ $export($export.S, 'Number', { return isInteger(number) && abs(number) <= 0x1fffffffffffff; } }); -},{"./_export":115,"./_is-integer":131}],257:[function(require,module,exports){ +},{"./_export":116,"./_is-integer":132}],258:[function(require,module,exports){ // 20.1.2.6 Number.MAX_SAFE_INTEGER var $export = require('./_export'); $export($export.S, 'Number', {MAX_SAFE_INTEGER: 0x1fffffffffffff}); -},{"./_export":115}],258:[function(require,module,exports){ +},{"./_export":116}],259:[function(require,module,exports){ // 20.1.2.10 Number.MIN_SAFE_INTEGER var $export = require('./_export'); $export($export.S, 'Number', {MIN_SAFE_INTEGER: -0x1fffffffffffff}); -},{"./_export":115}],259:[function(require,module,exports){ +},{"./_export":116}],260:[function(require,module,exports){ var $export = require('./_export') , $parseFloat = require('./_parse-float'); // 20.1.2.12 Number.parseFloat(string) $export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', {parseFloat: $parseFloat}); -},{"./_export":115,"./_parse-float":164}],260:[function(require,module,exports){ +},{"./_export":116,"./_parse-float":165}],261:[function(require,module,exports){ var $export = require('./_export') , $parseInt = require('./_parse-int'); // 20.1.2.13 Number.parseInt(string, radix) $export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', {parseInt: $parseInt}); -},{"./_export":115,"./_parse-int":165}],261:[function(require,module,exports){ +},{"./_export":116,"./_parse-int":166}],262:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , anInstance = require('./_an-instance') @@ -49430,7 +50033,7 @@ $export($export.P + $export.F * (!!$toFixed && ( } return m; } }); -},{"./_a-number-value":87,"./_an-instance":89,"./_export":115,"./_fails":117,"./_string-repeat":184,"./_to-integer":189}],262:[function(require,module,exports){ +},{"./_a-number-value":88,"./_an-instance":90,"./_export":116,"./_fails":118,"./_string-repeat":185,"./_to-integer":190}],263:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $fails = require('./_fails') @@ -49449,24 +50052,24 @@ $export($export.P + $export.F * ($fails(function(){ return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision); } }); -},{"./_a-number-value":87,"./_export":115,"./_fails":117}],263:[function(require,module,exports){ +},{"./_a-number-value":88,"./_export":116,"./_fails":118}],264:[function(require,module,exports){ // 19.1.3.1 Object.assign(target, source) var $export = require('./_export'); $export($export.S + $export.F, 'Object', {assign: require('./_object-assign')}); -},{"./_export":115,"./_object-assign":148}],264:[function(require,module,exports){ +},{"./_export":116,"./_object-assign":149}],265:[function(require,module,exports){ var $export = require('./_export') // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) $export($export.S, 'Object', {create: require('./_object-create')}); -},{"./_export":115,"./_object-create":149}],265:[function(require,module,exports){ +},{"./_export":116,"./_object-create":150}],266:[function(require,module,exports){ var $export = require('./_export'); // 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) $export($export.S + $export.F * !require('./_descriptors'), 'Object', {defineProperties: require('./_object-dps')}); -},{"./_descriptors":111,"./_export":115,"./_object-dps":151}],266:[function(require,module,exports){ +},{"./_descriptors":112,"./_export":116,"./_object-dps":152}],267:[function(require,module,exports){ var $export = require('./_export'); // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) $export($export.S + $export.F * !require('./_descriptors'), 'Object', {defineProperty: require('./_object-dp').f}); -},{"./_descriptors":111,"./_export":115,"./_object-dp":150}],267:[function(require,module,exports){ +},{"./_descriptors":112,"./_export":116,"./_object-dp":151}],268:[function(require,module,exports){ // 19.1.2.5 Object.freeze(O) var isObject = require('./_is-object') , meta = require('./_meta').onFreeze; @@ -49476,7 +50079,7 @@ require('./_object-sap')('freeze', function($freeze){ return $freeze && isObject(it) ? $freeze(meta(it)) : it; }; }); -},{"./_is-object":132,"./_meta":145,"./_object-sap":161}],268:[function(require,module,exports){ +},{"./_is-object":133,"./_meta":146,"./_object-sap":162}],269:[function(require,module,exports){ // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) var toIObject = require('./_to-iobject') , $getOwnPropertyDescriptor = require('./_object-gopd').f; @@ -49486,12 +50089,12 @@ require('./_object-sap')('getOwnPropertyDescriptor', function(){ return $getOwnPropertyDescriptor(toIObject(it), key); }; }); -},{"./_object-gopd":153,"./_object-sap":161,"./_to-iobject":190}],269:[function(require,module,exports){ +},{"./_object-gopd":154,"./_object-sap":162,"./_to-iobject":191}],270:[function(require,module,exports){ // 19.1.2.7 Object.getOwnPropertyNames(O) require('./_object-sap')('getOwnPropertyNames', function(){ return require('./_object-gopn-ext').f; }); -},{"./_object-gopn-ext":154,"./_object-sap":161}],270:[function(require,module,exports){ +},{"./_object-gopn-ext":155,"./_object-sap":162}],271:[function(require,module,exports){ // 19.1.2.9 Object.getPrototypeOf(O) var toObject = require('./_to-object') , $getPrototypeOf = require('./_object-gpo'); @@ -49501,7 +50104,7 @@ require('./_object-sap')('getPrototypeOf', function(){ return $getPrototypeOf(toObject(it)); }; }); -},{"./_object-gpo":157,"./_object-sap":161,"./_to-object":192}],271:[function(require,module,exports){ +},{"./_object-gpo":158,"./_object-sap":162,"./_to-object":193}],272:[function(require,module,exports){ // 19.1.2.11 Object.isExtensible(O) var isObject = require('./_is-object'); @@ -49510,7 +50113,7 @@ require('./_object-sap')('isExtensible', function($isExtensible){ return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false; }; }); -},{"./_is-object":132,"./_object-sap":161}],272:[function(require,module,exports){ +},{"./_is-object":133,"./_object-sap":162}],273:[function(require,module,exports){ // 19.1.2.12 Object.isFrozen(O) var isObject = require('./_is-object'); @@ -49519,7 +50122,7 @@ require('./_object-sap')('isFrozen', function($isFrozen){ return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true; }; }); -},{"./_is-object":132,"./_object-sap":161}],273:[function(require,module,exports){ +},{"./_is-object":133,"./_object-sap":162}],274:[function(require,module,exports){ // 19.1.2.13 Object.isSealed(O) var isObject = require('./_is-object'); @@ -49528,11 +50131,11 @@ require('./_object-sap')('isSealed', function($isSealed){ return isObject(it) ? $isSealed ? $isSealed(it) : false : true; }; }); -},{"./_is-object":132,"./_object-sap":161}],274:[function(require,module,exports){ +},{"./_is-object":133,"./_object-sap":162}],275:[function(require,module,exports){ // 19.1.3.10 Object.is(value1, value2) var $export = require('./_export'); $export($export.S, 'Object', {is: require('./_same-value')}); -},{"./_export":115,"./_same-value":172}],275:[function(require,module,exports){ +},{"./_export":116,"./_same-value":173}],276:[function(require,module,exports){ // 19.1.2.14 Object.keys(O) var toObject = require('./_to-object') , $keys = require('./_object-keys'); @@ -49542,7 +50145,7 @@ require('./_object-sap')('keys', function(){ return $keys(toObject(it)); }; }); -},{"./_object-keys":159,"./_object-sap":161,"./_to-object":192}],276:[function(require,module,exports){ +},{"./_object-keys":160,"./_object-sap":162,"./_to-object":193}],277:[function(require,module,exports){ // 19.1.2.15 Object.preventExtensions(O) var isObject = require('./_is-object') , meta = require('./_meta').onFreeze; @@ -49552,7 +50155,7 @@ require('./_object-sap')('preventExtensions', function($preventExtensions){ return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it; }; }); -},{"./_is-object":132,"./_meta":145,"./_object-sap":161}],277:[function(require,module,exports){ +},{"./_is-object":133,"./_meta":146,"./_object-sap":162}],278:[function(require,module,exports){ // 19.1.2.17 Object.seal(O) var isObject = require('./_is-object') , meta = require('./_meta').onFreeze; @@ -49562,11 +50165,11 @@ require('./_object-sap')('seal', function($seal){ return $seal && isObject(it) ? $seal(meta(it)) : it; }; }); -},{"./_is-object":132,"./_meta":145,"./_object-sap":161}],278:[function(require,module,exports){ +},{"./_is-object":133,"./_meta":146,"./_object-sap":162}],279:[function(require,module,exports){ // 19.1.3.19 Object.setPrototypeOf(O, proto) var $export = require('./_export'); $export($export.S, 'Object', {setPrototypeOf: require('./_set-proto').set}); -},{"./_export":115,"./_set-proto":173}],279:[function(require,module,exports){ +},{"./_export":116,"./_set-proto":174}],280:[function(require,module,exports){ 'use strict'; // 19.1.3.6 Object.prototype.toString() var classof = require('./_classof') @@ -49577,17 +50180,17 @@ if(test + '' != '[object z]'){ return '[object ' + classof(this) + ']'; }, true); } -},{"./_classof":100,"./_redefine":170,"./_wks":200}],280:[function(require,module,exports){ +},{"./_classof":101,"./_redefine":171,"./_wks":201}],281:[function(require,module,exports){ var $export = require('./_export') , $parseFloat = require('./_parse-float'); // 18.2.4 parseFloat(string) $export($export.G + $export.F * (parseFloat != $parseFloat), {parseFloat: $parseFloat}); -},{"./_export":115,"./_parse-float":164}],281:[function(require,module,exports){ +},{"./_export":116,"./_parse-float":165}],282:[function(require,module,exports){ var $export = require('./_export') , $parseInt = require('./_parse-int'); // 18.2.5 parseInt(string, radix) $export($export.G + $export.F * (parseInt != $parseInt), {parseInt: $parseInt}); -},{"./_export":115,"./_parse-int":165}],282:[function(require,module,exports){ +},{"./_export":116,"./_parse-int":166}],283:[function(require,module,exports){ 'use strict'; var LIBRARY = require('./_library') , global = require('./_global') @@ -49889,7 +50492,7 @@ $export($export.S + $export.F * !(USE_NATIVE && require('./_iter-detect')(functi return capability.promise; } }); -},{"./_a-function":86,"./_an-instance":89,"./_an-object":90,"./_classof":100,"./_core":106,"./_ctx":108,"./_export":115,"./_for-of":120,"./_global":121,"./_is-object":132,"./_iter-detect":137,"./_library":141,"./_microtask":147,"./_redefine-all":169,"./_set-proto":173,"./_set-species":174,"./_set-to-string-tag":175,"./_species-constructor":178,"./_task":187,"./_wks":200}],283:[function(require,module,exports){ +},{"./_a-function":87,"./_an-instance":90,"./_an-object":91,"./_classof":101,"./_core":107,"./_ctx":109,"./_export":116,"./_for-of":121,"./_global":122,"./_is-object":133,"./_iter-detect":138,"./_library":142,"./_microtask":148,"./_redefine-all":170,"./_set-proto":174,"./_set-species":175,"./_set-to-string-tag":176,"./_species-constructor":179,"./_task":188,"./_wks":201}],284:[function(require,module,exports){ // 26.1.1 Reflect.apply(target, thisArgument, argumentsList) var $export = require('./_export') , aFunction = require('./_a-function') @@ -49901,7 +50504,7 @@ $export($export.S, 'Reflect', { return _apply.call(aFunction(target), thisArgument, anObject(argumentsList)); } }); -},{"./_a-function":86,"./_an-object":90,"./_export":115}],284:[function(require,module,exports){ +},{"./_a-function":87,"./_an-object":91,"./_export":116}],285:[function(require,module,exports){ // 26.1.2 Reflect.construct(target, argumentsList [, newTarget]) var $export = require('./_export') , create = require('./_object-create') @@ -49941,7 +50544,7 @@ $export($export.S + $export.F * require('./_fails')(function(){ return isObject(result) ? result : instance; } }); -},{"./_a-function":86,"./_an-object":90,"./_bind":99,"./_export":115,"./_fails":117,"./_is-object":132,"./_object-create":149}],285:[function(require,module,exports){ +},{"./_a-function":87,"./_an-object":91,"./_bind":100,"./_export":116,"./_fails":118,"./_is-object":133,"./_object-create":150}],286:[function(require,module,exports){ // 26.1.3 Reflect.defineProperty(target, propertyKey, attributes) var dP = require('./_object-dp') , $export = require('./_export') @@ -49964,7 +50567,7 @@ $export($export.S + $export.F * require('./_fails')(function(){ } } }); -},{"./_an-object":90,"./_export":115,"./_fails":117,"./_object-dp":150,"./_to-primitive":193}],286:[function(require,module,exports){ +},{"./_an-object":91,"./_export":116,"./_fails":118,"./_object-dp":151,"./_to-primitive":194}],287:[function(require,module,exports){ // 26.1.4 Reflect.deleteProperty(target, propertyKey) var $export = require('./_export') , gOPD = require('./_object-gopd').f @@ -49976,7 +50579,7 @@ $export($export.S, 'Reflect', { return desc && !desc.configurable ? false : delete target[propertyKey]; } }); -},{"./_an-object":90,"./_export":115,"./_object-gopd":153}],287:[function(require,module,exports){ +},{"./_an-object":91,"./_export":116,"./_object-gopd":154}],288:[function(require,module,exports){ 'use strict'; // 26.1.5 Reflect.enumerate(target) var $export = require('./_export') @@ -50003,7 +50606,7 @@ $export($export.S, 'Reflect', { return new Enumerate(target); } }); -},{"./_an-object":90,"./_export":115,"./_iter-create":135}],288:[function(require,module,exports){ +},{"./_an-object":91,"./_export":116,"./_iter-create":136}],289:[function(require,module,exports){ // 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey) var gOPD = require('./_object-gopd') , $export = require('./_export') @@ -50014,7 +50617,7 @@ $export($export.S, 'Reflect', { return gOPD.f(anObject(target), propertyKey); } }); -},{"./_an-object":90,"./_export":115,"./_object-gopd":153}],289:[function(require,module,exports){ +},{"./_an-object":91,"./_export":116,"./_object-gopd":154}],290:[function(require,module,exports){ // 26.1.8 Reflect.getPrototypeOf(target) var $export = require('./_export') , getProto = require('./_object-gpo') @@ -50025,7 +50628,7 @@ $export($export.S, 'Reflect', { return getProto(anObject(target)); } }); -},{"./_an-object":90,"./_export":115,"./_object-gpo":157}],290:[function(require,module,exports){ +},{"./_an-object":91,"./_export":116,"./_object-gpo":158}],291:[function(require,module,exports){ // 26.1.6 Reflect.get(target, propertyKey [, receiver]) var gOPD = require('./_object-gopd') , getPrototypeOf = require('./_object-gpo') @@ -50047,7 +50650,7 @@ function get(target, propertyKey/*, receiver*/){ } $export($export.S, 'Reflect', {get: get}); -},{"./_an-object":90,"./_export":115,"./_has":122,"./_is-object":132,"./_object-gopd":153,"./_object-gpo":157}],291:[function(require,module,exports){ +},{"./_an-object":91,"./_export":116,"./_has":123,"./_is-object":133,"./_object-gopd":154,"./_object-gpo":158}],292:[function(require,module,exports){ // 26.1.9 Reflect.has(target, propertyKey) var $export = require('./_export'); @@ -50056,7 +50659,7 @@ $export($export.S, 'Reflect', { return propertyKey in target; } }); -},{"./_export":115}],292:[function(require,module,exports){ +},{"./_export":116}],293:[function(require,module,exports){ // 26.1.10 Reflect.isExtensible(target) var $export = require('./_export') , anObject = require('./_an-object') @@ -50068,12 +50671,12 @@ $export($export.S, 'Reflect', { return $isExtensible ? $isExtensible(target) : true; } }); -},{"./_an-object":90,"./_export":115}],293:[function(require,module,exports){ +},{"./_an-object":91,"./_export":116}],294:[function(require,module,exports){ // 26.1.11 Reflect.ownKeys(target) var $export = require('./_export'); $export($export.S, 'Reflect', {ownKeys: require('./_own-keys')}); -},{"./_export":115,"./_own-keys":163}],294:[function(require,module,exports){ +},{"./_export":116,"./_own-keys":164}],295:[function(require,module,exports){ // 26.1.12 Reflect.preventExtensions(target) var $export = require('./_export') , anObject = require('./_an-object') @@ -50090,7 +50693,7 @@ $export($export.S, 'Reflect', { } } }); -},{"./_an-object":90,"./_export":115}],295:[function(require,module,exports){ +},{"./_an-object":91,"./_export":116}],296:[function(require,module,exports){ // 26.1.14 Reflect.setPrototypeOf(target, proto) var $export = require('./_export') , setProto = require('./_set-proto'); @@ -50106,7 +50709,7 @@ if(setProto)$export($export.S, 'Reflect', { } } }); -},{"./_export":115,"./_set-proto":173}],296:[function(require,module,exports){ +},{"./_export":116,"./_set-proto":174}],297:[function(require,module,exports){ // 26.1.13 Reflect.set(target, propertyKey, V [, receiver]) var dP = require('./_object-dp') , gOPD = require('./_object-gopd') @@ -50138,7 +50741,7 @@ function set(target, propertyKey, V/*, receiver*/){ } $export($export.S, 'Reflect', {set: set}); -},{"./_an-object":90,"./_export":115,"./_has":122,"./_is-object":132,"./_object-dp":150,"./_object-gopd":153,"./_object-gpo":157,"./_property-desc":168}],297:[function(require,module,exports){ +},{"./_an-object":91,"./_export":116,"./_has":123,"./_is-object":133,"./_object-dp":151,"./_object-gopd":154,"./_object-gpo":158,"./_property-desc":169}],298:[function(require,module,exports){ var global = require('./_global') , inheritIfRequired = require('./_inherit-if-required') , dP = require('./_object-dp').f @@ -50182,13 +50785,13 @@ if(require('./_descriptors') && (!CORRECT_NEW || require('./_fails')(function(){ } require('./_set-species')('RegExp'); -},{"./_descriptors":111,"./_fails":117,"./_flags":119,"./_global":121,"./_inherit-if-required":126,"./_is-regexp":133,"./_object-dp":150,"./_object-gopn":155,"./_redefine":170,"./_set-species":174,"./_wks":200}],298:[function(require,module,exports){ +},{"./_descriptors":112,"./_fails":118,"./_flags":120,"./_global":122,"./_inherit-if-required":127,"./_is-regexp":134,"./_object-dp":151,"./_object-gopn":156,"./_redefine":171,"./_set-species":175,"./_wks":201}],299:[function(require,module,exports){ // 21.2.5.3 get RegExp.prototype.flags() if(require('./_descriptors') && /./g.flags != 'g')require('./_object-dp').f(RegExp.prototype, 'flags', { configurable: true, get: require('./_flags') }); -},{"./_descriptors":111,"./_flags":119,"./_object-dp":150}],299:[function(require,module,exports){ +},{"./_descriptors":112,"./_flags":120,"./_object-dp":151}],300:[function(require,module,exports){ // @@match logic require('./_fix-re-wks')('match', 1, function(defined, MATCH, $match){ // 21.1.3.11 String.prototype.match(regexp) @@ -50199,7 +50802,7 @@ require('./_fix-re-wks')('match', 1, function(defined, MATCH, $match){ return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O)); }, $match]; }); -},{"./_fix-re-wks":118}],300:[function(require,module,exports){ +},{"./_fix-re-wks":119}],301:[function(require,module,exports){ // @@replace logic require('./_fix-re-wks')('replace', 2, function(defined, REPLACE, $replace){ // 21.1.3.14 String.prototype.replace(searchValue, replaceValue) @@ -50212,7 +50815,7 @@ require('./_fix-re-wks')('replace', 2, function(defined, REPLACE, $replace){ : $replace.call(String(O), searchValue, replaceValue); }, $replace]; }); -},{"./_fix-re-wks":118}],301:[function(require,module,exports){ +},{"./_fix-re-wks":119}],302:[function(require,module,exports){ // @@search logic require('./_fix-re-wks')('search', 1, function(defined, SEARCH, $search){ // 21.1.3.15 String.prototype.search(regexp) @@ -50223,7 +50826,7 @@ require('./_fix-re-wks')('search', 1, function(defined, SEARCH, $search){ return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O)); }, $search]; }); -},{"./_fix-re-wks":118}],302:[function(require,module,exports){ +},{"./_fix-re-wks":119}],303:[function(require,module,exports){ // @@split logic require('./_fix-re-wks')('split', 2, function(defined, SPLIT, $split){ 'use strict'; @@ -50294,7 +50897,7 @@ require('./_fix-re-wks')('split', 2, function(defined, SPLIT, $split){ return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit); }, $split]; }); -},{"./_fix-re-wks":118,"./_is-regexp":133}],303:[function(require,module,exports){ +},{"./_fix-re-wks":119,"./_is-regexp":134}],304:[function(require,module,exports){ 'use strict'; require('./es6.regexp.flags'); var anObject = require('./_an-object') @@ -50320,7 +50923,7 @@ if(require('./_fails')(function(){ return $toString.call({source: 'a', flags: 'b return $toString.call(this); }); } -},{"./_an-object":90,"./_descriptors":111,"./_fails":117,"./_flags":119,"./_redefine":170,"./es6.regexp.flags":298}],304:[function(require,module,exports){ +},{"./_an-object":91,"./_descriptors":112,"./_fails":118,"./_flags":120,"./_redefine":171,"./es6.regexp.flags":299}],305:[function(require,module,exports){ 'use strict'; var strong = require('./_collection-strong'); @@ -50333,7 +50936,7 @@ module.exports = require('./_collection')('Set', function(get){ return strong.def(this, value = value === 0 ? 0 : value, value); } }, strong); -},{"./_collection":105,"./_collection-strong":102}],305:[function(require,module,exports){ +},{"./_collection":106,"./_collection-strong":103}],306:[function(require,module,exports){ 'use strict'; // B.2.3.2 String.prototype.anchor(name) require('./_string-html')('anchor', function(createHTML){ @@ -50341,7 +50944,7 @@ require('./_string-html')('anchor', function(createHTML){ return createHTML(this, 'a', 'name', name); } }); -},{"./_string-html":182}],306:[function(require,module,exports){ +},{"./_string-html":183}],307:[function(require,module,exports){ 'use strict'; // B.2.3.3 String.prototype.big() require('./_string-html')('big', function(createHTML){ @@ -50349,7 +50952,7 @@ require('./_string-html')('big', function(createHTML){ return createHTML(this, 'big', '', ''); } }); -},{"./_string-html":182}],307:[function(require,module,exports){ +},{"./_string-html":183}],308:[function(require,module,exports){ 'use strict'; // B.2.3.4 String.prototype.blink() require('./_string-html')('blink', function(createHTML){ @@ -50357,7 +50960,7 @@ require('./_string-html')('blink', function(createHTML){ return createHTML(this, 'blink', '', ''); } }); -},{"./_string-html":182}],308:[function(require,module,exports){ +},{"./_string-html":183}],309:[function(require,module,exports){ 'use strict'; // B.2.3.5 String.prototype.bold() require('./_string-html')('bold', function(createHTML){ @@ -50365,7 +50968,7 @@ require('./_string-html')('bold', function(createHTML){ return createHTML(this, 'b', '', ''); } }); -},{"./_string-html":182}],309:[function(require,module,exports){ +},{"./_string-html":183}],310:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $at = require('./_string-at')(false); @@ -50375,7 +50978,7 @@ $export($export.P, 'String', { return $at(this, pos); } }); -},{"./_export":115,"./_string-at":180}],310:[function(require,module,exports){ +},{"./_export":116,"./_string-at":181}],311:[function(require,module,exports){ // 21.1.3.6 String.prototype.endsWith(searchString [, endPosition]) 'use strict'; var $export = require('./_export') @@ -50396,7 +50999,7 @@ $export($export.P + $export.F * require('./_fails-is-regexp')(ENDS_WITH), 'Strin : that.slice(end - search.length, end) === search; } }); -},{"./_export":115,"./_fails-is-regexp":116,"./_string-context":181,"./_to-length":191}],311:[function(require,module,exports){ +},{"./_export":116,"./_fails-is-regexp":117,"./_string-context":182,"./_to-length":192}],312:[function(require,module,exports){ 'use strict'; // B.2.3.6 String.prototype.fixed() require('./_string-html')('fixed', function(createHTML){ @@ -50404,7 +51007,7 @@ require('./_string-html')('fixed', function(createHTML){ return createHTML(this, 'tt', '', ''); } }); -},{"./_string-html":182}],312:[function(require,module,exports){ +},{"./_string-html":183}],313:[function(require,module,exports){ 'use strict'; // B.2.3.7 String.prototype.fontcolor(color) require('./_string-html')('fontcolor', function(createHTML){ @@ -50412,7 +51015,7 @@ require('./_string-html')('fontcolor', function(createHTML){ return createHTML(this, 'font', 'color', color); } }); -},{"./_string-html":182}],313:[function(require,module,exports){ +},{"./_string-html":183}],314:[function(require,module,exports){ 'use strict'; // B.2.3.8 String.prototype.fontsize(size) require('./_string-html')('fontsize', function(createHTML){ @@ -50420,7 +51023,7 @@ require('./_string-html')('fontsize', function(createHTML){ return createHTML(this, 'font', 'size', size); } }); -},{"./_string-html":182}],314:[function(require,module,exports){ +},{"./_string-html":183}],315:[function(require,module,exports){ var $export = require('./_export') , toIndex = require('./_to-index') , fromCharCode = String.fromCharCode @@ -50444,7 +51047,7 @@ $export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1) } return res.join(''); } }); -},{"./_export":115,"./_to-index":188}],315:[function(require,module,exports){ +},{"./_export":116,"./_to-index":189}],316:[function(require,module,exports){ // 21.1.3.7 String.prototype.includes(searchString, position = 0) 'use strict'; var $export = require('./_export') @@ -50457,7 +51060,7 @@ $export($export.P + $export.F * require('./_fails-is-regexp')(INCLUDES), 'String .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined); } }); -},{"./_export":115,"./_fails-is-regexp":116,"./_string-context":181}],316:[function(require,module,exports){ +},{"./_export":116,"./_fails-is-regexp":117,"./_string-context":182}],317:[function(require,module,exports){ 'use strict'; // B.2.3.9 String.prototype.italics() require('./_string-html')('italics', function(createHTML){ @@ -50465,7 +51068,7 @@ require('./_string-html')('italics', function(createHTML){ return createHTML(this, 'i', '', ''); } }); -},{"./_string-html":182}],317:[function(require,module,exports){ +},{"./_string-html":183}],318:[function(require,module,exports){ 'use strict'; var $at = require('./_string-at')(true); @@ -50483,7 +51086,7 @@ require('./_iter-define')(String, 'String', function(iterated){ this._i += point.length; return {value: point, done: false}; }); -},{"./_iter-define":136,"./_string-at":180}],318:[function(require,module,exports){ +},{"./_iter-define":137,"./_string-at":181}],319:[function(require,module,exports){ 'use strict'; // B.2.3.10 String.prototype.link(url) require('./_string-html')('link', function(createHTML){ @@ -50491,7 +51094,7 @@ require('./_string-html')('link', function(createHTML){ return createHTML(this, 'a', 'href', url); } }); -},{"./_string-html":182}],319:[function(require,module,exports){ +},{"./_string-html":183}],320:[function(require,module,exports){ var $export = require('./_export') , toIObject = require('./_to-iobject') , toLength = require('./_to-length'); @@ -50510,14 +51113,14 @@ $export($export.S, 'String', { } return res.join(''); } }); -},{"./_export":115,"./_to-iobject":190,"./_to-length":191}],320:[function(require,module,exports){ +},{"./_export":116,"./_to-iobject":191,"./_to-length":192}],321:[function(require,module,exports){ var $export = require('./_export'); $export($export.P, 'String', { // 21.1.3.13 String.prototype.repeat(count) repeat: require('./_string-repeat') }); -},{"./_export":115,"./_string-repeat":184}],321:[function(require,module,exports){ +},{"./_export":116,"./_string-repeat":185}],322:[function(require,module,exports){ 'use strict'; // B.2.3.11 String.prototype.small() require('./_string-html')('small', function(createHTML){ @@ -50525,7 +51128,7 @@ require('./_string-html')('small', function(createHTML){ return createHTML(this, 'small', '', ''); } }); -},{"./_string-html":182}],322:[function(require,module,exports){ +},{"./_string-html":183}],323:[function(require,module,exports){ // 21.1.3.18 String.prototype.startsWith(searchString [, position ]) 'use strict'; var $export = require('./_export') @@ -50544,7 +51147,7 @@ $export($export.P + $export.F * require('./_fails-is-regexp')(STARTS_WITH), 'Str : that.slice(index, index + search.length) === search; } }); -},{"./_export":115,"./_fails-is-regexp":116,"./_string-context":181,"./_to-length":191}],323:[function(require,module,exports){ +},{"./_export":116,"./_fails-is-regexp":117,"./_string-context":182,"./_to-length":192}],324:[function(require,module,exports){ 'use strict'; // B.2.3.12 String.prototype.strike() require('./_string-html')('strike', function(createHTML){ @@ -50552,7 +51155,7 @@ require('./_string-html')('strike', function(createHTML){ return createHTML(this, 'strike', '', ''); } }); -},{"./_string-html":182}],324:[function(require,module,exports){ +},{"./_string-html":183}],325:[function(require,module,exports){ 'use strict'; // B.2.3.13 String.prototype.sub() require('./_string-html')('sub', function(createHTML){ @@ -50560,7 +51163,7 @@ require('./_string-html')('sub', function(createHTML){ return createHTML(this, 'sub', '', ''); } }); -},{"./_string-html":182}],325:[function(require,module,exports){ +},{"./_string-html":183}],326:[function(require,module,exports){ 'use strict'; // B.2.3.14 String.prototype.sup() require('./_string-html')('sup', function(createHTML){ @@ -50568,7 +51171,7 @@ require('./_string-html')('sup', function(createHTML){ return createHTML(this, 'sup', '', ''); } }); -},{"./_string-html":182}],326:[function(require,module,exports){ +},{"./_string-html":183}],327:[function(require,module,exports){ 'use strict'; // 21.1.3.25 String.prototype.trim() require('./_string-trim')('trim', function($trim){ @@ -50576,7 +51179,7 @@ require('./_string-trim')('trim', function($trim){ return $trim(this, 3); }; }); -},{"./_string-trim":185}],327:[function(require,module,exports){ +},{"./_string-trim":186}],328:[function(require,module,exports){ 'use strict'; // ECMAScript 6 symbols shim var global = require('./_global') @@ -50812,7 +51415,7 @@ setToStringTag($Symbol, 'Symbol'); setToStringTag(Math, 'Math', true); // 24.3.3 JSON[@@toStringTag] setToStringTag(global.JSON, 'JSON', true); -},{"./_an-object":90,"./_descriptors":111,"./_enum-keys":114,"./_export":115,"./_fails":117,"./_global":121,"./_has":122,"./_hide":123,"./_is-array":130,"./_keyof":140,"./_library":141,"./_meta":145,"./_object-create":149,"./_object-dp":150,"./_object-gopd":153,"./_object-gopn":155,"./_object-gopn-ext":154,"./_object-gops":156,"./_object-keys":159,"./_object-pie":160,"./_property-desc":168,"./_redefine":170,"./_set-to-string-tag":175,"./_shared":177,"./_to-iobject":190,"./_to-primitive":193,"./_uid":197,"./_wks":200,"./_wks-define":198,"./_wks-ext":199}],328:[function(require,module,exports){ +},{"./_an-object":91,"./_descriptors":112,"./_enum-keys":115,"./_export":116,"./_fails":118,"./_global":122,"./_has":123,"./_hide":124,"./_is-array":131,"./_keyof":141,"./_library":142,"./_meta":146,"./_object-create":150,"./_object-dp":151,"./_object-gopd":154,"./_object-gopn":156,"./_object-gopn-ext":155,"./_object-gops":157,"./_object-keys":160,"./_object-pie":161,"./_property-desc":169,"./_redefine":171,"./_set-to-string-tag":176,"./_shared":178,"./_to-iobject":191,"./_to-primitive":194,"./_uid":198,"./_wks":201,"./_wks-define":199,"./_wks-ext":200}],329:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , $typed = require('./_typed') @@ -50860,66 +51463,66 @@ $export($export.P + $export.U + $export.F * require('./_fails')(function(){ }); require('./_set-species')(ARRAY_BUFFER); -},{"./_an-object":90,"./_export":115,"./_fails":117,"./_global":121,"./_is-object":132,"./_set-species":174,"./_species-constructor":178,"./_to-index":188,"./_to-length":191,"./_typed":196,"./_typed-buffer":195,"./_wks":200}],329:[function(require,module,exports){ +},{"./_an-object":91,"./_export":116,"./_fails":118,"./_global":122,"./_is-object":133,"./_set-species":175,"./_species-constructor":179,"./_to-index":189,"./_to-length":192,"./_typed":197,"./_typed-buffer":196,"./_wks":201}],330:[function(require,module,exports){ var $export = require('./_export'); $export($export.G + $export.W + $export.F * !require('./_typed').ABV, { DataView: require('./_typed-buffer').DataView }); -},{"./_export":115,"./_typed":196,"./_typed-buffer":195}],330:[function(require,module,exports){ +},{"./_export":116,"./_typed":197,"./_typed-buffer":196}],331:[function(require,module,exports){ require('./_typed-array')('Float32', 4, function(init){ return function Float32Array(data, byteOffset, length){ return init(this, data, byteOffset, length); }; }); -},{"./_typed-array":194}],331:[function(require,module,exports){ +},{"./_typed-array":195}],332:[function(require,module,exports){ require('./_typed-array')('Float64', 8, function(init){ return function Float64Array(data, byteOffset, length){ return init(this, data, byteOffset, length); }; }); -},{"./_typed-array":194}],332:[function(require,module,exports){ +},{"./_typed-array":195}],333:[function(require,module,exports){ require('./_typed-array')('Int16', 2, function(init){ return function Int16Array(data, byteOffset, length){ return init(this, data, byteOffset, length); }; }); -},{"./_typed-array":194}],333:[function(require,module,exports){ +},{"./_typed-array":195}],334:[function(require,module,exports){ require('./_typed-array')('Int32', 4, function(init){ return function Int32Array(data, byteOffset, length){ return init(this, data, byteOffset, length); }; }); -},{"./_typed-array":194}],334:[function(require,module,exports){ +},{"./_typed-array":195}],335:[function(require,module,exports){ require('./_typed-array')('Int8', 1, function(init){ return function Int8Array(data, byteOffset, length){ return init(this, data, byteOffset, length); }; }); -},{"./_typed-array":194}],335:[function(require,module,exports){ +},{"./_typed-array":195}],336:[function(require,module,exports){ require('./_typed-array')('Uint16', 2, function(init){ return function Uint16Array(data, byteOffset, length){ return init(this, data, byteOffset, length); }; }); -},{"./_typed-array":194}],336:[function(require,module,exports){ +},{"./_typed-array":195}],337:[function(require,module,exports){ require('./_typed-array')('Uint32', 4, function(init){ return function Uint32Array(data, byteOffset, length){ return init(this, data, byteOffset, length); }; }); -},{"./_typed-array":194}],337:[function(require,module,exports){ +},{"./_typed-array":195}],338:[function(require,module,exports){ require('./_typed-array')('Uint8', 1, function(init){ return function Uint8Array(data, byteOffset, length){ return init(this, data, byteOffset, length); }; }); -},{"./_typed-array":194}],338:[function(require,module,exports){ +},{"./_typed-array":195}],339:[function(require,module,exports){ require('./_typed-array')('Uint8', 1, function(init){ return function Uint8ClampedArray(data, byteOffset, length){ return init(this, data, byteOffset, length); }; }, true); -},{"./_typed-array":194}],339:[function(require,module,exports){ +},{"./_typed-array":195}],340:[function(require,module,exports){ 'use strict'; var each = require('./_array-methods')(0) , redefine = require('./_redefine') @@ -50977,7 +51580,7 @@ if(new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7){ }); }); } -},{"./_array-methods":95,"./_collection":105,"./_collection-weak":104,"./_has":122,"./_is-object":132,"./_meta":145,"./_object-assign":148,"./_redefine":170}],340:[function(require,module,exports){ +},{"./_array-methods":96,"./_collection":106,"./_collection-weak":105,"./_has":123,"./_is-object":133,"./_meta":146,"./_object-assign":149,"./_redefine":171}],341:[function(require,module,exports){ 'use strict'; var weak = require('./_collection-weak'); @@ -50990,7 +51593,7 @@ require('./_collection')('WeakSet', function(get){ return weak.def(this, value, true); } }, weak, false, true); -},{"./_collection":105,"./_collection-weak":104}],341:[function(require,module,exports){ +},{"./_collection":106,"./_collection-weak":105}],342:[function(require,module,exports){ 'use strict'; // https://github.com/tc39/Array.prototype.includes var $export = require('./_export') @@ -51003,7 +51606,7 @@ $export($export.P, 'Array', { }); require('./_add-to-unscopables')('includes'); -},{"./_add-to-unscopables":88,"./_array-includes":94,"./_export":115}],342:[function(require,module,exports){ +},{"./_add-to-unscopables":89,"./_array-includes":95,"./_export":116}],343:[function(require,module,exports){ // https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask var $export = require('./_export') , microtask = require('./_microtask')() @@ -51016,7 +51619,7 @@ $export($export.G, { microtask(domain ? domain.bind(fn) : fn); } }); -},{"./_cof":101,"./_export":115,"./_global":121,"./_microtask":147}],343:[function(require,module,exports){ +},{"./_cof":102,"./_export":116,"./_global":122,"./_microtask":148}],344:[function(require,module,exports){ // https://github.com/ljharb/proposal-is-error var $export = require('./_export') , cof = require('./_cof'); @@ -51026,12 +51629,12 @@ $export($export.S, 'Error', { return cof(it) === 'Error'; } }); -},{"./_cof":101,"./_export":115}],344:[function(require,module,exports){ +},{"./_cof":102,"./_export":116}],345:[function(require,module,exports){ // https://github.com/DavidBruant/Map-Set.prototype.toJSON var $export = require('./_export'); $export($export.P + $export.R, 'Map', {toJSON: require('./_collection-to-json')('Map')}); -},{"./_collection-to-json":103,"./_export":115}],345:[function(require,module,exports){ +},{"./_collection-to-json":104,"./_export":116}],346:[function(require,module,exports){ // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 var $export = require('./_export'); @@ -51043,7 +51646,7 @@ $export($export.S, 'Math', { return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0; } }); -},{"./_export":115}],346:[function(require,module,exports){ +},{"./_export":116}],347:[function(require,module,exports){ // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 var $export = require('./_export'); @@ -51060,7 +51663,7 @@ $export($export.S, 'Math', { return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16); } }); -},{"./_export":115}],347:[function(require,module,exports){ +},{"./_export":116}],348:[function(require,module,exports){ // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 var $export = require('./_export'); @@ -51072,7 +51675,7 @@ $export($export.S, 'Math', { return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0; } }); -},{"./_export":115}],348:[function(require,module,exports){ +},{"./_export":116}],349:[function(require,module,exports){ // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 var $export = require('./_export'); @@ -51089,7 +51692,7 @@ $export($export.S, 'Math', { return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16); } }); -},{"./_export":115}],349:[function(require,module,exports){ +},{"./_export":116}],350:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , toObject = require('./_to-object') @@ -51102,7 +51705,7 @@ require('./_descriptors') && $export($export.P + require('./_object-forced-pam') $defineProperty.f(toObject(this), P, {get: aFunction(getter), enumerable: true, configurable: true}); } }); -},{"./_a-function":86,"./_descriptors":111,"./_export":115,"./_object-dp":150,"./_object-forced-pam":152,"./_to-object":192}],350:[function(require,module,exports){ +},{"./_a-function":87,"./_descriptors":112,"./_export":116,"./_object-dp":151,"./_object-forced-pam":153,"./_to-object":193}],351:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , toObject = require('./_to-object') @@ -51115,7 +51718,7 @@ require('./_descriptors') && $export($export.P + require('./_object-forced-pam') $defineProperty.f(toObject(this), P, {set: aFunction(setter), enumerable: true, configurable: true}); } }); -},{"./_a-function":86,"./_descriptors":111,"./_export":115,"./_object-dp":150,"./_object-forced-pam":152,"./_to-object":192}],351:[function(require,module,exports){ +},{"./_a-function":87,"./_descriptors":112,"./_export":116,"./_object-dp":151,"./_object-forced-pam":153,"./_to-object":193}],352:[function(require,module,exports){ // https://github.com/tc39/proposal-object-values-entries var $export = require('./_export') , $entries = require('./_object-to-array')(true); @@ -51125,7 +51728,7 @@ $export($export.S, 'Object', { return $entries(it); } }); -},{"./_export":115,"./_object-to-array":162}],352:[function(require,module,exports){ +},{"./_export":116,"./_object-to-array":163}],353:[function(require,module,exports){ // https://github.com/tc39/proposal-object-getownpropertydescriptors var $export = require('./_export') , ownKeys = require('./_own-keys') @@ -51145,7 +51748,7 @@ $export($export.S, 'Object', { return result; } }); -},{"./_create-property":107,"./_export":115,"./_object-gopd":153,"./_own-keys":163,"./_to-iobject":190}],353:[function(require,module,exports){ +},{"./_create-property":108,"./_export":116,"./_object-gopd":154,"./_own-keys":164,"./_to-iobject":191}],354:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , toObject = require('./_to-object') @@ -51164,7 +51767,7 @@ require('./_descriptors') && $export($export.P + require('./_object-forced-pam') } while(O = getPrototypeOf(O)); } }); -},{"./_descriptors":111,"./_export":115,"./_object-forced-pam":152,"./_object-gopd":153,"./_object-gpo":157,"./_to-object":192,"./_to-primitive":193}],354:[function(require,module,exports){ +},{"./_descriptors":112,"./_export":116,"./_object-forced-pam":153,"./_object-gopd":154,"./_object-gpo":158,"./_to-object":193,"./_to-primitive":194}],355:[function(require,module,exports){ 'use strict'; var $export = require('./_export') , toObject = require('./_to-object') @@ -51183,7 +51786,7 @@ require('./_descriptors') && $export($export.P + require('./_object-forced-pam') } while(O = getPrototypeOf(O)); } }); -},{"./_descriptors":111,"./_export":115,"./_object-forced-pam":152,"./_object-gopd":153,"./_object-gpo":157,"./_to-object":192,"./_to-primitive":193}],355:[function(require,module,exports){ +},{"./_descriptors":112,"./_export":116,"./_object-forced-pam":153,"./_object-gopd":154,"./_object-gpo":158,"./_to-object":193,"./_to-primitive":194}],356:[function(require,module,exports){ // https://github.com/tc39/proposal-object-values-entries var $export = require('./_export') , $values = require('./_object-to-array')(false); @@ -51193,7 +51796,7 @@ $export($export.S, 'Object', { return $values(it); } }); -},{"./_export":115,"./_object-to-array":162}],356:[function(require,module,exports){ +},{"./_export":116,"./_object-to-array":163}],357:[function(require,module,exports){ 'use strict'; // https://github.com/zenparsing/es-observable var $export = require('./_export') @@ -51393,7 +51996,7 @@ hide($Observable.prototype, OBSERVABLE, function(){ return this; }); $export($export.G, {Observable: $Observable}); require('./_set-species')('Observable'); -},{"./_a-function":86,"./_an-instance":89,"./_an-object":90,"./_core":106,"./_export":115,"./_for-of":120,"./_global":121,"./_hide":123,"./_microtask":147,"./_redefine-all":169,"./_set-species":174,"./_wks":200}],357:[function(require,module,exports){ +},{"./_a-function":87,"./_an-instance":90,"./_an-object":91,"./_core":107,"./_export":116,"./_for-of":121,"./_global":122,"./_hide":124,"./_microtask":148,"./_redefine-all":170,"./_set-species":175,"./_wks":201}],358:[function(require,module,exports){ var metadata = require('./_metadata') , anObject = require('./_an-object') , toMetaKey = metadata.key @@ -51402,7 +52005,7 @@ var metadata = require('./_metadata') metadata.exp({defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey){ ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey)); }}); -},{"./_an-object":90,"./_metadata":146}],358:[function(require,module,exports){ +},{"./_an-object":91,"./_metadata":147}],359:[function(require,module,exports){ var metadata = require('./_metadata') , anObject = require('./_an-object') , toMetaKey = metadata.key @@ -51418,7 +52021,7 @@ metadata.exp({deleteMetadata: function deleteMetadata(metadataKey, target /*, ta targetMetadata['delete'](targetKey); return !!targetMetadata.size || store['delete'](target); }}); -},{"./_an-object":90,"./_metadata":146}],359:[function(require,module,exports){ +},{"./_an-object":91,"./_metadata":147}],360:[function(require,module,exports){ var Set = require('./es6.set') , from = require('./_array-from-iterable') , metadata = require('./_metadata') @@ -51438,7 +52041,7 @@ var ordinaryMetadataKeys = function(O, P){ metadata.exp({getMetadataKeys: function getMetadataKeys(target /*, targetKey */){ return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); }}); -},{"./_an-object":90,"./_array-from-iterable":93,"./_metadata":146,"./_object-gpo":157,"./es6.set":304}],360:[function(require,module,exports){ +},{"./_an-object":91,"./_array-from-iterable":94,"./_metadata":147,"./_object-gpo":158,"./es6.set":305}],361:[function(require,module,exports){ var metadata = require('./_metadata') , anObject = require('./_an-object') , getPrototypeOf = require('./_object-gpo') @@ -51456,7 +52059,7 @@ var ordinaryGetMetadata = function(MetadataKey, O, P){ metadata.exp({getMetadata: function getMetadata(metadataKey, target /*, targetKey */){ return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); }}); -},{"./_an-object":90,"./_metadata":146,"./_object-gpo":157}],361:[function(require,module,exports){ +},{"./_an-object":91,"./_metadata":147,"./_object-gpo":158}],362:[function(require,module,exports){ var metadata = require('./_metadata') , anObject = require('./_an-object') , ordinaryOwnMetadataKeys = metadata.keys @@ -51465,7 +52068,7 @@ var metadata = require('./_metadata') metadata.exp({getOwnMetadataKeys: function getOwnMetadataKeys(target /*, targetKey */){ return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); }}); -},{"./_an-object":90,"./_metadata":146}],362:[function(require,module,exports){ +},{"./_an-object":91,"./_metadata":147}],363:[function(require,module,exports){ var metadata = require('./_metadata') , anObject = require('./_an-object') , ordinaryGetOwnMetadata = metadata.get @@ -51475,7 +52078,7 @@ metadata.exp({getOwnMetadata: function getOwnMetadata(metadataKey, target /*, ta return ordinaryGetOwnMetadata(metadataKey, anObject(target) , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); }}); -},{"./_an-object":90,"./_metadata":146}],363:[function(require,module,exports){ +},{"./_an-object":91,"./_metadata":147}],364:[function(require,module,exports){ var metadata = require('./_metadata') , anObject = require('./_an-object') , getPrototypeOf = require('./_object-gpo') @@ -51492,7 +52095,7 @@ var ordinaryHasMetadata = function(MetadataKey, O, P){ metadata.exp({hasMetadata: function hasMetadata(metadataKey, target /*, targetKey */){ return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); }}); -},{"./_an-object":90,"./_metadata":146,"./_object-gpo":157}],364:[function(require,module,exports){ +},{"./_an-object":91,"./_metadata":147,"./_object-gpo":158}],365:[function(require,module,exports){ var metadata = require('./_metadata') , anObject = require('./_an-object') , ordinaryHasOwnMetadata = metadata.has @@ -51502,7 +52105,7 @@ metadata.exp({hasOwnMetadata: function hasOwnMetadata(metadataKey, target /*, ta return ordinaryHasOwnMetadata(metadataKey, anObject(target) , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); }}); -},{"./_an-object":90,"./_metadata":146}],365:[function(require,module,exports){ +},{"./_an-object":91,"./_metadata":147}],366:[function(require,module,exports){ var metadata = require('./_metadata') , anObject = require('./_an-object') , aFunction = require('./_a-function') @@ -51518,12 +52121,12 @@ metadata.exp({metadata: function metadata(metadataKey, metadataValue){ ); }; }}); -},{"./_a-function":86,"./_an-object":90,"./_metadata":146}],366:[function(require,module,exports){ +},{"./_a-function":87,"./_an-object":91,"./_metadata":147}],367:[function(require,module,exports){ // https://github.com/DavidBruant/Map-Set.prototype.toJSON var $export = require('./_export'); $export($export.P + $export.R, 'Set', {toJSON: require('./_collection-to-json')('Set')}); -},{"./_collection-to-json":103,"./_export":115}],367:[function(require,module,exports){ +},{"./_collection-to-json":104,"./_export":116}],368:[function(require,module,exports){ 'use strict'; // https://github.com/mathiasbynens/String.prototype.at var $export = require('./_export') @@ -51534,7 +52137,7 @@ $export($export.P, 'String', { return $at(this, pos); } }); -},{"./_export":115,"./_string-at":180}],368:[function(require,module,exports){ +},{"./_export":116,"./_string-at":181}],369:[function(require,module,exports){ 'use strict'; // https://tc39.github.io/String.prototype.matchAll/ var $export = require('./_export') @@ -51565,7 +52168,7 @@ $export($export.P, 'String', { return new $RegExpStringIterator(rx, S); } }); -},{"./_defined":110,"./_export":115,"./_flags":119,"./_is-regexp":133,"./_iter-create":135,"./_to-length":191}],369:[function(require,module,exports){ +},{"./_defined":111,"./_export":116,"./_flags":120,"./_is-regexp":134,"./_iter-create":136,"./_to-length":192}],370:[function(require,module,exports){ 'use strict'; // https://github.com/tc39/proposal-string-pad-start-end var $export = require('./_export') @@ -51576,7 +52179,7 @@ $export($export.P, 'String', { return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false); } }); -},{"./_export":115,"./_string-pad":183}],370:[function(require,module,exports){ +},{"./_export":116,"./_string-pad":184}],371:[function(require,module,exports){ 'use strict'; // https://github.com/tc39/proposal-string-pad-start-end var $export = require('./_export') @@ -51587,7 +52190,7 @@ $export($export.P, 'String', { return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true); } }); -},{"./_export":115,"./_string-pad":183}],371:[function(require,module,exports){ +},{"./_export":116,"./_string-pad":184}],372:[function(require,module,exports){ 'use strict'; // https://github.com/sebmarkbage/ecmascript-string-left-right-trim require('./_string-trim')('trimLeft', function($trim){ @@ -51595,7 +52198,7 @@ require('./_string-trim')('trimLeft', function($trim){ return $trim(this, 1); }; }, 'trimStart'); -},{"./_string-trim":185}],372:[function(require,module,exports){ +},{"./_string-trim":186}],373:[function(require,module,exports){ 'use strict'; // https://github.com/sebmarkbage/ecmascript-string-left-right-trim require('./_string-trim')('trimRight', function($trim){ @@ -51603,16 +52206,16 @@ require('./_string-trim')('trimRight', function($trim){ return $trim(this, 2); }; }, 'trimEnd'); -},{"./_string-trim":185}],373:[function(require,module,exports){ +},{"./_string-trim":186}],374:[function(require,module,exports){ require('./_wks-define')('asyncIterator'); -},{"./_wks-define":198}],374:[function(require,module,exports){ +},{"./_wks-define":199}],375:[function(require,module,exports){ require('./_wks-define')('observable'); -},{"./_wks-define":198}],375:[function(require,module,exports){ +},{"./_wks-define":199}],376:[function(require,module,exports){ // https://github.com/ljharb/proposal-global var $export = require('./_export'); $export($export.S, 'System', {global: require('./_global')}); -},{"./_export":115,"./_global":121}],376:[function(require,module,exports){ +},{"./_export":116,"./_global":122}],377:[function(require,module,exports){ var $iterators = require('./es6.array.iterator') , redefine = require('./_redefine') , global = require('./_global') @@ -51635,14 +52238,14 @@ for(var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList' for(key in $iterators)if(!proto[key])redefine(proto, key, $iterators[key], true); } } -},{"./_global":121,"./_hide":123,"./_iterators":139,"./_redefine":170,"./_wks":200,"./es6.array.iterator":214}],377:[function(require,module,exports){ +},{"./_global":122,"./_hide":124,"./_iterators":140,"./_redefine":171,"./_wks":201,"./es6.array.iterator":215}],378:[function(require,module,exports){ var $export = require('./_export') , $task = require('./_task'); $export($export.G + $export.B, { setImmediate: $task.set, clearImmediate: $task.clear }); -},{"./_export":115,"./_task":187}],378:[function(require,module,exports){ +},{"./_export":116,"./_task":188}],379:[function(require,module,exports){ // ie9- setTimeout & setInterval additional parameters fix var global = require('./_global') , $export = require('./_export') @@ -51663,7 +52266,7 @@ $export($export.G + $export.B + $export.F * MSIE, { setTimeout: wrap(global.setTimeout), setInterval: wrap(global.setInterval) }); -},{"./_export":115,"./_global":121,"./_invoke":127,"./_partial":166}],379:[function(require,module,exports){ +},{"./_export":116,"./_global":122,"./_invoke":128,"./_partial":167}],380:[function(require,module,exports){ require('./modules/es6.symbol'); require('./modules/es6.object.create'); require('./modules/es6.object.define-property'); @@ -51840,7 +52443,7 @@ require('./modules/web.timers'); require('./modules/web.immediate'); require('./modules/web.dom.iterable'); module.exports = require('./modules/_core'); -},{"./modules/_core":106,"./modules/es6.array.copy-within":204,"./modules/es6.array.every":205,"./modules/es6.array.fill":206,"./modules/es6.array.filter":207,"./modules/es6.array.find":209,"./modules/es6.array.find-index":208,"./modules/es6.array.for-each":210,"./modules/es6.array.from":211,"./modules/es6.array.index-of":212,"./modules/es6.array.is-array":213,"./modules/es6.array.iterator":214,"./modules/es6.array.join":215,"./modules/es6.array.last-index-of":216,"./modules/es6.array.map":217,"./modules/es6.array.of":218,"./modules/es6.array.reduce":220,"./modules/es6.array.reduce-right":219,"./modules/es6.array.slice":221,"./modules/es6.array.some":222,"./modules/es6.array.sort":223,"./modules/es6.array.species":224,"./modules/es6.date.now":225,"./modules/es6.date.to-iso-string":226,"./modules/es6.date.to-json":227,"./modules/es6.date.to-primitive":228,"./modules/es6.date.to-string":229,"./modules/es6.function.bind":230,"./modules/es6.function.has-instance":231,"./modules/es6.function.name":232,"./modules/es6.map":233,"./modules/es6.math.acosh":234,"./modules/es6.math.asinh":235,"./modules/es6.math.atanh":236,"./modules/es6.math.cbrt":237,"./modules/es6.math.clz32":238,"./modules/es6.math.cosh":239,"./modules/es6.math.expm1":240,"./modules/es6.math.fround":241,"./modules/es6.math.hypot":242,"./modules/es6.math.imul":243,"./modules/es6.math.log10":244,"./modules/es6.math.log1p":245,"./modules/es6.math.log2":246,"./modules/es6.math.sign":247,"./modules/es6.math.sinh":248,"./modules/es6.math.tanh":249,"./modules/es6.math.trunc":250,"./modules/es6.number.constructor":251,"./modules/es6.number.epsilon":252,"./modules/es6.number.is-finite":253,"./modules/es6.number.is-integer":254,"./modules/es6.number.is-nan":255,"./modules/es6.number.is-safe-integer":256,"./modules/es6.number.max-safe-integer":257,"./modules/es6.number.min-safe-integer":258,"./modules/es6.number.parse-float":259,"./modules/es6.number.parse-int":260,"./modules/es6.number.to-fixed":261,"./modules/es6.number.to-precision":262,"./modules/es6.object.assign":263,"./modules/es6.object.create":264,"./modules/es6.object.define-properties":265,"./modules/es6.object.define-property":266,"./modules/es6.object.freeze":267,"./modules/es6.object.get-own-property-descriptor":268,"./modules/es6.object.get-own-property-names":269,"./modules/es6.object.get-prototype-of":270,"./modules/es6.object.is":274,"./modules/es6.object.is-extensible":271,"./modules/es6.object.is-frozen":272,"./modules/es6.object.is-sealed":273,"./modules/es6.object.keys":275,"./modules/es6.object.prevent-extensions":276,"./modules/es6.object.seal":277,"./modules/es6.object.set-prototype-of":278,"./modules/es6.object.to-string":279,"./modules/es6.parse-float":280,"./modules/es6.parse-int":281,"./modules/es6.promise":282,"./modules/es6.reflect.apply":283,"./modules/es6.reflect.construct":284,"./modules/es6.reflect.define-property":285,"./modules/es6.reflect.delete-property":286,"./modules/es6.reflect.enumerate":287,"./modules/es6.reflect.get":290,"./modules/es6.reflect.get-own-property-descriptor":288,"./modules/es6.reflect.get-prototype-of":289,"./modules/es6.reflect.has":291,"./modules/es6.reflect.is-extensible":292,"./modules/es6.reflect.own-keys":293,"./modules/es6.reflect.prevent-extensions":294,"./modules/es6.reflect.set":296,"./modules/es6.reflect.set-prototype-of":295,"./modules/es6.regexp.constructor":297,"./modules/es6.regexp.flags":298,"./modules/es6.regexp.match":299,"./modules/es6.regexp.replace":300,"./modules/es6.regexp.search":301,"./modules/es6.regexp.split":302,"./modules/es6.regexp.to-string":303,"./modules/es6.set":304,"./modules/es6.string.anchor":305,"./modules/es6.string.big":306,"./modules/es6.string.blink":307,"./modules/es6.string.bold":308,"./modules/es6.string.code-point-at":309,"./modules/es6.string.ends-with":310,"./modules/es6.string.fixed":311,"./modules/es6.string.fontcolor":312,"./modules/es6.string.fontsize":313,"./modules/es6.string.from-code-point":314,"./modules/es6.string.includes":315,"./modules/es6.string.italics":316,"./modules/es6.string.iterator":317,"./modules/es6.string.link":318,"./modules/es6.string.raw":319,"./modules/es6.string.repeat":320,"./modules/es6.string.small":321,"./modules/es6.string.starts-with":322,"./modules/es6.string.strike":323,"./modules/es6.string.sub":324,"./modules/es6.string.sup":325,"./modules/es6.string.trim":326,"./modules/es6.symbol":327,"./modules/es6.typed.array-buffer":328,"./modules/es6.typed.data-view":329,"./modules/es6.typed.float32-array":330,"./modules/es6.typed.float64-array":331,"./modules/es6.typed.int16-array":332,"./modules/es6.typed.int32-array":333,"./modules/es6.typed.int8-array":334,"./modules/es6.typed.uint16-array":335,"./modules/es6.typed.uint32-array":336,"./modules/es6.typed.uint8-array":337,"./modules/es6.typed.uint8-clamped-array":338,"./modules/es6.weak-map":339,"./modules/es6.weak-set":340,"./modules/es7.array.includes":341,"./modules/es7.asap":342,"./modules/es7.error.is-error":343,"./modules/es7.map.to-json":344,"./modules/es7.math.iaddh":345,"./modules/es7.math.imulh":346,"./modules/es7.math.isubh":347,"./modules/es7.math.umulh":348,"./modules/es7.object.define-getter":349,"./modules/es7.object.define-setter":350,"./modules/es7.object.entries":351,"./modules/es7.object.get-own-property-descriptors":352,"./modules/es7.object.lookup-getter":353,"./modules/es7.object.lookup-setter":354,"./modules/es7.object.values":355,"./modules/es7.observable":356,"./modules/es7.reflect.define-metadata":357,"./modules/es7.reflect.delete-metadata":358,"./modules/es7.reflect.get-metadata":360,"./modules/es7.reflect.get-metadata-keys":359,"./modules/es7.reflect.get-own-metadata":362,"./modules/es7.reflect.get-own-metadata-keys":361,"./modules/es7.reflect.has-metadata":363,"./modules/es7.reflect.has-own-metadata":364,"./modules/es7.reflect.metadata":365,"./modules/es7.set.to-json":366,"./modules/es7.string.at":367,"./modules/es7.string.match-all":368,"./modules/es7.string.pad-end":369,"./modules/es7.string.pad-start":370,"./modules/es7.string.trim-left":371,"./modules/es7.string.trim-right":372,"./modules/es7.symbol.async-iterator":373,"./modules/es7.symbol.observable":374,"./modules/es7.system.global":375,"./modules/web.dom.iterable":376,"./modules/web.immediate":377,"./modules/web.timers":378}],380:[function(require,module,exports){ +},{"./modules/_core":107,"./modules/es6.array.copy-within":205,"./modules/es6.array.every":206,"./modules/es6.array.fill":207,"./modules/es6.array.filter":208,"./modules/es6.array.find":210,"./modules/es6.array.find-index":209,"./modules/es6.array.for-each":211,"./modules/es6.array.from":212,"./modules/es6.array.index-of":213,"./modules/es6.array.is-array":214,"./modules/es6.array.iterator":215,"./modules/es6.array.join":216,"./modules/es6.array.last-index-of":217,"./modules/es6.array.map":218,"./modules/es6.array.of":219,"./modules/es6.array.reduce":221,"./modules/es6.array.reduce-right":220,"./modules/es6.array.slice":222,"./modules/es6.array.some":223,"./modules/es6.array.sort":224,"./modules/es6.array.species":225,"./modules/es6.date.now":226,"./modules/es6.date.to-iso-string":227,"./modules/es6.date.to-json":228,"./modules/es6.date.to-primitive":229,"./modules/es6.date.to-string":230,"./modules/es6.function.bind":231,"./modules/es6.function.has-instance":232,"./modules/es6.function.name":233,"./modules/es6.map":234,"./modules/es6.math.acosh":235,"./modules/es6.math.asinh":236,"./modules/es6.math.atanh":237,"./modules/es6.math.cbrt":238,"./modules/es6.math.clz32":239,"./modules/es6.math.cosh":240,"./modules/es6.math.expm1":241,"./modules/es6.math.fround":242,"./modules/es6.math.hypot":243,"./modules/es6.math.imul":244,"./modules/es6.math.log10":245,"./modules/es6.math.log1p":246,"./modules/es6.math.log2":247,"./modules/es6.math.sign":248,"./modules/es6.math.sinh":249,"./modules/es6.math.tanh":250,"./modules/es6.math.trunc":251,"./modules/es6.number.constructor":252,"./modules/es6.number.epsilon":253,"./modules/es6.number.is-finite":254,"./modules/es6.number.is-integer":255,"./modules/es6.number.is-nan":256,"./modules/es6.number.is-safe-integer":257,"./modules/es6.number.max-safe-integer":258,"./modules/es6.number.min-safe-integer":259,"./modules/es6.number.parse-float":260,"./modules/es6.number.parse-int":261,"./modules/es6.number.to-fixed":262,"./modules/es6.number.to-precision":263,"./modules/es6.object.assign":264,"./modules/es6.object.create":265,"./modules/es6.object.define-properties":266,"./modules/es6.object.define-property":267,"./modules/es6.object.freeze":268,"./modules/es6.object.get-own-property-descriptor":269,"./modules/es6.object.get-own-property-names":270,"./modules/es6.object.get-prototype-of":271,"./modules/es6.object.is":275,"./modules/es6.object.is-extensible":272,"./modules/es6.object.is-frozen":273,"./modules/es6.object.is-sealed":274,"./modules/es6.object.keys":276,"./modules/es6.object.prevent-extensions":277,"./modules/es6.object.seal":278,"./modules/es6.object.set-prototype-of":279,"./modules/es6.object.to-string":280,"./modules/es6.parse-float":281,"./modules/es6.parse-int":282,"./modules/es6.promise":283,"./modules/es6.reflect.apply":284,"./modules/es6.reflect.construct":285,"./modules/es6.reflect.define-property":286,"./modules/es6.reflect.delete-property":287,"./modules/es6.reflect.enumerate":288,"./modules/es6.reflect.get":291,"./modules/es6.reflect.get-own-property-descriptor":289,"./modules/es6.reflect.get-prototype-of":290,"./modules/es6.reflect.has":292,"./modules/es6.reflect.is-extensible":293,"./modules/es6.reflect.own-keys":294,"./modules/es6.reflect.prevent-extensions":295,"./modules/es6.reflect.set":297,"./modules/es6.reflect.set-prototype-of":296,"./modules/es6.regexp.constructor":298,"./modules/es6.regexp.flags":299,"./modules/es6.regexp.match":300,"./modules/es6.regexp.replace":301,"./modules/es6.regexp.search":302,"./modules/es6.regexp.split":303,"./modules/es6.regexp.to-string":304,"./modules/es6.set":305,"./modules/es6.string.anchor":306,"./modules/es6.string.big":307,"./modules/es6.string.blink":308,"./modules/es6.string.bold":309,"./modules/es6.string.code-point-at":310,"./modules/es6.string.ends-with":311,"./modules/es6.string.fixed":312,"./modules/es6.string.fontcolor":313,"./modules/es6.string.fontsize":314,"./modules/es6.string.from-code-point":315,"./modules/es6.string.includes":316,"./modules/es6.string.italics":317,"./modules/es6.string.iterator":318,"./modules/es6.string.link":319,"./modules/es6.string.raw":320,"./modules/es6.string.repeat":321,"./modules/es6.string.small":322,"./modules/es6.string.starts-with":323,"./modules/es6.string.strike":324,"./modules/es6.string.sub":325,"./modules/es6.string.sup":326,"./modules/es6.string.trim":327,"./modules/es6.symbol":328,"./modules/es6.typed.array-buffer":329,"./modules/es6.typed.data-view":330,"./modules/es6.typed.float32-array":331,"./modules/es6.typed.float64-array":332,"./modules/es6.typed.int16-array":333,"./modules/es6.typed.int32-array":334,"./modules/es6.typed.int8-array":335,"./modules/es6.typed.uint16-array":336,"./modules/es6.typed.uint32-array":337,"./modules/es6.typed.uint8-array":338,"./modules/es6.typed.uint8-clamped-array":339,"./modules/es6.weak-map":340,"./modules/es6.weak-set":341,"./modules/es7.array.includes":342,"./modules/es7.asap":343,"./modules/es7.error.is-error":344,"./modules/es7.map.to-json":345,"./modules/es7.math.iaddh":346,"./modules/es7.math.imulh":347,"./modules/es7.math.isubh":348,"./modules/es7.math.umulh":349,"./modules/es7.object.define-getter":350,"./modules/es7.object.define-setter":351,"./modules/es7.object.entries":352,"./modules/es7.object.get-own-property-descriptors":353,"./modules/es7.object.lookup-getter":354,"./modules/es7.object.lookup-setter":355,"./modules/es7.object.values":356,"./modules/es7.observable":357,"./modules/es7.reflect.define-metadata":358,"./modules/es7.reflect.delete-metadata":359,"./modules/es7.reflect.get-metadata":361,"./modules/es7.reflect.get-metadata-keys":360,"./modules/es7.reflect.get-own-metadata":363,"./modules/es7.reflect.get-own-metadata-keys":362,"./modules/es7.reflect.has-metadata":364,"./modules/es7.reflect.has-own-metadata":365,"./modules/es7.reflect.metadata":366,"./modules/es7.set.to-json":367,"./modules/es7.string.at":368,"./modules/es7.string.match-all":369,"./modules/es7.string.pad-end":370,"./modules/es7.string.pad-start":371,"./modules/es7.string.trim-left":372,"./modules/es7.string.trim-right":373,"./modules/es7.symbol.async-iterator":374,"./modules/es7.symbol.observable":375,"./modules/es7.system.global":376,"./modules/web.dom.iterable":377,"./modules/web.immediate":378,"./modules/web.timers":379}],381:[function(require,module,exports){ (function (Buffer){ // Copyright Joyent, Inc. and other Node contributors. // @@ -51951,7 +52554,7 @@ function objectToString(o) { } }).call(this,{"isBuffer":require("../../is-buffer/index.js")}) -},{"../../is-buffer/index.js":429}],381:[function(require,module,exports){ +},{"../../is-buffer/index.js":430}],382:[function(require,module,exports){ (function (Buffer){ var elliptic = require('elliptic'); var BN = require('bn.js'); @@ -52077,7 +52680,7 @@ function formatReturnValue(bn, enc, len) { } }).call(this,require("buffer").Buffer) -},{"bn.js":53,"buffer":83,"elliptic":397}],382:[function(require,module,exports){ +},{"bn.js":54,"buffer":84,"elliptic":398}],383:[function(require,module,exports){ (function (Buffer){ 'use strict'; var inherits = require('inherits') @@ -52133,7 +52736,7 @@ module.exports = function createHash (alg) { } }).call(this,require("buffer").Buffer) -},{"./md5":384,"buffer":83,"cipher-base":84,"inherits":428,"ripemd160":461,"sha.js":470}],383:[function(require,module,exports){ +},{"./md5":385,"buffer":84,"cipher-base":85,"inherits":429,"ripemd160":461,"sha.js":470}],384:[function(require,module,exports){ (function (Buffer){ 'use strict'; var intSize = 4; @@ -52170,7 +52773,7 @@ function hash(buf, fn, hashSize, bigEndian) { } exports.hash = hash; }).call(this,require("buffer").Buffer) -},{"buffer":83}],384:[function(require,module,exports){ +},{"buffer":84}],385:[function(require,module,exports){ 'use strict'; /* * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message @@ -52327,7 +52930,7 @@ function bit_rol(num, cnt) module.exports = function md5(buf) { return helpers.hash(buf, core_md5, 16); }; -},{"./helpers":383}],385:[function(require,module,exports){ +},{"./helpers":384}],386:[function(require,module,exports){ (function (Buffer){ 'use strict'; var createHash = require('create-hash/browser'); @@ -52399,7 +53002,7 @@ module.exports = function createHmac(alg, key) { } }).call(this,require("buffer").Buffer) -},{"buffer":83,"create-hash/browser":382,"inherits":428,"stream":477}],386:[function(require,module,exports){ +},{"buffer":84,"create-hash/browser":383,"inherits":429,"stream":477}],387:[function(require,module,exports){ 'use strict' exports.randomBytes = exports.rng = exports.pseudoRandomBytes = exports.prng = require('randombytes') @@ -52478,7 +53081,7 @@ var publicEncrypt = require('public-encrypt') } }) -},{"browserify-cipher":71,"browserify-sign":77,"browserify-sign/algos":76,"create-ecdh":381,"create-hash":382,"create-hmac":385,"diffie-hellman":393,"pbkdf2":440,"public-encrypt":443,"randombytes":449}],387:[function(require,module,exports){ +},{"browserify-cipher":72,"browserify-sign":78,"browserify-sign/algos":77,"create-ecdh":382,"create-hash":383,"create-hmac":386,"diffie-hellman":394,"pbkdf2":441,"public-encrypt":444,"randombytes":450}],388:[function(require,module,exports){ 'use strict'; exports.utils = require('./des/utils'); @@ -52487,7 +53090,7 @@ exports.DES = require('./des/des'); exports.CBC = require('./des/cbc'); exports.EDE = require('./des/ede'); -},{"./des/cbc":388,"./des/cipher":389,"./des/des":390,"./des/ede":391,"./des/utils":392}],388:[function(require,module,exports){ +},{"./des/cbc":389,"./des/cipher":390,"./des/des":391,"./des/ede":392,"./des/utils":393}],389:[function(require,module,exports){ 'use strict'; var assert = require('minimalistic-assert'); @@ -52554,7 +53157,7 @@ proto._update = function _update(inp, inOff, out, outOff) { } }; -},{"inherits":428,"minimalistic-assert":435}],389:[function(require,module,exports){ +},{"inherits":429,"minimalistic-assert":436}],390:[function(require,module,exports){ 'use strict'; var assert = require('minimalistic-assert'); @@ -52697,7 +53300,7 @@ Cipher.prototype._finalDecrypt = function _finalDecrypt() { return this._unpad(out); }; -},{"minimalistic-assert":435}],390:[function(require,module,exports){ +},{"minimalistic-assert":436}],391:[function(require,module,exports){ 'use strict'; var assert = require('minimalistic-assert'); @@ -52842,7 +53445,7 @@ DES.prototype._decrypt = function _decrypt(state, lStart, rStart, out, off) { utils.rip(l, r, out, off); }; -},{"../des":387,"inherits":428,"minimalistic-assert":435}],391:[function(require,module,exports){ +},{"../des":388,"inherits":429,"minimalistic-assert":436}],392:[function(require,module,exports){ 'use strict'; var assert = require('minimalistic-assert'); @@ -52899,7 +53502,7 @@ EDE.prototype._update = function _update(inp, inOff, out, outOff) { EDE.prototype._pad = DES.prototype._pad; EDE.prototype._unpad = DES.prototype._unpad; -},{"../des":387,"inherits":428,"minimalistic-assert":435}],392:[function(require,module,exports){ +},{"../des":388,"inherits":429,"minimalistic-assert":436}],393:[function(require,module,exports){ 'use strict'; exports.readUInt32BE = function readUInt32BE(bytes, off) { @@ -53157,7 +53760,7 @@ exports.padSplit = function padSplit(num, size, group) { return out.join(' '); }; -},{}],393:[function(require,module,exports){ +},{}],394:[function(require,module,exports){ (function (Buffer){ var generatePrime = require('./lib/generatePrime') var primes = require('./lib/primes.json') @@ -53203,7 +53806,7 @@ exports.DiffieHellmanGroup = exports.createDiffieHellmanGroup = exports.getDiffi exports.createDiffieHellman = exports.DiffieHellman = createDiffieHellman }).call(this,require("buffer").Buffer) -},{"./lib/dh":394,"./lib/generatePrime":395,"./lib/primes.json":396,"buffer":83}],394:[function(require,module,exports){ +},{"./lib/dh":395,"./lib/generatePrime":396,"./lib/primes.json":397,"buffer":84}],395:[function(require,module,exports){ (function (Buffer){ var BN = require('bn.js'); var MillerRabin = require('miller-rabin'); @@ -53371,7 +53974,7 @@ function formatReturnValue(bn, enc) { } }).call(this,require("buffer").Buffer) -},{"./generatePrime":395,"bn.js":53,"buffer":83,"miller-rabin":434,"randombytes":449}],395:[function(require,module,exports){ +},{"./generatePrime":396,"bn.js":54,"buffer":84,"miller-rabin":435,"randombytes":450}],396:[function(require,module,exports){ var randomBytes = require('randombytes'); module.exports = findPrime; findPrime.simpleSieve = simpleSieve; @@ -53478,7 +54081,7 @@ function findPrime(bits, gen) { } -},{"bn.js":53,"miller-rabin":434,"randombytes":449}],396:[function(require,module,exports){ +},{"bn.js":54,"miller-rabin":435,"randombytes":450}],397:[function(require,module,exports){ module.exports={ "modp1": { "gen": "02", @@ -53513,7 +54116,7 @@ module.exports={ "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff" } } -},{}],397:[function(require,module,exports){ +},{}],398:[function(require,module,exports){ 'use strict'; var elliptic = exports; @@ -53529,7 +54132,7 @@ elliptic.curves = require('./elliptic/curves'); elliptic.ec = require('./elliptic/ec'); elliptic.eddsa = require('./elliptic/eddsa'); -},{"../package.json":413,"./elliptic/curve":400,"./elliptic/curves":403,"./elliptic/ec":404,"./elliptic/eddsa":407,"./elliptic/hmac-drbg":410,"./elliptic/utils":412,"brorand":54}],398:[function(require,module,exports){ +},{"../package.json":414,"./elliptic/curve":401,"./elliptic/curves":404,"./elliptic/ec":405,"./elliptic/eddsa":408,"./elliptic/hmac-drbg":411,"./elliptic/utils":413,"brorand":55}],399:[function(require,module,exports){ 'use strict'; var BN = require('bn.js'); @@ -53882,7 +54485,7 @@ BasePoint.prototype.dblp = function dblp(k) { return r; }; -},{"../../elliptic":397,"bn.js":53}],399:[function(require,module,exports){ +},{"../../elliptic":398,"bn.js":54}],400:[function(require,module,exports){ 'use strict'; var curve = require('../curve'); @@ -54294,7 +54897,7 @@ Point.prototype.eq = function eq(other) { Point.prototype.toP = Point.prototype.normalize; Point.prototype.mixedAdd = Point.prototype.add; -},{"../../elliptic":397,"../curve":400,"bn.js":53,"inherits":428}],400:[function(require,module,exports){ +},{"../../elliptic":398,"../curve":401,"bn.js":54,"inherits":429}],401:[function(require,module,exports){ 'use strict'; var curve = exports; @@ -54304,7 +54907,7 @@ curve.short = require('./short'); curve.mont = require('./mont'); curve.edwards = require('./edwards'); -},{"./base":398,"./edwards":399,"./mont":401,"./short":402}],401:[function(require,module,exports){ +},{"./base":399,"./edwards":400,"./mont":402,"./short":403}],402:[function(require,module,exports){ 'use strict'; var curve = require('../curve'); @@ -54482,7 +55085,7 @@ Point.prototype.getX = function getX() { return this.x.fromRed(); }; -},{"../../elliptic":397,"../curve":400,"bn.js":53,"inherits":428}],402:[function(require,module,exports){ +},{"../../elliptic":398,"../curve":401,"bn.js":54,"inherits":429}],403:[function(require,module,exports){ 'use strict'; var curve = require('../curve'); @@ -55393,7 +55996,7 @@ JPoint.prototype.isInfinity = function isInfinity() { return this.z.cmpn(0) === 0; }; -},{"../../elliptic":397,"../curve":400,"bn.js":53,"inherits":428}],403:[function(require,module,exports){ +},{"../../elliptic":398,"../curve":401,"bn.js":54,"inherits":429}],404:[function(require,module,exports){ 'use strict'; var curves = exports; @@ -55600,7 +56203,7 @@ defineCurve('secp256k1', { ] }); -},{"../elliptic":397,"./precomputed/secp256k1":411,"hash.js":420}],404:[function(require,module,exports){ +},{"../elliptic":398,"./precomputed/secp256k1":412,"hash.js":421}],405:[function(require,module,exports){ 'use strict'; var BN = require('bn.js'); @@ -55824,7 +56427,7 @@ EC.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) { throw new Error('Unable to find valid recovery factor'); }; -},{"../../elliptic":397,"./key":405,"./signature":406,"bn.js":53}],405:[function(require,module,exports){ +},{"../../elliptic":398,"./key":406,"./signature":407,"bn.js":54}],406:[function(require,module,exports){ 'use strict'; var BN = require('bn.js'); @@ -55933,7 +56536,7 @@ KeyPair.prototype.inspect = function inspect() { ' pub: ' + (this.pub && this.pub.inspect()) + ' >'; }; -},{"bn.js":53}],406:[function(require,module,exports){ +},{"bn.js":54}],407:[function(require,module,exports){ 'use strict'; var BN = require('bn.js'); @@ -56070,7 +56673,7 @@ Signature.prototype.toDER = function toDER(enc) { return utils.encode(res, enc); }; -},{"../../elliptic":397,"bn.js":53}],407:[function(require,module,exports){ +},{"../../elliptic":398,"bn.js":54}],408:[function(require,module,exports){ 'use strict'; var hash = require('hash.js'); @@ -56190,7 +56793,7 @@ EDDSA.prototype.isPoint = function isPoint(val) { return val instanceof this.pointClass; }; -},{"../../elliptic":397,"./key":408,"./signature":409,"hash.js":420}],408:[function(require,module,exports){ +},{"../../elliptic":398,"./key":409,"./signature":410,"hash.js":421}],409:[function(require,module,exports){ 'use strict'; var elliptic = require('../../elliptic'); @@ -56288,7 +56891,7 @@ KeyPair.prototype.getPublic = function getPublic(enc) { module.exports = KeyPair; -},{"../../elliptic":397}],409:[function(require,module,exports){ +},{"../../elliptic":398}],410:[function(require,module,exports){ 'use strict'; var BN = require('bn.js'); @@ -56356,7 +56959,7 @@ Signature.prototype.toHex = function toHex() { module.exports = Signature; -},{"../../elliptic":397,"bn.js":53}],410:[function(require,module,exports){ +},{"../../elliptic":398,"bn.js":54}],411:[function(require,module,exports){ 'use strict'; var hash = require('hash.js'); @@ -56472,7 +57075,7 @@ HmacDRBG.prototype.generate = function generate(len, enc, add, addEnc) { return utils.encode(res, enc); }; -},{"../elliptic":397,"hash.js":420}],411:[function(require,module,exports){ +},{"../elliptic":398,"hash.js":421}],412:[function(require,module,exports){ module.exports = { doubles: { step: 4, @@ -57254,7 +57857,7 @@ module.exports = { } }; -},{}],412:[function(require,module,exports){ +},{}],413:[function(require,module,exports){ 'use strict'; var utils = exports; @@ -57428,12 +58031,12 @@ function intFromLE(bytes) { utils.intFromLE = intFromLE; -},{"bn.js":53}],413:[function(require,module,exports){ +},{"bn.js":54}],414:[function(require,module,exports){ module.exports={ "_args": [ [ "elliptic@^6.0.0", - "/Volumes/Macintosh HD/Users/TayTay/Documents/Dropbox/local-dev/etherwallet/node_modules/browserify-sign" + "C:\\Users\\Kosala\\Documents\\GitHub\\etherwallet\\node_modules\\browserify-sign" ] ], "_from": "elliptic@>=6.0.0 <7.0.0", @@ -57469,7 +58072,7 @@ module.exports={ "_shasum": "dce82efbf176eefa7495d4be3e8b9f5b5694b295", "_shrinkwrap": null, "_spec": "elliptic@^6.0.0", - "_where": "/Volumes/Macintosh HD/Users/TayTay/Documents/Dropbox/local-dev/etherwallet/node_modules/browserify-sign", + "_where": "C:\\Users\\Kosala\\Documents\\GitHub\\etherwallet\\node_modules\\browserify-sign", "author": { "email": "fedor@indutny.com", "name": "Fedor Indutny" @@ -57541,7 +58144,7 @@ module.exports={ "version": "6.2.7" } -},{}],414:[function(require,module,exports){ +},{}],415:[function(require,module,exports){ module.exports={ "genesisGasLimit": { "v": 5000, @@ -57774,10 +58377,10 @@ module.exports={ } } -},{}],415:[function(require,module,exports){ +},{}],416:[function(require,module,exports){ module.exports = require('./params.json') -},{"./params.json":414}],416:[function(require,module,exports){ +},{"./params.json":415}],417:[function(require,module,exports){ (function (global,Buffer){ const ethUtil = require('ethereumjs-util') const fees = require('ethereum-common/params') @@ -58037,7 +58640,7 @@ Transaction.prototype.validate = function (stringError) { } }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer) -},{"buffer":83,"ethereum-common/params":415,"ethereumjs-util":417}],417:[function(require,module,exports){ +},{"buffer":84,"ethereum-common/params":416,"ethereumjs-util":418}],418:[function(require,module,exports){ (function (Buffer){ const SHA3 = require('keccakjs') const secp256k1 = require('secp256k1') @@ -58706,7 +59309,7 @@ exports.defineProperties = function (self, fields, data) { } }).call(this,require("buffer").Buffer) -},{"assert":48,"bn.js":53,"buffer":83,"create-hash":382,"keccakjs":432,"rlp":462,"secp256k1":464}],418:[function(require,module,exports){ +},{"assert":48,"bn.js":54,"buffer":84,"create-hash":383,"keccakjs":433,"rlp":462,"secp256k1":464}],419:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -59006,7 +59609,7 @@ function isUndefined(arg) { return arg === void 0; } -},{}],419:[function(require,module,exports){ +},{}],420:[function(require,module,exports){ (function (Buffer){ var md5 = require('create-hash/md5') module.exports = EVP_BytesToKey @@ -59078,7 +59681,7 @@ function EVP_BytesToKey (password, salt, keyLen, ivLen) { } }).call(this,require("buffer").Buffer) -},{"buffer":83,"create-hash/md5":384}],420:[function(require,module,exports){ +},{"buffer":84,"create-hash/md5":385}],421:[function(require,module,exports){ var hash = exports; hash.utils = require('./hash/utils'); @@ -59095,7 +59698,7 @@ hash.sha384 = hash.sha.sha384; hash.sha512 = hash.sha.sha512; hash.ripemd160 = hash.ripemd.ripemd160; -},{"./hash/common":421,"./hash/hmac":422,"./hash/ripemd":423,"./hash/sha":424,"./hash/utils":425}],421:[function(require,module,exports){ +},{"./hash/common":422,"./hash/hmac":423,"./hash/ripemd":424,"./hash/sha":425,"./hash/utils":426}],422:[function(require,module,exports){ var hash = require('../hash'); var utils = hash.utils; var assert = utils.assert; @@ -59188,7 +59791,7 @@ BlockHash.prototype._pad = function pad() { return res; }; -},{"../hash":420}],422:[function(require,module,exports){ +},{"../hash":421}],423:[function(require,module,exports){ var hmac = exports; var hash = require('../hash'); @@ -59238,7 +59841,7 @@ Hmac.prototype.digest = function digest(enc) { return this.outer.digest(enc); }; -},{"../hash":420}],423:[function(require,module,exports){ +},{"../hash":421}],424:[function(require,module,exports){ var hash = require('../hash'); var utils = hash.utils; @@ -59384,7 +59987,7 @@ var sh = [ 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 ]; -},{"../hash":420}],424:[function(require,module,exports){ +},{"../hash":421}],425:[function(require,module,exports){ var hash = require('../hash'); var utils = hash.utils; var assert = utils.assert; @@ -59950,7 +60553,7 @@ function g1_512_lo(xh, xl) { return r; } -},{"../hash":420}],425:[function(require,module,exports){ +},{"../hash":421}],426:[function(require,module,exports){ var utils = exports; var inherits = require('inherits'); @@ -60209,7 +60812,7 @@ function shr64_lo(ah, al, num) { }; exports.shr64_lo = shr64_lo; -},{"inherits":428}],426:[function(require,module,exports){ +},{"inherits":429}],427:[function(require,module,exports){ exports.read = function (buffer, offset, isLE, mLen, nBytes) { var e, m var eLen = nBytes * 8 - mLen - 1 @@ -60295,7 +60898,7 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { buffer[offset + i - d] |= s * 128 } -},{}],427:[function(require,module,exports){ +},{}],428:[function(require,module,exports){ var indexOf = [].indexOf; @@ -60306,7 +60909,7 @@ module.exports = function(arr, obj){ } return -1; }; -},{}],428:[function(require,module,exports){ +},{}],429:[function(require,module,exports){ if (typeof Object.create === 'function') { // implementation from standard node.js 'util' module module.exports = function inherits(ctor, superCtor) { @@ -60331,7 +60934,7 @@ if (typeof Object.create === 'function') { } } -},{}],429:[function(require,module,exports){ +},{}],430:[function(require,module,exports){ /** * Determine if an object is Buffer * @@ -60350,14 +60953,14 @@ module.exports = function (obj) { )) } -},{}],430:[function(require,module,exports){ +},{}],431:[function(require,module,exports){ var toString = {}.toString; module.exports = Array.isArray || function (arr) { return toString.call(arr) == '[object Array]'; }; -},{}],431:[function(require,module,exports){ +},{}],432:[function(require,module,exports){ (function (global){ /* * js-sha3 v0.3.1 @@ -60793,10 +61396,10 @@ module.exports = Array.isArray || function (arr) { }(this)); }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],432:[function(require,module,exports){ +},{}],433:[function(require,module,exports){ module.exports = require('browserify-sha3').SHA3Hash -},{"browserify-sha3":75}],433:[function(require,module,exports){ +},{"browserify-sha3":76}],434:[function(require,module,exports){ (function (global){ /** * marked - a markdown parser @@ -62085,7 +62688,7 @@ if (typeof module !== 'undefined' && typeof exports === 'object') { }()); }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],434:[function(require,module,exports){ +},{}],435:[function(require,module,exports){ var bn = require('bn.js'); var brorand = require('brorand'); @@ -62200,7 +62803,7 @@ MillerRabin.prototype.getDivisor = function getDivisor(n, k) { return false; }; -},{"bn.js":53,"brorand":54}],435:[function(require,module,exports){ +},{"bn.js":54,"brorand":55}],436:[function(require,module,exports){ module.exports = assert; function assert(val, msg) { @@ -62213,7 +62816,7 @@ assert.equal = function assertEqual(l, r, msg) { throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r)); }; -},{}],436:[function(require,module,exports){ +},{}],437:[function(require,module,exports){ module.exports={"2.16.840.1.101.3.4.1.1": "aes-128-ecb", "2.16.840.1.101.3.4.1.2": "aes-128-cbc", "2.16.840.1.101.3.4.1.3": "aes-128-ofb", @@ -62227,7 +62830,7 @@ module.exports={"2.16.840.1.101.3.4.1.1": "aes-128-ecb", "2.16.840.1.101.3.4.1.43": "aes-256-ofb", "2.16.840.1.101.3.4.1.44": "aes-256-cfb" } -},{}],437:[function(require,module,exports){ +},{}],438:[function(require,module,exports){ // from https://github.com/indutny/self-signed/blob/gh-pages/lib/asn1.js // Fedor, you are amazing. @@ -62346,7 +62949,7 @@ exports.signature = asn1.define('signature', function () { ) }) -},{"asn1.js":34}],438:[function(require,module,exports){ +},{"asn1.js":34}],439:[function(require,module,exports){ (function (Buffer){ // adapted from https://github.com/apatil/pemstrip var findProc = /Proc-Type: 4,ENCRYPTED\r?\nDEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)\r?\n\r?\n([0-9A-z\n\r\+\/\=]+)\r?\n/m @@ -62380,7 +62983,7 @@ module.exports = function (okey, password) { } }).call(this,require("buffer").Buffer) -},{"browserify-aes":58,"buffer":83,"evp_bytestokey":419}],439:[function(require,module,exports){ +},{"browserify-aes":59,"buffer":84,"evp_bytestokey":420}],440:[function(require,module,exports){ (function (Buffer){ var asn1 = require('./asn1') var aesid = require('./aesid.json') @@ -62485,7 +63088,7 @@ function decrypt (data, password) { } }).call(this,require("buffer").Buffer) -},{"./aesid.json":436,"./asn1":437,"./fixProc":438,"browserify-aes":58,"buffer":83,"pbkdf2":440}],440:[function(require,module,exports){ +},{"./aesid.json":437,"./asn1":438,"./fixProc":439,"browserify-aes":59,"buffer":84,"pbkdf2":441}],441:[function(require,module,exports){ (function (Buffer){ var createHmac = require('create-hmac') var MAX_ALLOC = Math.pow(2, 30) - 1 // default in iojs @@ -62569,7 +63172,7 @@ function pbkdf2Sync (password, salt, iterations, keylen, digest) { } }).call(this,require("buffer").Buffer) -},{"buffer":83,"create-hmac":385}],441:[function(require,module,exports){ +},{"buffer":84,"create-hmac":386}],442:[function(require,module,exports){ (function (process){ 'use strict'; @@ -62616,7 +63219,7 @@ function nextTick(fn, arg1, arg2, arg3) { } }).call(this,require('_process')) -},{"_process":442}],442:[function(require,module,exports){ +},{"_process":443}],443:[function(require,module,exports){ // shim for using process in browser var process = module.exports = {}; @@ -62712,7 +63315,7 @@ process.chdir = function (dir) { }; process.umask = function() { return 0; }; -},{}],443:[function(require,module,exports){ +},{}],444:[function(require,module,exports){ exports.publicEncrypt = require('./publicEncrypt'); exports.privateDecrypt = require('./privateDecrypt'); @@ -62723,7 +63326,7 @@ exports.privateEncrypt = function privateEncrypt(key, buf) { exports.publicDecrypt = function publicDecrypt(key, buf) { return exports.privateDecrypt(key, buf, true); }; -},{"./privateDecrypt":445,"./publicEncrypt":446}],444:[function(require,module,exports){ +},{"./privateDecrypt":446,"./publicEncrypt":447}],445:[function(require,module,exports){ (function (Buffer){ var createHash = require('create-hash'); module.exports = function (seed, len) { @@ -62742,7 +63345,7 @@ function i2ops(c) { return out; } }).call(this,require("buffer").Buffer) -},{"buffer":83,"create-hash":382}],445:[function(require,module,exports){ +},{"buffer":84,"create-hash":383}],446:[function(require,module,exports){ (function (Buffer){ var parseKeys = require('parse-asn1'); var mgf = require('./mgf'); @@ -62853,7 +63456,7 @@ function compare(a, b){ return dif; } }).call(this,require("buffer").Buffer) -},{"./mgf":444,"./withPublic":447,"./xor":448,"bn.js":53,"browserify-rsa":74,"buffer":83,"create-hash":382,"parse-asn1":439}],446:[function(require,module,exports){ +},{"./mgf":445,"./withPublic":448,"./xor":449,"bn.js":54,"browserify-rsa":75,"buffer":84,"create-hash":383,"parse-asn1":440}],447:[function(require,module,exports){ (function (Buffer){ var parseKeys = require('parse-asn1'); var randomBytes = require('randombytes'); @@ -62927,2506 +63530,1834 @@ function pkcs1(key, msg, reverse){ if (reverse) { ps = new Buffer(k - mLen - 3); ps.fill(0xff); - } else { - ps = nonZero(k - mLen - 3); - } - return new bn(Buffer.concat([new Buffer([0, reverse?1:2]), ps, new Buffer([0]), msg], k)); -} -function nonZero(len, crypto) { - var out = new Buffer(len); - var i = 0; - var cache = randomBytes(len*2); - var cur = 0; - var num; - while (i < len) { - if (cur === cache.length) { - cache = randomBytes(len*2); - cur = 0; - } - num = cache[cur++]; - if (num) { - out[i++] = num; - } - } - return out; -} -}).call(this,require("buffer").Buffer) -},{"./mgf":444,"./withPublic":447,"./xor":448,"bn.js":53,"browserify-rsa":74,"buffer":83,"create-hash":382,"parse-asn1":439,"randombytes":449}],447:[function(require,module,exports){ -(function (Buffer){ -var bn = require('bn.js'); -function withPublic(paddedMsg, key) { - return new Buffer(paddedMsg - .toRed(bn.mont(key.modulus)) - .redPow(new bn(key.publicExponent)) - .fromRed() - .toArray()); -} - -module.exports = withPublic; -}).call(this,require("buffer").Buffer) -},{"bn.js":53,"buffer":83}],448:[function(require,module,exports){ -module.exports = function xor(a, b) { - var len = a.length; - var i = -1; - while (++i < len) { - a[i] ^= b[i]; - } - return a -}; -},{}],449:[function(require,module,exports){ -(function (process,global,Buffer){ -'use strict' - -function oldBrowser () { - throw new Error('secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11') -} - -var crypto = global.crypto || global.msCrypto - -if (crypto && crypto.getRandomValues) { - module.exports = randomBytes -} else { - module.exports = oldBrowser -} - -function randomBytes (size, cb) { - // phantomjs needs to throw - if (size > 65536) throw new Error('requested too many random bytes') - // in case browserify isn't using the Uint8Array version - var rawBytes = new global.Uint8Array(size) - - // This will not work in older browsers. - // See https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues - if (size > 0) { // getRandomValues fails on IE if size == 0 - crypto.getRandomValues(rawBytes) - } - // phantomjs doesn't like a buffer being passed here - var bytes = new Buffer(rawBytes.buffer) - - if (typeof cb === 'function') { - return process.nextTick(function () { - cb(null, bytes) - }) - } - - return bytes -} - -}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer) -},{"_process":442,"buffer":83}],450:[function(require,module,exports){ -module.exports = require("./lib/_stream_duplex.js") - -},{"./lib/_stream_duplex.js":451}],451:[function(require,module,exports){ -// a duplex stream is just a stream that is both readable and writable. -// Since JS doesn't have multiple prototypal inheritance, this class -// prototypally inherits from Readable, and then parasitically from -// Writable. - -'use strict'; - -/**/ - -var objectKeys = Object.keys || function (obj) { - var keys = []; - for (var key in obj) { - keys.push(key); - }return keys; -}; -/**/ - -module.exports = Duplex; - -/**/ -var processNextTick = require('process-nextick-args'); -/**/ - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -var Readable = require('./_stream_readable'); -var Writable = require('./_stream_writable'); - -util.inherits(Duplex, Readable); - -var keys = objectKeys(Writable.prototype); -for (var v = 0; v < keys.length; v++) { - var method = keys[v]; - if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; -} - -function Duplex(options) { - if (!(this instanceof Duplex)) return new Duplex(options); - - Readable.call(this, options); - Writable.call(this, options); - - if (options && options.readable === false) this.readable = false; - - if (options && options.writable === false) this.writable = false; - - this.allowHalfOpen = true; - if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; - - this.once('end', onend); -} - -// the no-half-open enforcer -function onend() { - // if we allow half-open state, or if the writable side ended, - // then we're ok. - if (this.allowHalfOpen || this._writableState.ended) return; - - // no more data can be written. - // But allow more writes to happen in this tick. - processNextTick(onEndNT, this); -} - -function onEndNT(self) { - self.end(); -} - -function forEach(xs, f) { - for (var i = 0, l = xs.length; i < l; i++) { - f(xs[i], i); - } -} -},{"./_stream_readable":453,"./_stream_writable":455,"core-util-is":380,"inherits":428,"process-nextick-args":441}],452:[function(require,module,exports){ -// a passthrough stream. -// basically just the most minimal sort of Transform stream. -// Every written chunk gets output as-is. - -'use strict'; - -module.exports = PassThrough; - -var Transform = require('./_stream_transform'); - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -util.inherits(PassThrough, Transform); - -function PassThrough(options) { - if (!(this instanceof PassThrough)) return new PassThrough(options); - - Transform.call(this, options); -} - -PassThrough.prototype._transform = function (chunk, encoding, cb) { - cb(null, chunk); -}; -},{"./_stream_transform":454,"core-util-is":380,"inherits":428}],453:[function(require,module,exports){ -(function (process){ -'use strict'; - -module.exports = Readable; - -/**/ -var processNextTick = require('process-nextick-args'); -/**/ - -/**/ -var isArray = require('isarray'); -/**/ - -Readable.ReadableState = ReadableState; - -/**/ -var EE = require('events').EventEmitter; - -var EElistenerCount = function (emitter, type) { - return emitter.listeners(type).length; -}; -/**/ - -/**/ -var Stream; -(function () { - try { - Stream = require('st' + 'ream'); - } catch (_) {} finally { - if (!Stream) Stream = require('events').EventEmitter; - } -})(); -/**/ - -var Buffer = require('buffer').Buffer; -/**/ -var bufferShim = require('buffer-shims'); -/**/ - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -/**/ -var debugUtil = require('util'); -var debug = void 0; -if (debugUtil && debugUtil.debuglog) { - debug = debugUtil.debuglog('stream'); -} else { - debug = function () {}; -} -/**/ - -var StringDecoder; - -util.inherits(Readable, Stream); - -var hasPrependListener = typeof EE.prototype.prependListener === 'function'; - -function prependListener(emitter, event, fn) { - if (hasPrependListener) return emitter.prependListener(event, fn); - - // This is a brutally ugly hack to make sure that our error handler - // is attached before any userland ones. NEVER DO THIS. This is here - // only because this code needs to continue to work with older versions - // of Node.js that do not include the prependListener() method. The goal - // is to eventually remove this hack. - if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; -} - -var Duplex; -function ReadableState(options, stream) { - Duplex = Duplex || require('./_stream_duplex'); - - options = options || {}; - - // object stream flag. Used to make read(n) ignore n and to - // make all the buffer merging and length checks go away - this.objectMode = !!options.objectMode; - - if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode; - - // the point at which it stops calling _read() to fill the buffer - // Note: 0 is a valid value, means "don't call _read preemptively ever" - var hwm = options.highWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; - - // cast to ints. - this.highWaterMark = ~ ~this.highWaterMark; - - this.buffer = []; - this.length = 0; - this.pipes = null; - this.pipesCount = 0; - this.flowing = null; - this.ended = false; - this.endEmitted = false; - this.reading = false; - - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; - - // whenever we return null, then we set a flag to say - // that we're awaiting a 'readable' event emission. - this.needReadable = false; - this.emittedReadable = false; - this.readableListening = false; - this.resumeScheduled = false; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // when piping, we only care about 'readable' events that happen - // after read()ing all the bytes and not getting any pushback. - this.ranOut = false; - - // the number of writers that are awaiting a drain event in .pipe()s - this.awaitDrain = 0; - - // if true, a maybeReadMore has been scheduled - this.readingMore = false; - - this.decoder = null; - this.encoding = null; - if (options.encoding) { - if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; - this.decoder = new StringDecoder(options.encoding); - this.encoding = options.encoding; - } -} - -var Duplex; -function Readable(options) { - Duplex = Duplex || require('./_stream_duplex'); - - if (!(this instanceof Readable)) return new Readable(options); - - this._readableState = new ReadableState(options, this); - - // legacy - this.readable = true; - - if (options && typeof options.read === 'function') this._read = options.read; - - Stream.call(this); -} - -// Manually shove something into the read() buffer. -// This returns true if the highWaterMark has not been hit yet, -// similar to how Writable.write() returns true if you should -// write() some more. -Readable.prototype.push = function (chunk, encoding) { - var state = this._readableState; - - if (!state.objectMode && typeof chunk === 'string') { - encoding = encoding || state.defaultEncoding; - if (encoding !== state.encoding) { - chunk = bufferShim.from(chunk, encoding); - encoding = ''; - } - } - - return readableAddChunk(this, state, chunk, encoding, false); -}; - -// Unshift should *always* be something directly out of read() -Readable.prototype.unshift = function (chunk) { - var state = this._readableState; - return readableAddChunk(this, state, chunk, '', true); -}; - -Readable.prototype.isPaused = function () { - return this._readableState.flowing === false; -}; - -function readableAddChunk(stream, state, chunk, encoding, addToFront) { - var er = chunkInvalid(state, chunk); - if (er) { - stream.emit('error', er); - } else if (chunk === null) { - state.reading = false; - onEofChunk(stream, state); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (state.ended && !addToFront) { - var e = new Error('stream.push() after EOF'); - stream.emit('error', e); - } else if (state.endEmitted && addToFront) { - var _e = new Error('stream.unshift() after end event'); - stream.emit('error', _e); - } else { - var skipAdd; - if (state.decoder && !addToFront && !encoding) { - chunk = state.decoder.write(chunk); - skipAdd = !state.objectMode && chunk.length === 0; - } - - if (!addToFront) state.reading = false; - - // Don't add to the buffer if we've decoded to an empty string chunk and - // we're not in object mode - if (!skipAdd) { - // if we want the data now, just emit it. - if (state.flowing && state.length === 0 && !state.sync) { - stream.emit('data', chunk); - stream.read(0); - } else { - // update the buffer info. - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); - - if (state.needReadable) emitReadable(stream); - } - } - - maybeReadMore(stream, state); - } - } else if (!addToFront) { - state.reading = false; - } - - return needMoreData(state); -} - -// if it's past the high water mark, we can push in some more. -// Also, if we have no data yet, we can stand some -// more bytes. This is to work around cases where hwm=0, -// such as the repl. Also, if the push() triggered a -// readable event, and the user called read(largeNumber) such that -// needReadable was set, then we ought to push more, so that another -// 'readable' event will be triggered. -function needMoreData(state) { - return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); -} - -// backwards compatibility. -Readable.prototype.setEncoding = function (enc) { - if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; - this._readableState.decoder = new StringDecoder(enc); - this._readableState.encoding = enc; - return this; -}; - -// Don't raise the hwm > 8MB -var MAX_HWM = 0x800000; -function computeNewHighWaterMark(n) { - if (n >= MAX_HWM) { - n = MAX_HWM; - } else { - // Get the next highest power of 2 - n--; - n |= n >>> 1; - n |= n >>> 2; - n |= n >>> 4; - n |= n >>> 8; - n |= n >>> 16; - n++; + } else { + ps = nonZero(k - mLen - 3); } - return n; + return new bn(Buffer.concat([new Buffer([0, reverse?1:2]), ps, new Buffer([0]), msg], k)); } - -function howMuchToRead(n, state) { - if (state.length === 0 && state.ended) return 0; - - if (state.objectMode) return n === 0 ? 0 : 1; - - if (n === null || isNaN(n)) { - // only flow one buffer at a time - if (state.flowing && state.buffer.length) return state.buffer[0].length;else return state.length; +function nonZero(len, crypto) { + var out = new Buffer(len); + var i = 0; + var cache = randomBytes(len*2); + var cur = 0; + var num; + while (i < len) { + if (cur === cache.length) { + cache = randomBytes(len*2); + cur = 0; + } + num = cache[cur++]; + if (num) { + out[i++] = num; + } } + return out; +} +}).call(this,require("buffer").Buffer) +},{"./mgf":445,"./withPublic":448,"./xor":449,"bn.js":54,"browserify-rsa":75,"buffer":84,"create-hash":383,"parse-asn1":440,"randombytes":450}],448:[function(require,module,exports){ +(function (Buffer){ +var bn = require('bn.js'); +function withPublic(paddedMsg, key) { + return new Buffer(paddedMsg + .toRed(bn.mont(key.modulus)) + .redPow(new bn(key.publicExponent)) + .fromRed() + .toArray()); +} - if (n <= 0) return 0; +module.exports = withPublic; +}).call(this,require("buffer").Buffer) +},{"bn.js":54,"buffer":84}],449:[function(require,module,exports){ +module.exports = function xor(a, b) { + var len = a.length; + var i = -1; + while (++i < len) { + a[i] ^= b[i]; + } + return a +}; +},{}],450:[function(require,module,exports){ +(function (process,global,Buffer){ +'use strict' - // If we're asking for more than the target buffer level, - // then raise the water mark. Bump up to the next highest - // power of 2, to prevent increasing it excessively in tiny - // amounts. - if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); +function oldBrowser () { + throw new Error('secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11') +} - // don't have that much. return null, unless we've ended. - if (n > state.length) { - if (!state.ended) { - state.needReadable = true; - return 0; - } else { - return state.length; - } - } +var crypto = global.crypto || global.msCrypto - return n; +if (crypto && crypto.getRandomValues) { + module.exports = randomBytes +} else { + module.exports = oldBrowser } -// you can override either this method, or the async _read(n) below. -Readable.prototype.read = function (n) { - debug('read', n); - var state = this._readableState; - var nOrig = n; +function randomBytes (size, cb) { + // phantomjs needs to throw + if (size > 65536) throw new Error('requested too many random bytes') + // in case browserify isn't using the Uint8Array version + var rawBytes = new global.Uint8Array(size) - if (typeof n !== 'number' || n > 0) state.emittedReadable = false; + // This will not work in older browsers. + // See https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues + if (size > 0) { // getRandomValues fails on IE if size == 0 + crypto.getRandomValues(rawBytes) + } + // phantomjs doesn't like a buffer being passed here + var bytes = new Buffer(rawBytes.buffer) - // if we're doing read(0) to trigger a readable event, but we - // already have a bunch of data in the buffer, then just trigger - // the 'readable' event and move on. - if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { - debug('read: emitReadable', state.length, state.ended); - if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); - return null; + if (typeof cb === 'function') { + return process.nextTick(function () { + cb(null, bytes) + }) } - n = howMuchToRead(n, state); + return bytes +} - // if we've ended, and we're now clear, then finish it up. - if (n === 0 && state.ended) { - if (state.length === 0) endReadable(this); - return null; - } +}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer) +},{"_process":443,"buffer":84}],451:[function(require,module,exports){ +module.exports = require("./lib/_stream_duplex.js") - // All the actual chunk generation logic needs to be - // *below* the call to _read. The reason is that in certain - // synthetic stream cases, such as passthrough streams, _read - // may be a completely synchronous operation which may change - // the state of the read buffer, providing enough data when - // before there was *not* enough. - // - // So, the steps are: - // 1. Figure out what the state of things will be after we do - // a read from the buffer. - // - // 2. If that resulting state will trigger a _read, then call _read. - // Note that this may be asynchronous, or synchronous. Yes, it is - // deeply ugly to write APIs this way, but that still doesn't mean - // that the Readable class should behave improperly, as streams are - // designed to be sync/async agnostic. - // Take note if the _read call is sync or async (ie, if the read call - // has returned yet), so that we know whether or not it's safe to emit - // 'readable' etc. - // - // 3. Actually pull the requested chunks out of the buffer and return. +},{"./lib/_stream_duplex.js":452}],452:[function(require,module,exports){ +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. - // if we need a readable event, then we need to do some reading. - var doRead = state.needReadable; - debug('need readable', doRead); +'use strict'; - // if we currently have less than the highWaterMark, then also read some - if (state.length === 0 || state.length - n < state.highWaterMark) { - doRead = true; - debug('length less than watermark', doRead); - } +/**/ - // however, if we've ended, then there's no point, and if we're already - // reading, then it's unnecessary. - if (state.ended || state.reading) { - doRead = false; - debug('reading or ended', doRead); - } +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) { + keys.push(key); + }return keys; +}; +/**/ - if (doRead) { - debug('do read'); - state.reading = true; - state.sync = true; - // if the length is currently zero, then we *need* a readable event. - if (state.length === 0) state.needReadable = true; - // call internal read method - this._read(state.highWaterMark); - state.sync = false; - } +module.exports = Duplex; - // If _read pushed data synchronously, then `reading` will be false, - // and we need to re-evaluate how much data we can return to the user. - if (doRead && !state.reading) n = howMuchToRead(nOrig, state); +/**/ +var processNextTick = require('process-nextick-args'); +/**/ - var ret; - if (n > 0) ret = fromList(n, state);else ret = null; +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ - if (ret === null) { - state.needReadable = true; - n = 0; - } +var Readable = require('./_stream_readable'); +var Writable = require('./_stream_writable'); - state.length -= n; +util.inherits(Duplex, Readable); - // If we have nothing in the buffer, then we want to know - // as soon as we *do* get something into the buffer. - if (state.length === 0 && !state.ended) state.needReadable = true; +var keys = objectKeys(Writable.prototype); +for (var v = 0; v < keys.length; v++) { + var method = keys[v]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; +} - // If we tried to read() past the EOF, then emit end on the next tick. - if (nOrig !== n && state.ended && state.length === 0) endReadable(this); +function Duplex(options) { + if (!(this instanceof Duplex)) return new Duplex(options); - if (ret !== null) this.emit('data', ret); + Readable.call(this, options); + Writable.call(this, options); - return ret; -}; + if (options && options.readable === false) this.readable = false; -function chunkInvalid(state, chunk) { - var er = null; - if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - return er; -} + if (options && options.writable === false) this.writable = false; -function onEofChunk(stream, state) { - if (state.ended) return; - if (state.decoder) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; - } - } - state.ended = true; + this.allowHalfOpen = true; + if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; - // emit 'readable' now to make sure it gets picked up. - emitReadable(stream); + this.once('end', onend); } -// Don't emit readable right away in sync mode, because this can trigger -// another read() call => stack overflow. This way, it might trigger -// a nextTick recursion warning, but that's not so bad. -function emitReadable(stream) { - var state = stream._readableState; - state.needReadable = false; - if (!state.emittedReadable) { - debug('emitReadable', state.flowing); - state.emittedReadable = true; - if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream); - } -} +// the no-half-open enforcer +function onend() { + // if we allow half-open state, or if the writable side ended, + // then we're ok. + if (this.allowHalfOpen || this._writableState.ended) return; -function emitReadable_(stream) { - debug('emit readable'); - stream.emit('readable'); - flow(stream); + // no more data can be written. + // But allow more writes to happen in this tick. + processNextTick(onEndNT, this); } -// at this point, the user has presumably seen the 'readable' event, -// and called read() to consume some data. that may have triggered -// in turn another _read(n) call, in which case reading = true if -// it's in progress. -// However, if we're not ended, or reading, and the length < hwm, -// then go ahead and try to read some more preemptively. -function maybeReadMore(stream, state) { - if (!state.readingMore) { - state.readingMore = true; - processNextTick(maybeReadMore_, stream, state); - } +function onEndNT(self) { + self.end(); } -function maybeReadMore_(stream, state) { - var len = state.length; - while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { - debug('maybeReadMore read 0'); - stream.read(0); - if (len === state.length) - // didn't get any data, stop spinning. - break;else len = state.length; +function forEach(xs, f) { + for (var i = 0, l = xs.length; i < l; i++) { + f(xs[i], i); } - state.readingMore = false; } +},{"./_stream_readable":454,"./_stream_writable":456,"core-util-is":381,"inherits":429,"process-nextick-args":442}],453:[function(require,module,exports){ +// a passthrough stream. +// basically just the most minimal sort of Transform stream. +// Every written chunk gets output as-is. -// abstract method. to be overridden in specific implementation classes. -// call cb(er, data) where data is <= n in length. -// for virtual (non-string, non-buffer) streams, "length" is somewhat -// arbitrary, and perhaps not very meaningful. -Readable.prototype._read = function (n) { - this.emit('error', new Error('not implemented')); -}; - -Readable.prototype.pipe = function (dest, pipeOpts) { - var src = this; - var state = this._readableState; +'use strict'; - switch (state.pipesCount) { - case 0: - state.pipes = dest; - break; - case 1: - state.pipes = [state.pipes, dest]; - break; - default: - state.pipes.push(dest); - break; - } - state.pipesCount += 1; - debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); +module.exports = PassThrough; - var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; +var Transform = require('./_stream_transform'); - var endFn = doEnd ? onend : cleanup; - if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn); +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ - dest.on('unpipe', onunpipe); - function onunpipe(readable) { - debug('onunpipe'); - if (readable === src) { - cleanup(); - } - } +util.inherits(PassThrough, Transform); - function onend() { - debug('onend'); - dest.end(); - } +function PassThrough(options) { + if (!(this instanceof PassThrough)) return new PassThrough(options); - // when the dest drains, it reduces the awaitDrain counter - // on the source. This would be more elegant with a .once() - // handler in flow(), but adding and removing repeatedly is - // too slow. - var ondrain = pipeOnDrain(src); - dest.on('drain', ondrain); + Transform.call(this, options); +} - var cleanedUp = false; - function cleanup() { - debug('cleanup'); - // cleanup event handlers once the pipe is broken - dest.removeListener('close', onclose); - dest.removeListener('finish', onfinish); - dest.removeListener('drain', ondrain); - dest.removeListener('error', onerror); - dest.removeListener('unpipe', onunpipe); - src.removeListener('end', onend); - src.removeListener('end', cleanup); - src.removeListener('data', ondata); +PassThrough.prototype._transform = function (chunk, encoding, cb) { + cb(null, chunk); +}; +},{"./_stream_transform":455,"core-util-is":381,"inherits":429}],454:[function(require,module,exports){ +(function (process){ +'use strict'; - cleanedUp = true; +module.exports = Readable; - // if the reader is waiting for a drain event from this - // specific writer, then it would cause it to never start - // flowing again. - // So, if this is awaiting a drain, then we just call it now. - // If we don't know, then assume that we are waiting for one. - if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); - } +/**/ +var processNextTick = require('process-nextick-args'); +/**/ - src.on('data', ondata); - function ondata(chunk) { - debug('ondata'); - var ret = dest.write(chunk); - if (false === ret) { - // If the user unpiped during `dest.write()`, it is possible - // to get stuck in a permanently paused state if that write - // also returned false. - // => Check whether `dest` is still a piping destination. - if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { - debug('false write response, pause', src._readableState.awaitDrain); - src._readableState.awaitDrain++; - } - src.pause(); - } - } +/**/ +var isArray = require('isarray'); +/**/ - // if the dest has an error, then stop piping into it. - // however, don't suppress the throwing behavior for this. - function onerror(er) { - debug('onerror', er); - unpipe(); - dest.removeListener('error', onerror); - if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); - } +Readable.ReadableState = ReadableState; - // Make sure our error handler is attached before userland ones. - prependListener(dest, 'error', onerror); +/**/ +var EE = require('events').EventEmitter; - // Both close and finish should trigger unpipe, but only once. - function onclose() { - dest.removeListener('finish', onfinish); - unpipe(); - } - dest.once('close', onclose); - function onfinish() { - debug('onfinish'); - dest.removeListener('close', onclose); - unpipe(); - } - dest.once('finish', onfinish); +var EElistenerCount = function (emitter, type) { + return emitter.listeners(type).length; +}; +/**/ - function unpipe() { - debug('unpipe'); - src.unpipe(dest); +/**/ +var Stream; +(function () { + try { + Stream = require('st' + 'ream'); + } catch (_) {} finally { + if (!Stream) Stream = require('events').EventEmitter; } +})(); +/**/ - // tell the dest that it's being piped to - dest.emit('pipe', src); - - // start the flow if it hasn't been started already. - if (!state.flowing) { - debug('pipe resume'); - src.resume(); - } +var Buffer = require('buffer').Buffer; +/**/ +var bufferShim = require('buffer-shims'); +/**/ - return dest; -}; +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ -function pipeOnDrain(src) { - return function () { - var state = src._readableState; - debug('pipeOnDrain', state.awaitDrain); - if (state.awaitDrain) state.awaitDrain--; - if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { - state.flowing = true; - flow(src); - } - }; +/**/ +var debugUtil = require('util'); +var debug = void 0; +if (debugUtil && debugUtil.debuglog) { + debug = debugUtil.debuglog('stream'); +} else { + debug = function () {}; } +/**/ -Readable.prototype.unpipe = function (dest) { - var state = this._readableState; - - // if we're not piping anywhere, then do nothing. - if (state.pipesCount === 0) return this; - - // just one destination. most common case. - if (state.pipesCount === 1) { - // passed in one, but it's not the right one. - if (dest && dest !== state.pipes) return this; - - if (!dest) dest = state.pipes; - - // got a match. - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - if (dest) dest.emit('unpipe', this); - return this; - } +var StringDecoder; - // slow case. multiple pipe destinations. +util.inherits(Readable, Stream); - if (!dest) { - // remove all. - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; +var hasPrependListener = typeof EE.prototype.prependListener === 'function'; - for (var _i = 0; _i < len; _i++) { - dests[_i].emit('unpipe', this); - }return this; - } +function prependListener(emitter, event, fn) { + if (hasPrependListener) return emitter.prependListener(event, fn); - // try to find the right one. - var i = indexOf(state.pipes, dest); - if (i === -1) return this; + // This is a brutally ugly hack to make sure that our error handler + // is attached before any userland ones. NEVER DO THIS. This is here + // only because this code needs to continue to work with older versions + // of Node.js that do not include the prependListener() method. The goal + // is to eventually remove this hack. + if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; +} - state.pipes.splice(i, 1); - state.pipesCount -= 1; - if (state.pipesCount === 1) state.pipes = state.pipes[0]; +var Duplex; +function ReadableState(options, stream) { + Duplex = Duplex || require('./_stream_duplex'); - dest.emit('unpipe', this); + options = options || {}; - return this; -}; + // object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away + this.objectMode = !!options.objectMode; -// set up data events if they are asked for -// Ensure readable listeners eventually get something -Readable.prototype.on = function (ev, fn) { - var res = Stream.prototype.on.call(this, ev, fn); + if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode; - // If listening to data, and it has not explicitly been paused, - // then call resume to start the flow of data on the next tick. - if (ev === 'data' && false !== this._readableState.flowing) { - this.resume(); - } + // the point at which it stops calling _read() to fill the buffer + // Note: 0 is a valid value, means "don't call _read preemptively ever" + var hwm = options.highWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; - if (ev === 'readable' && !this._readableState.endEmitted) { - var state = this._readableState; - if (!state.readableListening) { - state.readableListening = true; - state.emittedReadable = false; - state.needReadable = true; - if (!state.reading) { - processNextTick(nReadingNextTick, this); - } else if (state.length) { - emitReadable(this, state); - } - } - } + // cast to ints. + this.highWaterMark = ~ ~this.highWaterMark; - return res; -}; -Readable.prototype.addListener = Readable.prototype.on; + this.buffer = []; + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; + this.ended = false; + this.endEmitted = false; + this.reading = false; -function nReadingNextTick(self) { - debug('readable nexttick read 0'); - self.read(0); -} + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; -// pause() and resume() are remnants of the legacy readable stream API -// If the user uses them, then switch into old mode. -Readable.prototype.resume = function () { - var state = this._readableState; - if (!state.flowing) { - debug('resume'); - state.flowing = true; - resume(this, state); - } - return this; -}; + // whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + this.resumeScheduled = false; -function resume(stream, state) { - if (!state.resumeScheduled) { - state.resumeScheduled = true; - processNextTick(resume_, stream, state); - } -} + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; -function resume_(stream, state) { - if (!state.reading) { - debug('resume read 0'); - stream.read(0); - } + // when piping, we only care about 'readable' events that happen + // after read()ing all the bytes and not getting any pushback. + this.ranOut = false; - state.resumeScheduled = false; - stream.emit('resume'); - flow(stream); - if (state.flowing && !state.reading) stream.read(0); -} + // the number of writers that are awaiting a drain event in .pipe()s + this.awaitDrain = 0; -Readable.prototype.pause = function () { - debug('call pause flowing=%j', this._readableState.flowing); - if (false !== this._readableState.flowing) { - debug('pause'); - this._readableState.flowing = false; - this.emit('pause'); - } - return this; -}; + // if true, a maybeReadMore has been scheduled + this.readingMore = false; -function flow(stream) { - var state = stream._readableState; - debug('flow', state.flowing); - if (state.flowing) { - do { - var chunk = stream.read(); - } while (null !== chunk && state.flowing); + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; } } -// wrap an old-style stream as the async data source. -// This is *not* part of the readable stream interface. -// It is an ugly unfortunate mess of history. -Readable.prototype.wrap = function (stream) { - var state = this._readableState; - var paused = false; - - var self = this; - stream.on('end', function () { - debug('wrapped end'); - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) self.push(chunk); - } +var Duplex; +function Readable(options) { + Duplex = Duplex || require('./_stream_duplex'); - self.push(null); - }); + if (!(this instanceof Readable)) return new Readable(options); - stream.on('data', function (chunk) { - debug('wrapped data'); - if (state.decoder) chunk = state.decoder.write(chunk); + this._readableState = new ReadableState(options, this); - // don't skip over falsy values in objectMode - if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; + // legacy + this.readable = true; - var ret = self.push(chunk); - if (!ret) { - paused = true; - stream.pause(); - } - }); + if (options && typeof options.read === 'function') this._read = options.read; - // proxy all the other methods. - // important when wrapping filters and duplexes. - for (var i in stream) { - if (this[i] === undefined && typeof stream[i] === 'function') { - this[i] = function (method) { - return function () { - return stream[method].apply(stream, arguments); - }; - }(i); - } - } + Stream.call(this); +} - // proxy certain important events. - var events = ['error', 'close', 'destroy', 'pause', 'resume']; - forEach(events, function (ev) { - stream.on(ev, self.emit.bind(self, ev)); - }); +// Manually shove something into the read() buffer. +// This returns true if the highWaterMark has not been hit yet, +// similar to how Writable.write() returns true if you should +// write() some more. +Readable.prototype.push = function (chunk, encoding) { + var state = this._readableState; - // when we try to consume some more bytes, simply unpause the - // underlying stream. - self._read = function (n) { - debug('wrapped _read', n); - if (paused) { - paused = false; - stream.resume(); + if (!state.objectMode && typeof chunk === 'string') { + encoding = encoding || state.defaultEncoding; + if (encoding !== state.encoding) { + chunk = bufferShim.from(chunk, encoding); + encoding = ''; } - }; + } - return self; + return readableAddChunk(this, state, chunk, encoding, false); }; -// exposed for testing purposes only. -Readable._fromList = fromList; - -// Pluck off n bytes from an array of buffers. -// Length is the combined lengths of all the buffers in the list. -function fromList(n, state) { - var list = state.buffer; - var length = state.length; - var stringMode = !!state.decoder; - var objectMode = !!state.objectMode; - var ret; +// Unshift should *always* be something directly out of read() +Readable.prototype.unshift = function (chunk) { + var state = this._readableState; + return readableAddChunk(this, state, chunk, '', true); +}; - // nothing in the list, definitely empty. - if (list.length === 0) return null; +Readable.prototype.isPaused = function () { + return this._readableState.flowing === false; +}; - if (length === 0) ret = null;else if (objectMode) ret = list.shift();else if (!n || n >= length) { - // read it all, truncate the array. - if (stringMode) ret = list.join('');else if (list.length === 1) ret = list[0];else ret = Buffer.concat(list, length); - list.length = 0; - } else { - // read just some of it. - if (n < list[0].length) { - // just take a part of the first list item. - // slice is the same for buffers and strings. - var buf = list[0]; - ret = buf.slice(0, n); - list[0] = buf.slice(n); - } else if (n === list[0].length) { - // first list is a perfect match - ret = list.shift(); +function readableAddChunk(stream, state, chunk, encoding, addToFront) { + var er = chunkInvalid(state, chunk); + if (er) { + stream.emit('error', er); + } else if (chunk === null) { + state.reading = false; + onEofChunk(stream, state); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (state.ended && !addToFront) { + var e = new Error('stream.push() after EOF'); + stream.emit('error', e); + } else if (state.endEmitted && addToFront) { + var _e = new Error('stream.unshift() after end event'); + stream.emit('error', _e); } else { - // complex case. - // we have enough to cover it, but it spans past the first buffer. - if (stringMode) ret = '';else ret = bufferShim.allocUnsafe(n); - - var c = 0; - for (var i = 0, l = list.length; i < l && c < n; i++) { - var _buf = list[0]; - var cpy = Math.min(n - c, _buf.length); + var skipAdd; + if (state.decoder && !addToFront && !encoding) { + chunk = state.decoder.write(chunk); + skipAdd = !state.objectMode && chunk.length === 0; + } - if (stringMode) ret += _buf.slice(0, cpy);else _buf.copy(ret, c, 0, cpy); + if (!addToFront) state.reading = false; - if (cpy < _buf.length) list[0] = _buf.slice(cpy);else list.shift(); + // Don't add to the buffer if we've decoded to an empty string chunk and + // we're not in object mode + if (!skipAdd) { + // if we want the data now, just emit it. + if (state.flowing && state.length === 0 && !state.sync) { + stream.emit('data', chunk); + stream.read(0); + } else { + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); - c += cpy; + if (state.needReadable) emitReadable(stream); + } } + + maybeReadMore(stream, state); } + } else if (!addToFront) { + state.reading = false; } - return ret; -} - -function endReadable(stream) { - var state = stream._readableState; - - // If we get here before consuming all the bytes, then that is a - // bug in node. Should never happen. - if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); - - if (!state.endEmitted) { - state.ended = true; - processNextTick(endReadableNT, state, stream); - } + return needMoreData(state); } -function endReadableNT(state, stream) { - // Check that we didn't get one last unshift. - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit('end'); - } +// if it's past the high water mark, we can push in some more. +// Also, if we have no data yet, we can stand some +// more bytes. This is to work around cases where hwm=0, +// such as the repl. Also, if the push() triggered a +// readable event, and the user called read(largeNumber) such that +// needReadable was set, then we ought to push more, so that another +// 'readable' event will be triggered. +function needMoreData(state) { + return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); } -function forEach(xs, f) { - for (var i = 0, l = xs.length; i < l; i++) { - f(xs[i], i); - } -} +// backwards compatibility. +Readable.prototype.setEncoding = function (enc) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this._readableState.decoder = new StringDecoder(enc); + this._readableState.encoding = enc; + return this; +}; -function indexOf(xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) return i; +// Don't raise the hwm > 8MB +var MAX_HWM = 0x800000; +function computeNewHighWaterMark(n) { + if (n >= MAX_HWM) { + n = MAX_HWM; + } else { + // Get the next highest power of 2 + n--; + n |= n >>> 1; + n |= n >>> 2; + n |= n >>> 4; + n |= n >>> 8; + n |= n >>> 16; + n++; } - return -1; + return n; } -}).call(this,require('_process')) -},{"./_stream_duplex":451,"_process":442,"buffer":83,"buffer-shims":81,"core-util-is":380,"events":418,"inherits":428,"isarray":430,"process-nextick-args":441,"string_decoder/":478,"util":55}],454:[function(require,module,exports){ -// a transform stream is a readable/writable stream where you do -// something with the data. Sometimes it's called a "filter", -// but that's not a great name for it, since that implies a thing where -// some bits pass through, and others are simply ignored. (That would -// be a valid example of a transform, of course.) -// -// While the output is causally related to the input, it's not a -// necessarily symmetric or synchronous transformation. For example, -// a zlib stream might take multiple plain-text writes(), and then -// emit a single compressed chunk some time in the future. -// -// Here's how this works: -// -// The Transform stream has all the aspects of the readable and writable -// stream classes. When you write(chunk), that calls _write(chunk,cb) -// internally, and returns false if there's a lot of pending writes -// buffered up. When you call read(), that calls _read(n) until -// there's enough pending readable data buffered up. -// -// In a transform stream, the written data is placed in a buffer. When -// _read(n) is called, it transforms the queued up data, calling the -// buffered _write cb's as it consumes chunks. If consuming a single -// written chunk would result in multiple output chunks, then the first -// outputted bit calls the readcb, and subsequent chunks just go into -// the read buffer, and will cause it to emit 'readable' if necessary. -// -// This way, back-pressure is actually determined by the reading side, -// since _read has to be called to start processing a new chunk. However, -// a pathological inflate type of transform can cause excessive buffering -// here. For example, imagine a stream where every byte of input is -// interpreted as an integer from 0-255, and then results in that many -// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in -// 1kb of data being output. In this case, you could write a very small -// amount of input, and end up with a very large amount of output. In -// such a pathological inflating mechanism, there'd be no way to tell -// the system to stop doing the transform. A single 4MB write could -// cause the system to run out of memory. -// -// However, even in such a pathological case, only a single written chunk -// would be consumed, and then the rest would wait (un-transformed) until -// the results of the previous transformed chunk were consumed. -'use strict'; +function howMuchToRead(n, state) { + if (state.length === 0 && state.ended) return 0; -module.exports = Transform; + if (state.objectMode) return n === 0 ? 0 : 1; -var Duplex = require('./_stream_duplex'); + if (n === null || isNaN(n)) { + // only flow one buffer at a time + if (state.flowing && state.buffer.length) return state.buffer[0].length;else return state.length; + } -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ + if (n <= 0) return 0; -util.inherits(Transform, Duplex); + // If we're asking for more than the target buffer level, + // then raise the water mark. Bump up to the next highest + // power of 2, to prevent increasing it excessively in tiny + // amounts. + if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); -function TransformState(stream) { - this.afterTransform = function (er, data) { - return afterTransform(stream, er, data); - }; + // don't have that much. return null, unless we've ended. + if (n > state.length) { + if (!state.ended) { + state.needReadable = true; + return 0; + } else { + return state.length; + } + } - this.needTransform = false; - this.transforming = false; - this.writecb = null; - this.writechunk = null; - this.writeencoding = null; + return n; } -function afterTransform(stream, er, data) { - var ts = stream._transformState; - ts.transforming = false; - - var cb = ts.writecb; - - if (!cb) return stream.emit('error', new Error('no writecb in Transform class')); - - ts.writechunk = null; - ts.writecb = null; - - if (data !== null && data !== undefined) stream.push(data); +// you can override either this method, or the async _read(n) below. +Readable.prototype.read = function (n) { + debug('read', n); + var state = this._readableState; + var nOrig = n; - cb(er); + if (typeof n !== 'number' || n > 0) state.emittedReadable = false; - var rs = stream._readableState; - rs.reading = false; - if (rs.needReadable || rs.length < rs.highWaterMark) { - stream._read(rs.highWaterMark); + // if we're doing read(0) to trigger a readable event, but we + // already have a bunch of data in the buffer, then just trigger + // the 'readable' event and move on. + if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { + debug('read: emitReadable', state.length, state.ended); + if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); + return null; } -} - -function Transform(options) { - if (!(this instanceof Transform)) return new Transform(options); - - Duplex.call(this, options); - this._transformState = new TransformState(this); + n = howMuchToRead(n, state); - // when the writable side finishes, then flush out anything remaining. - var stream = this; + // if we've ended, and we're now clear, then finish it up. + if (n === 0 && state.ended) { + if (state.length === 0) endReadable(this); + return null; + } - // start out asking for a readable event once data is transformed. - this._readableState.needReadable = true; + // All the actual chunk generation logic needs to be + // *below* the call to _read. The reason is that in certain + // synthetic stream cases, such as passthrough streams, _read + // may be a completely synchronous operation which may change + // the state of the read buffer, providing enough data when + // before there was *not* enough. + // + // So, the steps are: + // 1. Figure out what the state of things will be after we do + // a read from the buffer. + // + // 2. If that resulting state will trigger a _read, then call _read. + // Note that this may be asynchronous, or synchronous. Yes, it is + // deeply ugly to write APIs this way, but that still doesn't mean + // that the Readable class should behave improperly, as streams are + // designed to be sync/async agnostic. + // Take note if the _read call is sync or async (ie, if the read call + // has returned yet), so that we know whether or not it's safe to emit + // 'readable' etc. + // + // 3. Actually pull the requested chunks out of the buffer and return. - // we have implemented the _read method, and done the other things - // that Readable wants before the first _read call, so unset the - // sync guard flag. - this._readableState.sync = false; + // if we need a readable event, then we need to do some reading. + var doRead = state.needReadable; + debug('need readable', doRead); - if (options) { - if (typeof options.transform === 'function') this._transform = options.transform; + // if we currently have less than the highWaterMark, then also read some + if (state.length === 0 || state.length - n < state.highWaterMark) { + doRead = true; + debug('length less than watermark', doRead); + } - if (typeof options.flush === 'function') this._flush = options.flush; + // however, if we've ended, then there's no point, and if we're already + // reading, then it's unnecessary. + if (state.ended || state.reading) { + doRead = false; + debug('reading or ended', doRead); } - this.once('prefinish', function () { - if (typeof this._flush === 'function') this._flush(function (er) { - done(stream, er); - });else done(stream); - }); -} + if (doRead) { + debug('do read'); + state.reading = true; + state.sync = true; + // if the length is currently zero, then we *need* a readable event. + if (state.length === 0) state.needReadable = true; + // call internal read method + this._read(state.highWaterMark); + state.sync = false; + } -Transform.prototype.push = function (chunk, encoding) { - this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk, encoding); -}; + // If _read pushed data synchronously, then `reading` will be false, + // and we need to re-evaluate how much data we can return to the user. + if (doRead && !state.reading) n = howMuchToRead(nOrig, state); -// This is the part where you do stuff! -// override this function in implementation classes. -// 'chunk' is an input chunk. -// -// Call `push(newChunk)` to pass along transformed output -// to the readable side. You may call 'push' zero or more times. -// -// Call `cb(err)` when you are done with this chunk. If you pass -// an error, then that'll put the hurt on the whole operation. If you -// never call cb(), then you'll never get another chunk. -Transform.prototype._transform = function (chunk, encoding, cb) { - throw new Error('Not implemented'); -}; + var ret; + if (n > 0) ret = fromList(n, state);else ret = null; -Transform.prototype._write = function (chunk, encoding, cb) { - var ts = this._transformState; - ts.writecb = cb; - ts.writechunk = chunk; - ts.writeencoding = encoding; - if (!ts.transforming) { - var rs = this._readableState; - if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); + if (ret === null) { + state.needReadable = true; + n = 0; } -}; - -// Doesn't matter what the args are here. -// _transform does all the work. -// That we got here means that the readable side wants more data. -Transform.prototype._read = function (n) { - var ts = this._transformState; - if (ts.writechunk !== null && ts.writecb && !ts.transforming) { - ts.transforming = true; - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); - } else { - // mark that we need a transform, so that any data that comes in - // will get processed, now that we've asked for it. - ts.needTransform = true; - } -}; + state.length -= n; -function done(stream, er) { - if (er) return stream.emit('error', er); + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (state.length === 0 && !state.ended) state.needReadable = true; - // if there's nothing in the write buffer, then that means - // that nothing more will ever be provided - var ws = stream._writableState; - var ts = stream._transformState; + // If we tried to read() past the EOF, then emit end on the next tick. + if (nOrig !== n && state.ended && state.length === 0) endReadable(this); - if (ws.length) throw new Error('Calling transform done when ws.length != 0'); + if (ret !== null) this.emit('data', ret); - if (ts.transforming) throw new Error('Calling transform done when still transforming'); + return ret; +}; - return stream.push(null); +function chunkInvalid(state, chunk) { + var er = null; + if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + return er; } -},{"./_stream_duplex":451,"core-util-is":380,"inherits":428}],455:[function(require,module,exports){ -(function (process){ -// A bit simpler than readable streams. -// Implement an async ._write(chunk, encoding, cb), and it'll handle all -// the drain event emission and buffering. -'use strict'; +function onEofChunk(stream, state) { + if (state.ended) return; + if (state.decoder) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) { + state.buffer.push(chunk); + state.length += state.objectMode ? 1 : chunk.length; + } + } + state.ended = true; -module.exports = Writable; + // emit 'readable' now to make sure it gets picked up. + emitReadable(stream); +} -/**/ -var processNextTick = require('process-nextick-args'); -/**/ +// Don't emit readable right away in sync mode, because this can trigger +// another read() call => stack overflow. This way, it might trigger +// a nextTick recursion warning, but that's not so bad. +function emitReadable(stream) { + var state = stream._readableState; + state.needReadable = false; + if (!state.emittedReadable) { + debug('emitReadable', state.flowing); + state.emittedReadable = true; + if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream); + } +} -/**/ -var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick; -/**/ +function emitReadable_(stream) { + debug('emit readable'); + stream.emit('readable'); + flow(stream); +} -Writable.WritableState = WritableState; +// at this point, the user has presumably seen the 'readable' event, +// and called read() to consume some data. that may have triggered +// in turn another _read(n) call, in which case reading = true if +// it's in progress. +// However, if we're not ended, or reading, and the length < hwm, +// then go ahead and try to read some more preemptively. +function maybeReadMore(stream, state) { + if (!state.readingMore) { + state.readingMore = true; + processNextTick(maybeReadMore_, stream, state); + } +} -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ +function maybeReadMore_(stream, state) { + var len = state.length; + while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { + debug('maybeReadMore read 0'); + stream.read(0); + if (len === state.length) + // didn't get any data, stop spinning. + break;else len = state.length; + } + state.readingMore = false; +} -/**/ -var internalUtil = { - deprecate: require('util-deprecate') +// abstract method. to be overridden in specific implementation classes. +// call cb(er, data) where data is <= n in length. +// for virtual (non-string, non-buffer) streams, "length" is somewhat +// arbitrary, and perhaps not very meaningful. +Readable.prototype._read = function (n) { + this.emit('error', new Error('not implemented')); }; -/**/ - -/**/ -var Stream; -(function () { - try { - Stream = require('st' + 'ream'); - } catch (_) {} finally { - if (!Stream) Stream = require('events').EventEmitter; - } -})(); -/**/ -var Buffer = require('buffer').Buffer; -/**/ -var bufferShim = require('buffer-shims'); -/**/ +Readable.prototype.pipe = function (dest, pipeOpts) { + var src = this; + var state = this._readableState; -util.inherits(Writable, Stream); + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + case 1: + state.pipes = [state.pipes, dest]; + break; + default: + state.pipes.push(dest); + break; + } + state.pipesCount += 1; + debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); -function nop() {} + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; -function WriteReq(chunk, encoding, cb) { - this.chunk = chunk; - this.encoding = encoding; - this.callback = cb; - this.next = null; -} + var endFn = doEnd ? onend : cleanup; + if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn); -var Duplex; -function WritableState(options, stream) { - Duplex = Duplex || require('./_stream_duplex'); + dest.on('unpipe', onunpipe); + function onunpipe(readable) { + debug('onunpipe'); + if (readable === src) { + cleanup(); + } + } - options = options || {}; + function onend() { + debug('onend'); + dest.end(); + } - // object stream flag to indicate whether or not this stream - // contains buffers or objects. - this.objectMode = !!options.objectMode; + // when the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. + var ondrain = pipeOnDrain(src); + dest.on('drain', ondrain); - if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode; + var cleanedUp = false; + function cleanup() { + debug('cleanup'); + // cleanup event handlers once the pipe is broken + dest.removeListener('close', onclose); + dest.removeListener('finish', onfinish); + dest.removeListener('drain', ondrain); + dest.removeListener('error', onerror); + dest.removeListener('unpipe', onunpipe); + src.removeListener('end', onend); + src.removeListener('end', cleanup); + src.removeListener('data', ondata); - // the point at which write() starts returning false - // Note: 0 is a valid value, means that we always return false if - // the entire buffer is not flushed immediately on write() - var hwm = options.highWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; + cleanedUp = true; - // cast to ints. - this.highWaterMark = ~ ~this.highWaterMark; + // if the reader is waiting for a drain event from this + // specific writer, then it would cause it to never start + // flowing again. + // So, if this is awaiting a drain, then we just call it now. + // If we don't know, then assume that we are waiting for one. + if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); + } - this.needDrain = false; - // at the start of calling end() - this.ending = false; - // when end() has been called, and returned - this.ended = false; - // when 'finish' is emitted - this.finished = false; + src.on('data', ondata); + function ondata(chunk) { + debug('ondata'); + var ret = dest.write(chunk); + if (false === ret) { + // If the user unpiped during `dest.write()`, it is possible + // to get stuck in a permanently paused state if that write + // also returned false. + // => Check whether `dest` is still a piping destination. + if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { + debug('false write response, pause', src._readableState.awaitDrain); + src._readableState.awaitDrain++; + } + src.pause(); + } + } - // should we decode strings into buffers before passing to _write? - // this is here so that some node-core streams can optimize string - // handling at a lower level. - var noDecode = options.decodeStrings === false; - this.decodeStrings = !noDecode; + // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. + function onerror(er) { + debug('onerror', er); + unpipe(); + dest.removeListener('error', onerror); + if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); + } - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; + // Make sure our error handler is attached before userland ones. + prependListener(dest, 'error', onerror); - // not an actual buffer we keep track of, but a measurement - // of how much we're waiting to get pushed to some underlying - // socket or file. - this.length = 0; + // Both close and finish should trigger unpipe, but only once. + function onclose() { + dest.removeListener('finish', onfinish); + unpipe(); + } + dest.once('close', onclose); + function onfinish() { + debug('onfinish'); + dest.removeListener('close', onclose); + unpipe(); + } + dest.once('finish', onfinish); - // a flag to see when we're in the middle of a write. - this.writing = false; + function unpipe() { + debug('unpipe'); + src.unpipe(dest); + } - // when true all writes will be buffered until .uncork() call - this.corked = 0; + // tell the dest that it's being piped to + dest.emit('pipe', src); - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; + // start the flow if it hasn't been started already. + if (!state.flowing) { + debug('pipe resume'); + src.resume(); + } - // a flag to know if we're processing previously buffered items, which - // may call the _write() callback in the same tick, so that we don't - // end up in an overlapped onwrite situation. - this.bufferProcessing = false; + return dest; +}; - // the callback that's passed to _write(chunk,cb) - this.onwrite = function (er) { - onwrite(stream, er); +function pipeOnDrain(src) { + return function () { + var state = src._readableState; + debug('pipeOnDrain', state.awaitDrain); + if (state.awaitDrain) state.awaitDrain--; + if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { + state.flowing = true; + flow(src); + } }; +} - // the callback that the user supplies to write(chunk,encoding,cb) - this.writecb = null; - - // the amount that is being written when _write is called. - this.writelen = 0; +Readable.prototype.unpipe = function (dest) { + var state = this._readableState; - this.bufferedRequest = null; - this.lastBufferedRequest = null; + // if we're not piping anywhere, then do nothing. + if (state.pipesCount === 0) return this; - // number of pending user-supplied write callbacks - // this must be 0 before 'finish' can be emitted - this.pendingcb = 0; + // just one destination. most common case. + if (state.pipesCount === 1) { + // passed in one, but it's not the right one. + if (dest && dest !== state.pipes) return this; - // emit prefinish if the only thing we're waiting for is _write cbs - // This is relevant for synchronous Transform streams - this.prefinished = false; + if (!dest) dest = state.pipes; - // True if the error was already emitted and should not be thrown again - this.errorEmitted = false; + // got a match. + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) dest.emit('unpipe', this); + return this; + } - // count buffered requests - this.bufferedRequestCount = 0; + // slow case. multiple pipe destinations. - // allocate the first CorkedRequest, there is always - // one allocated and free to use, and we maintain at most two - this.corkedRequestsFree = new CorkedRequest(this); -} + if (!dest) { + // remove all. + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; -WritableState.prototype.getBuffer = function writableStateGetBuffer() { - var current = this.bufferedRequest; - var out = []; - while (current) { - out.push(current); - current = current.next; + for (var _i = 0; _i < len; _i++) { + dests[_i].emit('unpipe', this); + }return this; } - return out; -}; - -(function () { - try { - Object.defineProperty(WritableState.prototype, 'buffer', { - get: internalUtil.deprecate(function () { - return this.getBuffer(); - }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.') - }); - } catch (_) {} -})(); -var Duplex; -function Writable(options) { - Duplex = Duplex || require('./_stream_duplex'); + // try to find the right one. + var i = indexOf(state.pipes, dest); + if (i === -1) return this; - // Writable ctor is applied to Duplexes, though they're not - // instanceof Writable, they're instanceof Readable. - if (!(this instanceof Writable) && !(this instanceof Duplex)) return new Writable(options); + state.pipes.splice(i, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) state.pipes = state.pipes[0]; - this._writableState = new WritableState(options, this); + dest.emit('unpipe', this); - // legacy. - this.writable = true; + return this; +}; - if (options) { - if (typeof options.write === 'function') this._write = options.write; +// set up data events if they are asked for +// Ensure readable listeners eventually get something +Readable.prototype.on = function (ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); - if (typeof options.writev === 'function') this._writev = options.writev; + // If listening to data, and it has not explicitly been paused, + // then call resume to start the flow of data on the next tick. + if (ev === 'data' && false !== this._readableState.flowing) { + this.resume(); } - Stream.call(this); -} + if (ev === 'readable' && !this._readableState.endEmitted) { + var state = this._readableState; + if (!state.readableListening) { + state.readableListening = true; + state.emittedReadable = false; + state.needReadable = true; + if (!state.reading) { + processNextTick(nReadingNextTick, this); + } else if (state.length) { + emitReadable(this, state); + } + } + } -// Otherwise people can pipe Writable streams, which is just wrong. -Writable.prototype.pipe = function () { - this.emit('error', new Error('Cannot pipe, not readable')); + return res; }; +Readable.prototype.addListener = Readable.prototype.on; -function writeAfterEnd(stream, cb) { - var er = new Error('write after end'); - // TODO: defer error events consistently everywhere, not just the cb - stream.emit('error', er); - processNextTick(cb, er); -} - -// If we get something that is not a buffer, string, null, or undefined, -// and we're not in objectMode, then that's an error. -// Otherwise stream chunks are all considered to be of length=1, and the -// watermarks determine how many objects to keep in the buffer, rather than -// how many bytes or characters. -function validChunk(stream, state, chunk, cb) { - var valid = true; - var er = false; - // Always throw error if a null is written - // if we are not in object mode then throw - // if it is not a buffer, string, or undefined. - if (chunk === null) { - er = new TypeError('May not write null values to stream'); - } else if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); +function nReadingNextTick(self) { + debug('readable nexttick read 0'); + self.read(0); +} + +// pause() and resume() are remnants of the legacy readable stream API +// If the user uses them, then switch into old mode. +Readable.prototype.resume = function () { + var state = this._readableState; + if (!state.flowing) { + debug('resume'); + state.flowing = true; + resume(this, state); } - if (er) { - stream.emit('error', er); - processNextTick(cb, er); - valid = false; + return this; +}; + +function resume(stream, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + processNextTick(resume_, stream, state); } - return valid; } -Writable.prototype.write = function (chunk, encoding, cb) { - var state = this._writableState; - var ret = false; - - if (typeof encoding === 'function') { - cb = encoding; - encoding = null; +function resume_(stream, state) { + if (!state.reading) { + debug('resume read 0'); + stream.read(0); } - if (Buffer.isBuffer(chunk)) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; + state.resumeScheduled = false; + stream.emit('resume'); + flow(stream); + if (state.flowing && !state.reading) stream.read(0); +} - if (typeof cb !== 'function') cb = nop; +Readable.prototype.pause = function () { + debug('call pause flowing=%j', this._readableState.flowing); + if (false !== this._readableState.flowing) { + debug('pause'); + this._readableState.flowing = false; + this.emit('pause'); + } + return this; +}; - if (state.ended) writeAfterEnd(this, cb);else if (validChunk(this, state, chunk, cb)) { - state.pendingcb++; - ret = writeOrBuffer(this, state, chunk, encoding, cb); +function flow(stream) { + var state = stream._readableState; + debug('flow', state.flowing); + if (state.flowing) { + do { + var chunk = stream.read(); + } while (null !== chunk && state.flowing); } +} - return ret; -}; +// wrap an old-style stream as the async data source. +// This is *not* part of the readable stream interface. +// It is an ugly unfortunate mess of history. +Readable.prototype.wrap = function (stream) { + var state = this._readableState; + var paused = false; -Writable.prototype.cork = function () { - var state = this._writableState; + var self = this; + stream.on('end', function () { + debug('wrapped end'); + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) self.push(chunk); + } - state.corked++; -}; + self.push(null); + }); -Writable.prototype.uncork = function () { - var state = this._writableState; + stream.on('data', function (chunk) { + debug('wrapped data'); + if (state.decoder) chunk = state.decoder.write(chunk); - if (state.corked) { - state.corked--; + // don't skip over falsy values in objectMode + if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; - if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); + var ret = self.push(chunk); + if (!ret) { + paused = true; + stream.pause(); + } + }); + + // proxy all the other methods. + // important when wrapping filters and duplexes. + for (var i in stream) { + if (this[i] === undefined && typeof stream[i] === 'function') { + this[i] = function (method) { + return function () { + return stream[method].apply(stream, arguments); + }; + }(i); + } } -}; -Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { - // node::ParseEncoding() requires lower case. - if (typeof encoding === 'string') encoding = encoding.toLowerCase(); - if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); - this._writableState.defaultEncoding = encoding; - return this; -}; + // proxy certain important events. + var events = ['error', 'close', 'destroy', 'pause', 'resume']; + forEach(events, function (ev) { + stream.on(ev, self.emit.bind(self, ev)); + }); -function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { - chunk = bufferShim.from(chunk, encoding); - } - return chunk; -} + // when we try to consume some more bytes, simply unpause the + // underlying stream. + self._read = function (n) { + debug('wrapped _read', n); + if (paused) { + paused = false; + stream.resume(); + } + }; -// if we're already writing something, then just put this -// in the queue, and wait our turn. Otherwise, call _write -// If we return false, then we need a drain event, so set that flag. -function writeOrBuffer(stream, state, chunk, encoding, cb) { - chunk = decodeChunk(state, chunk, encoding); + return self; +}; - if (Buffer.isBuffer(chunk)) encoding = 'buffer'; - var len = state.objectMode ? 1 : chunk.length; +// exposed for testing purposes only. +Readable._fromList = fromList; - state.length += len; +// Pluck off n bytes from an array of buffers. +// Length is the combined lengths of all the buffers in the list. +function fromList(n, state) { + var list = state.buffer; + var length = state.length; + var stringMode = !!state.decoder; + var objectMode = !!state.objectMode; + var ret; - var ret = state.length < state.highWaterMark; - // we must ensure that previous needDrain will not be reset to false. - if (!ret) state.needDrain = true; + // nothing in the list, definitely empty. + if (list.length === 0) return null; - if (state.writing || state.corked) { - var last = state.lastBufferedRequest; - state.lastBufferedRequest = new WriteReq(chunk, encoding, cb); - if (last) { - last.next = state.lastBufferedRequest; + if (length === 0) ret = null;else if (objectMode) ret = list.shift();else if (!n || n >= length) { + // read it all, truncate the array. + if (stringMode) ret = list.join('');else if (list.length === 1) ret = list[0];else ret = Buffer.concat(list, length); + list.length = 0; + } else { + // read just some of it. + if (n < list[0].length) { + // just take a part of the first list item. + // slice is the same for buffers and strings. + var buf = list[0]; + ret = buf.slice(0, n); + list[0] = buf.slice(n); + } else if (n === list[0].length) { + // first list is a perfect match + ret = list.shift(); } else { - state.bufferedRequest = state.lastBufferedRequest; + // complex case. + // we have enough to cover it, but it spans past the first buffer. + if (stringMode) ret = '';else ret = bufferShim.allocUnsafe(n); + + var c = 0; + for (var i = 0, l = list.length; i < l && c < n; i++) { + var _buf = list[0]; + var cpy = Math.min(n - c, _buf.length); + + if (stringMode) ret += _buf.slice(0, cpy);else _buf.copy(ret, c, 0, cpy); + + if (cpy < _buf.length) list[0] = _buf.slice(cpy);else list.shift(); + + c += cpy; + } } - state.bufferedRequestCount += 1; - } else { - doWrite(stream, state, false, len, chunk, encoding, cb); } return ret; } -function doWrite(stream, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); - state.sync = false; +function endReadable(stream) { + var state = stream._readableState; + + // If we get here before consuming all the bytes, then that is a + // bug in node. Should never happen. + if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); + + if (!state.endEmitted) { + state.ended = true; + processNextTick(endReadableNT, state, stream); + } } -function onwriteError(stream, state, sync, er, cb) { - --state.pendingcb; - if (sync) processNextTick(cb, er);else cb(er); +function endReadableNT(state, stream) { + // Check that we didn't get one last unshift. + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); + } +} - stream._writableState.errorEmitted = true; - stream.emit('error', er); +function forEach(xs, f) { + for (var i = 0, l = xs.length; i < l; i++) { + f(xs[i], i); + } } -function onwriteStateUpdate(state) { - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; +function indexOf(xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; } +}).call(this,require('_process')) +},{"./_stream_duplex":452,"_process":443,"buffer":84,"buffer-shims":82,"core-util-is":381,"events":419,"inherits":429,"isarray":431,"process-nextick-args":442,"string_decoder/":478,"util":56}],455:[function(require,module,exports){ +// a transform stream is a readable/writable stream where you do +// something with the data. Sometimes it's called a "filter", +// but that's not a great name for it, since that implies a thing where +// some bits pass through, and others are simply ignored. (That would +// be a valid example of a transform, of course.) +// +// While the output is causally related to the input, it's not a +// necessarily symmetric or synchronous transformation. For example, +// a zlib stream might take multiple plain-text writes(), and then +// emit a single compressed chunk some time in the future. +// +// Here's how this works: +// +// The Transform stream has all the aspects of the readable and writable +// stream classes. When you write(chunk), that calls _write(chunk,cb) +// internally, and returns false if there's a lot of pending writes +// buffered up. When you call read(), that calls _read(n) until +// there's enough pending readable data buffered up. +// +// In a transform stream, the written data is placed in a buffer. When +// _read(n) is called, it transforms the queued up data, calling the +// buffered _write cb's as it consumes chunks. If consuming a single +// written chunk would result in multiple output chunks, then the first +// outputted bit calls the readcb, and subsequent chunks just go into +// the read buffer, and will cause it to emit 'readable' if necessary. +// +// This way, back-pressure is actually determined by the reading side, +// since _read has to be called to start processing a new chunk. However, +// a pathological inflate type of transform can cause excessive buffering +// here. For example, imagine a stream where every byte of input is +// interpreted as an integer from 0-255, and then results in that many +// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in +// 1kb of data being output. In this case, you could write a very small +// amount of input, and end up with a very large amount of output. In +// such a pathological inflating mechanism, there'd be no way to tell +// the system to stop doing the transform. A single 4MB write could +// cause the system to run out of memory. +// +// However, even in such a pathological case, only a single written chunk +// would be consumed, and then the rest would wait (un-transformed) until +// the results of the previous transformed chunk were consumed. -function onwrite(stream, er) { - var state = stream._writableState; - var sync = state.sync; - var cb = state.writecb; +'use strict'; - onwriteStateUpdate(state); +module.exports = Transform; - if (er) onwriteError(stream, state, sync, er, cb);else { - // Check if we're actually ready to finish, but don't emit yet - var finished = needFinish(state); +var Duplex = require('./_stream_duplex'); - if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { - clearBuffer(stream, state); - } +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ - if (sync) { - /**/ - asyncWrite(afterWrite, stream, state, finished, cb); - /**/ - } else { - afterWrite(stream, state, finished, cb); - } - } -} +util.inherits(Transform, Duplex); -function afterWrite(stream, state, finished, cb) { - if (!finished) onwriteDrain(stream, state); - state.pendingcb--; - cb(); - finishMaybe(stream, state); -} +function TransformState(stream) { + this.afterTransform = function (er, data) { + return afterTransform(stream, er, data); + }; -// Must force callback to be called on nextTick, so that we don't -// emit 'drain' before the write() consumer gets the 'false' return -// value, and has a chance to attach a 'drain' listener. -function onwriteDrain(stream, state) { - if (state.length === 0 && state.needDrain) { - state.needDrain = false; - stream.emit('drain'); - } + this.needTransform = false; + this.transforming = false; + this.writecb = null; + this.writechunk = null; + this.writeencoding = null; } -// if there's something in the buffer waiting, then process it -function clearBuffer(stream, state) { - state.bufferProcessing = true; - var entry = state.bufferedRequest; +function afterTransform(stream, er, data) { + var ts = stream._transformState; + ts.transforming = false; - if (stream._writev && entry && entry.next) { - // Fast case, write everything using _writev() - var l = state.bufferedRequestCount; - var buffer = new Array(l); - var holder = state.corkedRequestsFree; - holder.entry = entry; + var cb = ts.writecb; - var count = 0; - while (entry) { - buffer[count] = entry; - entry = entry.next; - count += 1; - } + if (!cb) return stream.emit('error', new Error('no writecb in Transform class')); - doWrite(stream, state, true, state.length, buffer, '', holder.finish); + ts.writechunk = null; + ts.writecb = null; - // doWrite is almost always async, defer these to save a bit of time - // as the hot path ends with doWrite - state.pendingcb++; - state.lastBufferedRequest = null; - if (holder.next) { - state.corkedRequestsFree = holder.next; - holder.next = null; - } else { - state.corkedRequestsFree = new CorkedRequest(state); - } - } else { - // Slow case, write chunks one-by-one - while (entry) { - var chunk = entry.chunk; - var encoding = entry.encoding; - var cb = entry.callback; - var len = state.objectMode ? 1 : chunk.length; + if (data !== null && data !== undefined) stream.push(data); - doWrite(stream, state, false, len, chunk, encoding, cb); - entry = entry.next; - // if we didn't call the onwrite immediately, then - // it means that we need to wait until it does. - // also, that means that the chunk and cb are currently - // being processed, so move the buffer counter past them. - if (state.writing) { - break; - } - } + cb(er); - if (entry === null) state.lastBufferedRequest = null; + var rs = stream._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + stream._read(rs.highWaterMark); } - - state.bufferedRequestCount = 0; - state.bufferedRequest = entry; - state.bufferProcessing = false; } -Writable.prototype._write = function (chunk, encoding, cb) { - cb(new Error('not implemented')); -}; +function Transform(options) { + if (!(this instanceof Transform)) return new Transform(options); -Writable.prototype._writev = null; + Duplex.call(this, options); -Writable.prototype.end = function (chunk, encoding, cb) { - var state = this._writableState; + this._transformState = new TransformState(this); - if (typeof chunk === 'function') { - cb = chunk; - chunk = null; - encoding = null; - } else if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } + // when the writable side finishes, then flush out anything remaining. + var stream = this; - if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); + // start out asking for a readable event once data is transformed. + this._readableState.needReadable = true; - // .end() fully uncorks - if (state.corked) { - state.corked = 1; - this.uncork(); + // we have implemented the _read method, and done the other things + // that Readable wants before the first _read call, so unset the + // sync guard flag. + this._readableState.sync = false; + + if (options) { + if (typeof options.transform === 'function') this._transform = options.transform; + + if (typeof options.flush === 'function') this._flush = options.flush; } - // ignore unnecessary end() calls. - if (!state.ending && !state.finished) endWritable(this, state, cb); + this.once('prefinish', function () { + if (typeof this._flush === 'function') this._flush(function (er) { + done(stream, er); + });else done(stream); + }); +} + +Transform.prototype.push = function (chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); }; -function needFinish(state) { - return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; -} +// This is the part where you do stuff! +// override this function in implementation classes. +// 'chunk' is an input chunk. +// +// Call `push(newChunk)` to pass along transformed output +// to the readable side. You may call 'push' zero or more times. +// +// Call `cb(err)` when you are done with this chunk. If you pass +// an error, then that'll put the hurt on the whole operation. If you +// never call cb(), then you'll never get another chunk. +Transform.prototype._transform = function (chunk, encoding, cb) { + throw new Error('Not implemented'); +}; -function prefinish(stream, state) { - if (!state.prefinished) { - state.prefinished = true; - stream.emit('prefinish'); +Transform.prototype._write = function (chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); } -} +}; -function finishMaybe(stream, state) { - var need = needFinish(state); - if (need) { - if (state.pendingcb === 0) { - prefinish(stream, state); - state.finished = true; - stream.emit('finish'); - } else { - prefinish(stream, state); - } - } - return need; -} +// Doesn't matter what the args are here. +// _transform does all the work. +// That we got here means that the readable side wants more data. +Transform.prototype._read = function (n) { + var ts = this._transformState; -function endWritable(stream, state, cb) { - state.ending = true; - finishMaybe(stream, state); - if (cb) { - if (state.finished) processNextTick(cb);else stream.once('finish', cb); + if (ts.writechunk !== null && ts.writecb && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + // mark that we need a transform, so that any data that comes in + // will get processed, now that we've asked for it. + ts.needTransform = true; } - state.ended = true; - stream.writable = false; -} +}; -// It seems a linked list but it is not -// there will be only 2 of these for each stream -function CorkedRequest(state) { - var _this = this; +function done(stream, er) { + if (er) return stream.emit('error', er); - this.next = null; - this.entry = null; + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided + var ws = stream._writableState; + var ts = stream._transformState; - this.finish = function (err) { - var entry = _this.entry; - _this.entry = null; - while (entry) { - var cb = entry.callback; - state.pendingcb--; - cb(err); - entry = entry.next; - } - if (state.corkedRequestsFree) { - state.corkedRequestsFree.next = _this; - } else { - state.corkedRequestsFree = _this; - } - }; -} -}).call(this,require('_process')) -},{"./_stream_duplex":451,"_process":442,"buffer":83,"buffer-shims":81,"core-util-is":380,"events":418,"inherits":428,"process-nextick-args":441,"util-deprecate":479}],456:[function(require,module,exports){ -module.exports = require("./lib/_stream_passthrough.js") + if (ws.length) throw new Error('Calling transform done when ws.length != 0'); -},{"./lib/_stream_passthrough.js":452}],457:[function(require,module,exports){ -(function (process){ -var Stream = (function (){ - try { - return require('st' + 'ream'); // hack to fix a circular dependency issue when used with browserify - } catch(_){} -}()); -exports = module.exports = require('./lib/_stream_readable.js'); -exports.Stream = Stream || exports; -exports.Readable = exports; -exports.Writable = require('./lib/_stream_writable.js'); -exports.Duplex = require('./lib/_stream_duplex.js'); -exports.Transform = require('./lib/_stream_transform.js'); -exports.PassThrough = require('./lib/_stream_passthrough.js'); + if (ts.transforming) throw new Error('Calling transform done when still transforming'); -if (!process.browser && process.env.READABLE_STREAM === 'disable' && Stream) { - module.exports = Stream; + return stream.push(null); } +},{"./_stream_duplex":452,"core-util-is":381,"inherits":429}],456:[function(require,module,exports){ +(function (process){ +// A bit simpler than readable streams. +// Implement an async ._write(chunk, encoding, cb), and it'll handle all +// the drain event emission and buffering. -}).call(this,require('_process')) -},{"./lib/_stream_duplex.js":451,"./lib/_stream_passthrough.js":452,"./lib/_stream_readable.js":453,"./lib/_stream_transform.js":454,"./lib/_stream_writable.js":455,"_process":442}],458:[function(require,module,exports){ -module.exports = require("./lib/_stream_transform.js") - -},{"./lib/_stream_transform.js":454}],459:[function(require,module,exports){ -module.exports = require("./lib/_stream_writable.js") - -},{"./lib/_stream_writable.js":455}],460:[function(require,module,exports){ -(function (process,global){ -/** - * Copyright (c) 2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * https://raw.github.com/facebook/regenerator/master/LICENSE file. An - * additional grant of patent rights can be found in the PATENTS file in - * the same directory. - */ - -!(function(global) { - "use strict"; +'use strict'; - var hasOwn = Object.prototype.hasOwnProperty; - var undefined; // More compressible than void 0. - var $Symbol = typeof Symbol === "function" ? Symbol : {}; - var iteratorSymbol = $Symbol.iterator || "@@iterator"; - var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; +module.exports = Writable; - var inModule = typeof module === "object"; - var runtime = global.regeneratorRuntime; - if (runtime) { - if (inModule) { - // If regeneratorRuntime is defined globally and we're in a module, - // make the exports object identical to regeneratorRuntime. - module.exports = runtime; - } - // Don't bother evaluating the rest of this file if the runtime was - // already defined globally. - return; - } +/**/ +var processNextTick = require('process-nextick-args'); +/**/ - // Define the runtime globally (as expected by generated code) as either - // module.exports (if we're in a module) or a new, empty object. - runtime = global.regeneratorRuntime = inModule ? module.exports : {}; +/**/ +var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick; +/**/ - function wrap(innerFn, outerFn, self, tryLocsList) { - // If outerFn provided, then outerFn.prototype instanceof Generator. - var generator = Object.create((outerFn || Generator).prototype); - var context = new Context(tryLocsList || []); +Writable.WritableState = WritableState; - // The ._invoke method unifies the implementations of the .next, - // .throw, and .return methods. - generator._invoke = makeInvokeMethod(innerFn, self, context); +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ - return generator; - } - runtime.wrap = wrap; +/**/ +var internalUtil = { + deprecate: require('util-deprecate') +}; +/**/ - // Try/catch helper to minimize deoptimizations. Returns a completion - // record like context.tryEntries[i].completion. This interface could - // have been (and was previously) designed to take a closure to be - // invoked without arguments, but in all the cases we care about we - // already have an existing method we want to call, so there's no need - // to create a new function object. We can even get away with assuming - // the method takes exactly one argument, since that happens to be true - // in every case, so we don't have to touch the arguments object. The - // only additional allocation required is the completion record, which - // has a stable shape and so hopefully should be cheap to allocate. - function tryCatch(fn, obj, arg) { - try { - return { type: "normal", arg: fn.call(obj, arg) }; - } catch (err) { - return { type: "throw", arg: err }; - } +/**/ +var Stream; +(function () { + try { + Stream = require('st' + 'ream'); + } catch (_) {} finally { + if (!Stream) Stream = require('events').EventEmitter; } +})(); +/**/ - var GenStateSuspendedStart = "suspendedStart"; - var GenStateSuspendedYield = "suspendedYield"; - var GenStateExecuting = "executing"; - var GenStateCompleted = "completed"; +var Buffer = require('buffer').Buffer; +/**/ +var bufferShim = require('buffer-shims'); +/**/ - // Returning this object from the innerFn has the same effect as - // breaking out of the dispatch switch statement. - var ContinueSentinel = {}; +util.inherits(Writable, Stream); - // Dummy constructor functions that we use as the .constructor and - // .constructor.prototype properties for functions that return Generator - // objects. For full spec compliance, you may wish to configure your - // minifier not to mangle the names of these two functions. - function Generator() {} - function GeneratorFunction() {} - function GeneratorFunctionPrototype() {} +function nop() {} - var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype; - GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; - GeneratorFunctionPrototype.constructor = GeneratorFunction; - GeneratorFunctionPrototype[toStringTagSymbol] = GeneratorFunction.displayName = "GeneratorFunction"; +function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; + this.next = null; +} - // Helper for defining the .next, .throw, and .return methods of the - // Iterator interface in terms of a single ._invoke method. - function defineIteratorMethods(prototype) { - ["next", "throw", "return"].forEach(function(method) { - prototype[method] = function(arg) { - return this._invoke(method, arg); - }; - }); - } +var Duplex; +function WritableState(options, stream) { + Duplex = Duplex || require('./_stream_duplex'); - runtime.isGeneratorFunction = function(genFun) { - var ctor = typeof genFun === "function" && genFun.constructor; - return ctor - ? ctor === GeneratorFunction || - // For the native GeneratorFunction constructor, the best we can - // do is to check its .name property. - (ctor.displayName || ctor.name) === "GeneratorFunction" - : false; - }; + options = options || {}; - runtime.mark = function(genFun) { - if (Object.setPrototypeOf) { - Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); - } else { - genFun.__proto__ = GeneratorFunctionPrototype; - if (!(toStringTagSymbol in genFun)) { - genFun[toStringTagSymbol] = "GeneratorFunction"; - } - } - genFun.prototype = Object.create(Gp); - return genFun; - }; + // object stream flag to indicate whether or not this stream + // contains buffers or objects. + this.objectMode = !!options.objectMode; - // Within the body of any async function, `await x` is transformed to - // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test - // `value instanceof AwaitArgument` to determine if the yielded value is - // meant to be awaited. Some may consider the name of this method too - // cutesy, but they are curmudgeons. - runtime.awrap = function(arg) { - return new AwaitArgument(arg); - }; + if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode; - function AwaitArgument(arg) { - this.arg = arg; - } + // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() + var hwm = options.highWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; - function AsyncIterator(generator) { - function invoke(method, arg, resolve, reject) { - var record = tryCatch(generator[method], generator, arg); - if (record.type === "throw") { - reject(record.arg); - } else { - var result = record.arg; - var value = result.value; - if (value instanceof AwaitArgument) { - return Promise.resolve(value.arg).then(function(value) { - invoke("next", value, resolve, reject); - }, function(err) { - invoke("throw", err, resolve, reject); - }); - } + // cast to ints. + this.highWaterMark = ~ ~this.highWaterMark; - return Promise.resolve(value).then(function(unwrapped) { - // When a yielded Promise is resolved, its final value becomes - // the .value of the Promise<{value,done}> result for the - // current iteration. If the Promise is rejected, however, the - // result for this iteration will be rejected with the same - // reason. Note that rejections of yielded Promises are not - // thrown back into the generator function, as is the case - // when an awaited Promise is rejected. This difference in - // behavior between yield and await is important, because it - // allows the consumer to decide what to do with the yielded - // rejection (swallow it and continue, manually .throw it back - // into the generator, abandon iteration, whatever). With - // await, by contrast, there is no opportunity to examine the - // rejection reason outside the generator function, so the - // only option is to throw it from the await expression, and - // let the generator function handle the exception. - result.value = unwrapped; - resolve(result); - }, reject); - } - } + this.needDrain = false; + // at the start of calling end() + this.ending = false; + // when end() has been called, and returned + this.ended = false; + // when 'finish' is emitted + this.finished = false; - if (typeof process === "object" && process.domain) { - invoke = process.domain.bind(invoke); - } + // should we decode strings into buffers before passing to _write? + // this is here so that some node-core streams can optimize string + // handling at a lower level. + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; - var previousPromise; + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; - function enqueue(method, arg) { - function callInvokeWithMethodAndArg() { - return new Promise(function(resolve, reject) { - invoke(method, arg, resolve, reject); - }); - } + // not an actual buffer we keep track of, but a measurement + // of how much we're waiting to get pushed to some underlying + // socket or file. + this.length = 0; - return previousPromise = - // If enqueue has been called before, then we want to wait until - // all previous Promises have been resolved before calling invoke, - // so that results are always delivered in the correct order. If - // enqueue has not been called before, then it is important to - // call invoke immediately, without waiting on a callback to fire, - // so that the async generator function has the opportunity to do - // any necessary setup in a predictable way. This predictability - // is why the Promise constructor synchronously invokes its - // executor callback, and why async functions synchronously - // execute code before the first await. Since we implement simple - // async functions in terms of async generators, it is especially - // important to get this right, even though it requires care. - previousPromise ? previousPromise.then( - callInvokeWithMethodAndArg, - // Avoid propagating failures to Promises returned by later - // invocations of the iterator. - callInvokeWithMethodAndArg - ) : callInvokeWithMethodAndArg(); - } + // a flag to see when we're in the middle of a write. + this.writing = false; - // Define the unified helper method that is used to implement .next, - // .throw, and .return (see defineIteratorMethods). - this._invoke = enqueue; - } + // when true all writes will be buffered until .uncork() call + this.corked = 0; - defineIteratorMethods(AsyncIterator.prototype); + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; - // Note that simple async functions are implemented on top of - // AsyncIterator objects; they just return a Promise for the value of - // the final result produced by the iterator. - runtime.async = function(innerFn, outerFn, self, tryLocsList) { - var iter = new AsyncIterator( - wrap(innerFn, outerFn, self, tryLocsList) - ); + // a flag to know if we're processing previously buffered items, which + // may call the _write() callback in the same tick, so that we don't + // end up in an overlapped onwrite situation. + this.bufferProcessing = false; - return runtime.isGeneratorFunction(outerFn) - ? iter // If outerFn is a generator, return the full iterator. - : iter.next().then(function(result) { - return result.done ? result.value : iter.next(); - }); + // the callback that's passed to _write(chunk,cb) + this.onwrite = function (er) { + onwrite(stream, er); }; - function makeInvokeMethod(innerFn, self, context) { - var state = GenStateSuspendedStart; - - return function invoke(method, arg) { - if (state === GenStateExecuting) { - throw new Error("Generator is already running"); - } - - if (state === GenStateCompleted) { - if (method === "throw") { - throw arg; - } + // the callback that the user supplies to write(chunk,encoding,cb) + this.writecb = null; - // Be forgiving, per 25.3.3.3.3 of the spec: - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume - return doneResult(); - } + // the amount that is being written when _write is called. + this.writelen = 0; - while (true) { - var delegate = context.delegate; - if (delegate) { - if (method === "return" || - (method === "throw" && delegate.iterator[method] === undefined)) { - // A return or throw (when the delegate iterator has no throw - // method) always terminates the yield* loop. - context.delegate = null; + this.bufferedRequest = null; + this.lastBufferedRequest = null; - // If the delegate iterator has a return method, give it a - // chance to clean up. - var returnMethod = delegate.iterator["return"]; - if (returnMethod) { - var record = tryCatch(returnMethod, delegate.iterator, arg); - if (record.type === "throw") { - // If the return method threw an exception, let that - // exception prevail over the original return or throw. - method = "throw"; - arg = record.arg; - continue; - } - } + // number of pending user-supplied write callbacks + // this must be 0 before 'finish' can be emitted + this.pendingcb = 0; - if (method === "return") { - // Continue with the outer return, now that the delegate - // iterator has been terminated. - continue; - } - } + // emit prefinish if the only thing we're waiting for is _write cbs + // This is relevant for synchronous Transform streams + this.prefinished = false; - var record = tryCatch( - delegate.iterator[method], - delegate.iterator, - arg - ); + // True if the error was already emitted and should not be thrown again + this.errorEmitted = false; - if (record.type === "throw") { - context.delegate = null; + // count buffered requests + this.bufferedRequestCount = 0; - // Like returning generator.throw(uncaught), but without the - // overhead of an extra function call. - method = "throw"; - arg = record.arg; - continue; - } + // allocate the first CorkedRequest, there is always + // one allocated and free to use, and we maintain at most two + this.corkedRequestsFree = new CorkedRequest(this); +} - // Delegate generator ran and handled its own exceptions so - // regardless of what the method was, we continue as if it is - // "next" with an undefined arg. - method = "next"; - arg = undefined; +WritableState.prototype.getBuffer = function writableStateGetBuffer() { + var current = this.bufferedRequest; + var out = []; + while (current) { + out.push(current); + current = current.next; + } + return out; +}; - var info = record.arg; - if (info.done) { - context[delegate.resultName] = info.value; - context.next = delegate.nextLoc; - } else { - state = GenStateSuspendedYield; - return info; - } +(function () { + try { + Object.defineProperty(WritableState.prototype, 'buffer', { + get: internalUtil.deprecate(function () { + return this.getBuffer(); + }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.') + }); + } catch (_) {} +})(); - context.delegate = null; - } +var Duplex; +function Writable(options) { + Duplex = Duplex || require('./_stream_duplex'); - if (method === "next") { - // Setting context._sent for legacy support of Babel's - // function.sent implementation. - context.sent = context._sent = arg; + // Writable ctor is applied to Duplexes, though they're not + // instanceof Writable, they're instanceof Readable. + if (!(this instanceof Writable) && !(this instanceof Duplex)) return new Writable(options); - } else if (method === "throw") { - if (state === GenStateSuspendedStart) { - state = GenStateCompleted; - throw arg; - } + this._writableState = new WritableState(options, this); - if (context.dispatchException(arg)) { - // If the dispatched exception was caught by a catch block, - // then let that catch block handle the exception normally. - method = "next"; - arg = undefined; - } + // legacy. + this.writable = true; - } else if (method === "return") { - context.abrupt("return", arg); - } + if (options) { + if (typeof options.write === 'function') this._write = options.write; - state = GenStateExecuting; + if (typeof options.writev === 'function') this._writev = options.writev; + } - var record = tryCatch(innerFn, self, context); - if (record.type === "normal") { - // If an exception is thrown from innerFn, we leave state === - // GenStateExecuting and loop back for another invocation. - state = context.done - ? GenStateCompleted - : GenStateSuspendedYield; + Stream.call(this); +} - var info = { - value: record.arg, - done: context.done - }; +// Otherwise people can pipe Writable streams, which is just wrong. +Writable.prototype.pipe = function () { + this.emit('error', new Error('Cannot pipe, not readable')); +}; - if (record.arg === ContinueSentinel) { - if (context.delegate && method === "next") { - // Deliberately forget the last sent value so that we don't - // accidentally pass it on to the delegate. - arg = undefined; - } - } else { - return info; - } +function writeAfterEnd(stream, cb) { + var er = new Error('write after end'); + // TODO: defer error events consistently everywhere, not just the cb + stream.emit('error', er); + processNextTick(cb, er); +} - } else if (record.type === "throw") { - state = GenStateCompleted; - // Dispatch the exception by looping back around to the - // context.dispatchException(arg) call above. - method = "throw"; - arg = record.arg; - } - } - }; +// If we get something that is not a buffer, string, null, or undefined, +// and we're not in objectMode, then that's an error. +// Otherwise stream chunks are all considered to be of length=1, and the +// watermarks determine how many objects to keep in the buffer, rather than +// how many bytes or characters. +function validChunk(stream, state, chunk, cb) { + var valid = true; + var er = false; + // Always throw error if a null is written + // if we are not in object mode then throw + // if it is not a buffer, string, or undefined. + if (chunk === null) { + er = new TypeError('May not write null values to stream'); + } else if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + if (er) { + stream.emit('error', er); + processNextTick(cb, er); + valid = false; + } + return valid; +} + +Writable.prototype.write = function (chunk, encoding, cb) { + var state = this._writableState; + var ret = false; + + if (typeof encoding === 'function') { + cb = encoding; + encoding = null; } - // Define Generator.prototype.{next,throw,return} in terms of the - // unified ._invoke helper method. - defineIteratorMethods(Gp); + if (Buffer.isBuffer(chunk)) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; - Gp[iteratorSymbol] = function() { - return this; - }; + if (typeof cb !== 'function') cb = nop; - Gp[toStringTagSymbol] = "Generator"; + if (state.ended) writeAfterEnd(this, cb);else if (validChunk(this, state, chunk, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, chunk, encoding, cb); + } - Gp.toString = function() { - return "[object Generator]"; - }; + return ret; +}; - function pushTryEntry(locs) { - var entry = { tryLoc: locs[0] }; +Writable.prototype.cork = function () { + var state = this._writableState; - if (1 in locs) { - entry.catchLoc = locs[1]; - } + state.corked++; +}; - if (2 in locs) { - entry.finallyLoc = locs[2]; - entry.afterLoc = locs[3]; - } +Writable.prototype.uncork = function () { + var state = this._writableState; - this.tryEntries.push(entry); - } + if (state.corked) { + state.corked--; - function resetTryEntry(entry) { - var record = entry.completion || {}; - record.type = "normal"; - delete record.arg; - entry.completion = record; + if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); } +}; - function Context(tryLocsList) { - // The root entry object (effectively a try statement without a catch - // or a finally block) gives us a place to store values thrown from - // locations where there is no enclosing try statement. - this.tryEntries = [{ tryLoc: "root" }]; - tryLocsList.forEach(pushTryEntry, this); - this.reset(true); +Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + // node::ParseEncoding() requires lower case. + if (typeof encoding === 'string') encoding = encoding.toLowerCase(); + if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); + this._writableState.defaultEncoding = encoding; + return this; +}; + +function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { + chunk = bufferShim.from(chunk, encoding); } + return chunk; +} - runtime.keys = function(object) { - var keys = []; - for (var key in object) { - keys.push(key); - } - keys.reverse(); +// if we're already writing something, then just put this +// in the queue, and wait our turn. Otherwise, call _write +// If we return false, then we need a drain event, so set that flag. +function writeOrBuffer(stream, state, chunk, encoding, cb) { + chunk = decodeChunk(state, chunk, encoding); - // Rather than returning an object with a next method, we keep - // things simple and return the next function itself. - return function next() { - while (keys.length) { - var key = keys.pop(); - if (key in object) { - next.value = key; - next.done = false; - return next; - } - } + if (Buffer.isBuffer(chunk)) encoding = 'buffer'; + var len = state.objectMode ? 1 : chunk.length; - // To avoid creating an additional object, we just hang the .value - // and .done properties off the next function object itself. This - // also ensures that the minifier will not anonymize the function. - next.done = true; - return next; - }; - }; + state.length += len; - function values(iterable) { - if (iterable) { - var iteratorMethod = iterable[iteratorSymbol]; - if (iteratorMethod) { - return iteratorMethod.call(iterable); - } + var ret = state.length < state.highWaterMark; + // we must ensure that previous needDrain will not be reset to false. + if (!ret) state.needDrain = true; - if (typeof iterable.next === "function") { - return iterable; - } + if (state.writing || state.corked) { + var last = state.lastBufferedRequest; + state.lastBufferedRequest = new WriteReq(chunk, encoding, cb); + if (last) { + last.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; + } + state.bufferedRequestCount += 1; + } else { + doWrite(stream, state, false, len, chunk, encoding, cb); + } - if (!isNaN(iterable.length)) { - var i = -1, next = function next() { - while (++i < iterable.length) { - if (hasOwn.call(iterable, i)) { - next.value = iterable[i]; - next.done = false; - return next; - } - } + return ret; +} - next.value = undefined; - next.done = true; +function doWrite(stream, state, writev, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); + state.sync = false; +} - return next; - }; +function onwriteError(stream, state, sync, er, cb) { + --state.pendingcb; + if (sync) processNextTick(cb, er);else cb(er); - return next.next = next; - } - } + stream._writableState.errorEmitted = true; + stream.emit('error', er); +} - // Return an iterator with no values. - return { next: doneResult }; - } - runtime.values = values; +function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; +} - function doneResult() { - return { value: undefined, done: true }; - } +function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; - Context.prototype = { - constructor: Context, + onwriteStateUpdate(state); - reset: function(skipTempReset) { - this.prev = 0; - this.next = 0; - // Resetting context._sent for legacy support of Babel's - // function.sent implementation. - this.sent = this._sent = undefined; - this.done = false; - this.delegate = null; + if (er) onwriteError(stream, state, sync, er, cb);else { + // Check if we're actually ready to finish, but don't emit yet + var finished = needFinish(state); - this.tryEntries.forEach(resetTryEntry); + if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { + clearBuffer(stream, state); + } - if (!skipTempReset) { - for (var name in this) { - // Not sure about the optimal order of these conditions: - if (name.charAt(0) === "t" && - hasOwn.call(this, name) && - !isNaN(+name.slice(1))) { - this[name] = undefined; - } - } + if (sync) { + /**/ + asyncWrite(afterWrite, stream, state, finished, cb); + /**/ + } else { + afterWrite(stream, state, finished, cb); } - }, + } +} - stop: function() { - this.done = true; +function afterWrite(stream, state, finished, cb) { + if (!finished) onwriteDrain(stream, state); + state.pendingcb--; + cb(); + finishMaybe(stream, state); +} - var rootEntry = this.tryEntries[0]; - var rootRecord = rootEntry.completion; - if (rootRecord.type === "throw") { - throw rootRecord.arg; - } +// Must force callback to be called on nextTick, so that we don't +// emit 'drain' before the write() consumer gets the 'false' return +// value, and has a chance to attach a 'drain' listener. +function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit('drain'); + } +} - return this.rval; - }, +// if there's something in the buffer waiting, then process it +function clearBuffer(stream, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; - dispatchException: function(exception) { - if (this.done) { - throw exception; - } + if (stream._writev && entry && entry.next) { + // Fast case, write everything using _writev() + var l = state.bufferedRequestCount; + var buffer = new Array(l); + var holder = state.corkedRequestsFree; + holder.entry = entry; - var context = this; - function handle(loc, caught) { - record.type = "throw"; - record.arg = exception; - context.next = loc; - return !!caught; - } + var count = 0; + while (entry) { + buffer[count] = entry; + entry = entry.next; + count += 1; + } - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - var record = entry.completion; + doWrite(stream, state, true, state.length, buffer, '', holder.finish); - if (entry.tryLoc === "root") { - // Exception thrown outside of any try block that could handle - // it, so set the completion value of the entire function to - // throw the exception. - return handle("end"); - } + // doWrite is almost always async, defer these to save a bit of time + // as the hot path ends with doWrite + state.pendingcb++; + state.lastBufferedRequest = null; + if (holder.next) { + state.corkedRequestsFree = holder.next; + holder.next = null; + } else { + state.corkedRequestsFree = new CorkedRequest(state); + } + } else { + // Slow case, write chunks one-by-one + while (entry) { + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; - if (entry.tryLoc <= this.prev) { - var hasCatch = hasOwn.call(entry, "catchLoc"); - var hasFinally = hasOwn.call(entry, "finallyLoc"); + doWrite(stream, state, false, len, chunk, encoding, cb); + entry = entry.next; + // if we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + if (state.writing) { + break; + } + } - if (hasCatch && hasFinally) { - if (this.prev < entry.catchLoc) { - return handle(entry.catchLoc, true); - } else if (this.prev < entry.finallyLoc) { - return handle(entry.finallyLoc); - } + if (entry === null) state.lastBufferedRequest = null; + } - } else if (hasCatch) { - if (this.prev < entry.catchLoc) { - return handle(entry.catchLoc, true); - } + state.bufferedRequestCount = 0; + state.bufferedRequest = entry; + state.bufferProcessing = false; +} - } else if (hasFinally) { - if (this.prev < entry.finallyLoc) { - return handle(entry.finallyLoc); - } +Writable.prototype._write = function (chunk, encoding, cb) { + cb(new Error('not implemented')); +}; - } else { - throw new Error("try statement without catch or finally"); - } - } - } - }, +Writable.prototype._writev = null; - abrupt: function(type, arg) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.tryLoc <= this.prev && - hasOwn.call(entry, "finallyLoc") && - this.prev < entry.finallyLoc) { - var finallyEntry = entry; - break; - } - } +Writable.prototype.end = function (chunk, encoding, cb) { + var state = this._writableState; - if (finallyEntry && - (type === "break" || - type === "continue") && - finallyEntry.tryLoc <= arg && - arg <= finallyEntry.finallyLoc) { - // Ignore the finally entry if control is not jumping to a - // location outside the try/catch block. - finallyEntry = null; - } + if (typeof chunk === 'function') { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } - var record = finallyEntry ? finallyEntry.completion : {}; - record.type = type; - record.arg = arg; + if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); - if (finallyEntry) { - this.next = finallyEntry.finallyLoc; - } else { - this.complete(record); - } + // .end() fully uncorks + if (state.corked) { + state.corked = 1; + this.uncork(); + } - return ContinueSentinel; - }, + // ignore unnecessary end() calls. + if (!state.ending && !state.finished) endWritable(this, state, cb); +}; - complete: function(record, afterLoc) { - if (record.type === "throw") { - throw record.arg; - } +function needFinish(state) { + return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; +} - if (record.type === "break" || - record.type === "continue") { - this.next = record.arg; - } else if (record.type === "return") { - this.rval = record.arg; - this.next = "end"; - } else if (record.type === "normal" && afterLoc) { - this.next = afterLoc; - } - }, +function prefinish(stream, state) { + if (!state.prefinished) { + state.prefinished = true; + stream.emit('prefinish'); + } +} - finish: function(finallyLoc) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.finallyLoc === finallyLoc) { - this.complete(entry.completion, entry.afterLoc); - resetTryEntry(entry); - return ContinueSentinel; - } - } - }, +function finishMaybe(stream, state) { + var need = needFinish(state); + if (need) { + if (state.pendingcb === 0) { + prefinish(stream, state); + state.finished = true; + stream.emit('finish'); + } else { + prefinish(stream, state); + } + } + return need; +} - "catch": function(tryLoc) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.tryLoc === tryLoc) { - var record = entry.completion; - if (record.type === "throw") { - var thrown = record.arg; - resetTryEntry(entry); - } - return thrown; - } - } +function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); + if (cb) { + if (state.finished) processNextTick(cb);else stream.once('finish', cb); + } + state.ended = true; + stream.writable = false; +} - // The context.catch method must only be called with a location - // argument that corresponds to a known catch block. - throw new Error("illegal catch attempt"); - }, +// It seems a linked list but it is not +// there will be only 2 of these for each stream +function CorkedRequest(state) { + var _this = this; - delegateYield: function(iterable, resultName, nextLoc) { - this.delegate = { - iterator: values(iterable), - resultName: resultName, - nextLoc: nextLoc - }; + this.next = null; + this.entry = null; - return ContinueSentinel; + this.finish = function (err) { + var entry = _this.entry; + _this.entry = null; + while (entry) { + var cb = entry.callback; + state.pendingcb--; + cb(err); + entry = entry.next; + } + if (state.corkedRequestsFree) { + state.corkedRequestsFree.next = _this; + } else { + state.corkedRequestsFree = _this; } }; -})( - // Among the various tricks for obtaining a reference to the global - // object, this seems to be the most reliable technique that does not - // use indirect eval (which violates Content Security Policy). - typeof global === "object" ? global : - typeof window === "object" ? window : - typeof self === "object" ? self : this -); +} +}).call(this,require('_process')) +},{"./_stream_duplex":452,"_process":443,"buffer":84,"buffer-shims":82,"core-util-is":381,"events":419,"inherits":429,"process-nextick-args":442,"util-deprecate":479}],457:[function(require,module,exports){ +module.exports = require("./lib/_stream_passthrough.js") -}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"_process":442}],461:[function(require,module,exports){ +},{"./lib/_stream_passthrough.js":453}],458:[function(require,module,exports){ +(function (process){ +var Stream = (function (){ + try { + return require('st' + 'ream'); // hack to fix a circular dependency issue when used with browserify + } catch(_){} +}()); +exports = module.exports = require('./lib/_stream_readable.js'); +exports.Stream = Stream || exports; +exports.Readable = exports; +exports.Writable = require('./lib/_stream_writable.js'); +exports.Duplex = require('./lib/_stream_duplex.js'); +exports.Transform = require('./lib/_stream_transform.js'); +exports.PassThrough = require('./lib/_stream_passthrough.js'); + +if (!process.browser && process.env.READABLE_STREAM === 'disable' && Stream) { + module.exports = Stream; +} + +}).call(this,require('_process')) +},{"./lib/_stream_duplex.js":452,"./lib/_stream_passthrough.js":453,"./lib/_stream_readable.js":454,"./lib/_stream_transform.js":455,"./lib/_stream_writable.js":456,"_process":443}],459:[function(require,module,exports){ +module.exports = require("./lib/_stream_transform.js") + +},{"./lib/_stream_transform.js":455}],460:[function(require,module,exports){ +module.exports = require("./lib/_stream_writable.js") + +},{"./lib/_stream_writable.js":456}],461:[function(require,module,exports){ (function (Buffer){ /* CryptoJS v3.1.2 @@ -65640,7 +65571,7 @@ function ripemd160 (message) { module.exports = ripemd160 }).call(this,require("buffer").Buffer) -},{"buffer":83}],462:[function(require,module,exports){ +},{"buffer":84}],462:[function(require,module,exports){ (function (Buffer){ const assert = require('assert') /** @@ -65873,7 +65804,7 @@ function toBuffer (v) { } }).call(this,require("buffer").Buffer) -},{"assert":48,"buffer":83}],463:[function(require,module,exports){ +},{"assert":48,"buffer":84}],463:[function(require,module,exports){ (function (Buffer){ var pbkdf2Sync = require('pbkdf2').pbkdf2Sync @@ -66056,7 +65987,7 @@ function arraycopy (src, srcPos, dest, destPos, length) { module.exports = scrypt }).call(this,require("buffer").Buffer) -},{"buffer":83,"pbkdf2":440}],464:[function(require,module,exports){ +},{"buffer":84,"pbkdf2":441}],464:[function(require,module,exports){ 'use strict' module.exports = require('./lib')(require('./lib/elliptic')) @@ -66108,7 +66039,7 @@ exports.isNumberInInterval = function (number, x, y, message) { } }).call(this,{"isBuffer":require("../../is-buffer/index.js")}) -},{"../../is-buffer/index.js":429}],466:[function(require,module,exports){ +},{"../../is-buffer/index.js":430}],466:[function(require,module,exports){ (function (Buffer){ 'use strict' var createHash = require('create-hash') @@ -66359,7 +66290,7 @@ exports.ecdhUnsafe = function (publicKey, privateKey, compressed) { } }).call(this,require("buffer").Buffer) -},{"../messages.json":468,"bn.js":53,"buffer":83,"create-hash":382,"elliptic":397}],467:[function(require,module,exports){ +},{"../messages.json":468,"bn.js":54,"buffer":84,"create-hash":383,"elliptic":398}],467:[function(require,module,exports){ (function (Buffer){ 'use strict' var bip66 = require('bip66') @@ -66679,7 +66610,7 @@ module.exports = function (secp256k1) { } }).call(this,require("buffer").Buffer) -},{"./assert":465,"./messages.json":468,"bip66":52,"buffer":83}],468:[function(require,module,exports){ +},{"./assert":465,"./messages.json":468,"bip66":53,"buffer":84}],468:[function(require,module,exports){ module.exports={ "COMPRESSED_TYPE_INVALID": "compressed should be a boolean", "EC_PRIVATE_KEY_TYPE_INVALID": "private key should be a Buffer", @@ -66790,7 +66721,7 @@ Hash.prototype._update = function () { module.exports = Hash }).call(this,require("buffer").Buffer) -},{"buffer":83}],470:[function(require,module,exports){ +},{"buffer":84}],470:[function(require,module,exports){ var exports = module.exports = function SHA (algorithm) { algorithm = algorithm.toLowerCase() @@ -66904,7 +66835,7 @@ Sha.prototype._hash = function () { module.exports = Sha }).call(this,require("buffer").Buffer) -},{"./hash":469,"buffer":83,"inherits":428}],472:[function(require,module,exports){ +},{"./hash":469,"buffer":84,"inherits":429}],472:[function(require,module,exports){ (function (Buffer){ /* * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined @@ -67006,7 +66937,7 @@ Sha1.prototype._hash = function () { module.exports = Sha1 }).call(this,require("buffer").Buffer) -},{"./hash":469,"buffer":83,"inherits":428}],473:[function(require,module,exports){ +},{"./hash":469,"buffer":84,"inherits":429}],473:[function(require,module,exports){ (function (Buffer){ /** * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined @@ -67062,7 +66993,7 @@ Sha224.prototype._hash = function () { module.exports = Sha224 }).call(this,require("buffer").Buffer) -},{"./hash":469,"./sha256":474,"buffer":83,"inherits":428}],474:[function(require,module,exports){ +},{"./hash":469,"./sha256":474,"buffer":84,"inherits":429}],474:[function(require,module,exports){ (function (Buffer){ /** * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined @@ -67200,7 +67131,7 @@ Sha256.prototype._hash = function () { module.exports = Sha256 }).call(this,require("buffer").Buffer) -},{"./hash":469,"buffer":83,"inherits":428}],475:[function(require,module,exports){ +},{"./hash":469,"buffer":84,"inherits":429}],475:[function(require,module,exports){ (function (Buffer){ var inherits = require('inherits') var SHA512 = require('./sha512') @@ -67260,7 +67191,7 @@ Sha384.prototype._hash = function () { module.exports = Sha384 }).call(this,require("buffer").Buffer) -},{"./hash":469,"./sha512":476,"buffer":83,"inherits":428}],476:[function(require,module,exports){ +},{"./hash":469,"./sha512":476,"buffer":84,"inherits":429}],476:[function(require,module,exports){ (function (Buffer){ var inherits = require('inherits') var Hash = require('./hash') @@ -67523,7 +67454,7 @@ Sha512.prototype._hash = function () { module.exports = Sha512 }).call(this,require("buffer").Buffer) -},{"./hash":469,"buffer":83,"inherits":428}],477:[function(require,module,exports){ +},{"./hash":469,"buffer":84,"inherits":429}],477:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -67652,7 +67583,7 @@ Stream.prototype.pipe = function(dest, options) { return dest; }; -},{"events":418,"inherits":428,"readable-stream/duplex.js":450,"readable-stream/passthrough.js":456,"readable-stream/readable.js":457,"readable-stream/transform.js":458,"readable-stream/writable.js":459}],478:[function(require,module,exports){ +},{"events":419,"inherits":429,"readable-stream/duplex.js":451,"readable-stream/passthrough.js":457,"readable-stream/readable.js":458,"readable-stream/transform.js":459,"readable-stream/writable.js":460}],478:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -67875,7 +67806,7 @@ function base64DetectIncompleteChar(buffer) { this.charLength = this.charReceived ? 3 : 0; } -},{"buffer":83}],479:[function(require,module,exports){ +},{"buffer":84}],479:[function(require,module,exports){ (function (global){ /** @@ -68543,7 +68474,7 @@ function hasOwnProperty(obj, prop) { } }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./support/isBuffer":480,"_process":442,"inherits":428}],482:[function(require,module,exports){ +},{"./support/isBuffer":480,"_process":443,"inherits":429}],482:[function(require,module,exports){ (function (global){ var rng; @@ -68903,4 +68834,4 @@ exports.createContext = Script.createContext = function (context) { return copy; }; -},{"indexof":427}]},{},[27]); +},{"indexof":428}]},{},[27]);