diff --git a/config/webpack.dev.js b/config/webpack.dev.js
index 0780f03b..021e92d6 100644
--- a/config/webpack.dev.js
+++ b/config/webpack.dev.js
@@ -1,7 +1,17 @@
const autoprefixer = require('autoprefixer');
const cssvars = require('postcss-simple-vars');
+const webpack = require('webpack');
const HtmlWebPackPlugin = require("html-webpack-plugin");
+
const paths = require('./paths');
+const getClientEnvironment = require('./env');
+
+// `publicUrl` we will provide it to our app
+// as %PUBLIC_URL% in `index.html` and `process.env.PUBLIC_URL` in JavaScript.
+// Omit trailing slash as %PUBLIC_PATH%/xyz looks better than %PUBLIC_PATH%xyz.
+var publicUrl = '';
+// Get environment variables to inject into our app.
+var env = getClientEnvironment(publicUrl);
const cssvariables = require(paths.appSrc + '/theme/variables');
@@ -71,7 +81,8 @@ module.exports = {
plugins: [
new HtmlWebPackPlugin({
template: paths.appHtml,
- filename: "./index.html"
- })
+ }),
+ new webpack.DefinePlugin(env),
+ new webpack.HotModuleReplacementPlugin(),
]
};
diff --git a/dist/index.html b/dist/index.html
index 2e7f93a6..0d854030 100644
--- a/dist/index.html
+++ b/dist/index.html
@@ -1 +1 @@
-
Multisig Safe
\ No newline at end of file
+ Multisig Safe
\ No newline at end of file
diff --git a/dist/main.js b/dist/main.js
index 44d29505..db92e108 100644
--- a/dist/main.js
+++ b/dist/main.js
@@ -1,4 +1,691 @@
/******/ (function(modules) { // webpackBootstrap
+/******/ function hotDisposeChunk(chunkId) {
+/******/ delete installedChunks[chunkId];
+/******/ }
+/******/ var parentHotUpdateCallback = window["webpackHotUpdate"];
+/******/ window["webpackHotUpdate"] = // eslint-disable-next-line no-unused-vars
+/******/ function webpackHotUpdateCallback(chunkId, moreModules) {
+/******/ hotAddUpdateChunk(chunkId, moreModules);
+/******/ if (parentHotUpdateCallback) parentHotUpdateCallback(chunkId, moreModules);
+/******/ } ;
+/******/
+/******/ // eslint-disable-next-line no-unused-vars
+/******/ function hotDownloadUpdateChunk(chunkId) {
+/******/ var head = document.getElementsByTagName("head")[0];
+/******/ var script = document.createElement("script");
+/******/ script.charset = "utf-8";
+/******/ script.src = __webpack_require__.p + "" + chunkId + "." + hotCurrentHash + ".hot-update.js";
+/******/ ;
+/******/ head.appendChild(script);
+/******/ }
+/******/
+/******/ // eslint-disable-next-line no-unused-vars
+/******/ function hotDownloadManifest(requestTimeout) {
+/******/ requestTimeout = requestTimeout || 10000;
+/******/ return new Promise(function(resolve, reject) {
+/******/ if (typeof XMLHttpRequest === "undefined")
+/******/ return reject(new Error("No browser support"));
+/******/ try {
+/******/ var request = new XMLHttpRequest();
+/******/ var requestPath = __webpack_require__.p + "" + hotCurrentHash + ".hot-update.json";
+/******/ request.open("GET", requestPath, true);
+/******/ request.timeout = requestTimeout;
+/******/ request.send(null);
+/******/ } catch (err) {
+/******/ return reject(err);
+/******/ }
+/******/ request.onreadystatechange = function() {
+/******/ if (request.readyState !== 4) return;
+/******/ if (request.status === 0) {
+/******/ // timeout
+/******/ reject(
+/******/ new Error("Manifest request to " + requestPath + " timed out.")
+/******/ );
+/******/ } else if (request.status === 404) {
+/******/ // no update available
+/******/ resolve();
+/******/ } else if (request.status !== 200 && request.status !== 304) {
+/******/ // other failure
+/******/ reject(new Error("Manifest request to " + requestPath + " failed."));
+/******/ } else {
+/******/ // success
+/******/ try {
+/******/ var update = JSON.parse(request.responseText);
+/******/ } catch (e) {
+/******/ reject(e);
+/******/ return;
+/******/ }
+/******/ resolve(update);
+/******/ }
+/******/ };
+/******/ });
+/******/ }
+/******/
+/******/ var hotApplyOnUpdate = true;
+/******/ var hotCurrentHash = "2d4e0a0c1e355481b1c5"; // eslint-disable-line no-unused-vars
+/******/ var hotRequestTimeout = 10000;
+/******/ var hotCurrentModuleData = {};
+/******/ var hotCurrentChildModule; // eslint-disable-line no-unused-vars
+/******/ var hotCurrentParents = []; // eslint-disable-line no-unused-vars
+/******/ var hotCurrentParentsTemp = []; // eslint-disable-line no-unused-vars
+/******/
+/******/ // eslint-disable-next-line no-unused-vars
+/******/ function hotCreateRequire(moduleId) {
+/******/ var me = installedModules[moduleId];
+/******/ if (!me) return __webpack_require__;
+/******/ var fn = function(request) {
+/******/ if (me.hot.active) {
+/******/ if (installedModules[request]) {
+/******/ if (!installedModules[request].parents.includes(moduleId))
+/******/ installedModules[request].parents.push(moduleId);
+/******/ } else {
+/******/ hotCurrentParents = [moduleId];
+/******/ hotCurrentChildModule = request;
+/******/ }
+/******/ if (!me.children.includes(request)) me.children.push(request);
+/******/ } else {
+/******/ console.warn(
+/******/ "[HMR] unexpected require(" +
+/******/ request +
+/******/ ") from disposed module " +
+/******/ moduleId
+/******/ );
+/******/ hotCurrentParents = [];
+/******/ }
+/******/ return __webpack_require__(request);
+/******/ };
+/******/ var ObjectFactory = function ObjectFactory(name) {
+/******/ return {
+/******/ configurable: true,
+/******/ enumerable: true,
+/******/ get: function() {
+/******/ return __webpack_require__[name];
+/******/ },
+/******/ set: function(value) {
+/******/ __webpack_require__[name] = value;
+/******/ }
+/******/ };
+/******/ };
+/******/ for (var name in __webpack_require__) {
+/******/ if (
+/******/ Object.prototype.hasOwnProperty.call(__webpack_require__, name) &&
+/******/ name !== "e"
+/******/ ) {
+/******/ Object.defineProperty(fn, name, ObjectFactory(name));
+/******/ }
+/******/ }
+/******/ fn.e = function(chunkId) {
+/******/ if (hotStatus === "ready") hotSetStatus("prepare");
+/******/ hotChunksLoading++;
+/******/ return __webpack_require__.e(chunkId).then(finishChunkLoading, function(err) {
+/******/ finishChunkLoading();
+/******/ throw err;
+/******/ });
+/******/
+/******/ function finishChunkLoading() {
+/******/ hotChunksLoading--;
+/******/ if (hotStatus === "prepare") {
+/******/ if (!hotWaitingFilesMap[chunkId]) {
+/******/ hotEnsureUpdateChunk(chunkId);
+/******/ }
+/******/ if (hotChunksLoading === 0 && hotWaitingFiles === 0) {
+/******/ hotUpdateDownloaded();
+/******/ }
+/******/ }
+/******/ }
+/******/ };
+/******/ return fn;
+/******/ }
+/******/
+/******/ // eslint-disable-next-line no-unused-vars
+/******/ function hotCreateModule(moduleId) {
+/******/ var hot = {
+/******/ // private stuff
+/******/ _acceptedDependencies: {},
+/******/ _declinedDependencies: {},
+/******/ _selfAccepted: false,
+/******/ _selfDeclined: false,
+/******/ _disposeHandlers: [],
+/******/ _main: hotCurrentChildModule !== moduleId,
+/******/
+/******/ // Module API
+/******/ active: true,
+/******/ accept: function(dep, callback) {
+/******/ if (typeof dep === "undefined") hot._selfAccepted = true;
+/******/ else if (typeof dep === "function") hot._selfAccepted = dep;
+/******/ else if (typeof dep === "object")
+/******/ for (var i = 0; i < dep.length; i++)
+/******/ hot._acceptedDependencies[dep[i]] = callback || function() {};
+/******/ else hot._acceptedDependencies[dep] = callback || function() {};
+/******/ },
+/******/ decline: function(dep) {
+/******/ if (typeof dep === "undefined") hot._selfDeclined = true;
+/******/ else if (typeof dep === "object")
+/******/ for (var i = 0; i < dep.length; i++)
+/******/ hot._declinedDependencies[dep[i]] = true;
+/******/ else hot._declinedDependencies[dep] = true;
+/******/ },
+/******/ dispose: function(callback) {
+/******/ hot._disposeHandlers.push(callback);
+/******/ },
+/******/ addDisposeHandler: function(callback) {
+/******/ hot._disposeHandlers.push(callback);
+/******/ },
+/******/ removeDisposeHandler: function(callback) {
+/******/ var idx = hot._disposeHandlers.indexOf(callback);
+/******/ if (idx >= 0) hot._disposeHandlers.splice(idx, 1);
+/******/ },
+/******/
+/******/ // Management API
+/******/ check: hotCheck,
+/******/ apply: hotApply,
+/******/ status: function(l) {
+/******/ if (!l) return hotStatus;
+/******/ hotStatusHandlers.push(l);
+/******/ },
+/******/ addStatusHandler: function(l) {
+/******/ hotStatusHandlers.push(l);
+/******/ },
+/******/ removeStatusHandler: function(l) {
+/******/ var idx = hotStatusHandlers.indexOf(l);
+/******/ if (idx >= 0) hotStatusHandlers.splice(idx, 1);
+/******/ },
+/******/
+/******/ //inherit from previous dispose call
+/******/ data: hotCurrentModuleData[moduleId]
+/******/ };
+/******/ hotCurrentChildModule = undefined;
+/******/ return hot;
+/******/ }
+/******/
+/******/ var hotStatusHandlers = [];
+/******/ var hotStatus = "idle";
+/******/
+/******/ function hotSetStatus(newStatus) {
+/******/ hotStatus = newStatus;
+/******/ for (var i = 0; i < hotStatusHandlers.length; i++)
+/******/ hotStatusHandlers[i].call(null, newStatus);
+/******/ }
+/******/
+/******/ // while downloading
+/******/ var hotWaitingFiles = 0;
+/******/ var hotChunksLoading = 0;
+/******/ var hotWaitingFilesMap = {};
+/******/ var hotRequestedFilesMap = {};
+/******/ var hotAvailableFilesMap = {};
+/******/ var hotDeferred;
+/******/
+/******/ // The update info
+/******/ var hotUpdate, hotUpdateNewHash;
+/******/
+/******/ function toModuleId(id) {
+/******/ var isNumber = +id + "" === id;
+/******/ return isNumber ? +id : id;
+/******/ }
+/******/
+/******/ function hotCheck(apply) {
+/******/ if (hotStatus !== "idle")
+/******/ throw new Error("check() is only allowed in idle status");
+/******/ hotApplyOnUpdate = apply;
+/******/ hotSetStatus("check");
+/******/ return hotDownloadManifest(hotRequestTimeout).then(function(update) {
+/******/ if (!update) {
+/******/ hotSetStatus("idle");
+/******/ return null;
+/******/ }
+/******/ hotRequestedFilesMap = {};
+/******/ hotWaitingFilesMap = {};
+/******/ hotAvailableFilesMap = update.c;
+/******/ hotUpdateNewHash = update.h;
+/******/
+/******/ hotSetStatus("prepare");
+/******/ var promise = new Promise(function(resolve, reject) {
+/******/ hotDeferred = {
+/******/ resolve: resolve,
+/******/ reject: reject
+/******/ };
+/******/ });
+/******/ hotUpdate = {};
+/******/ var chunkId = "main";
+/******/ {
+/******/ // eslint-disable-line no-lone-blocks
+/******/ /*globals chunkId */
+/******/ hotEnsureUpdateChunk(chunkId);
+/******/ }
+/******/ if (
+/******/ hotStatus === "prepare" &&
+/******/ hotChunksLoading === 0 &&
+/******/ hotWaitingFiles === 0
+/******/ ) {
+/******/ hotUpdateDownloaded();
+/******/ }
+/******/ return promise;
+/******/ });
+/******/ }
+/******/
+/******/ // eslint-disable-next-line no-unused-vars
+/******/ function hotAddUpdateChunk(chunkId, moreModules) {
+/******/ if (!hotAvailableFilesMap[chunkId] || !hotRequestedFilesMap[chunkId])
+/******/ return;
+/******/ hotRequestedFilesMap[chunkId] = false;
+/******/ for (var moduleId in moreModules) {
+/******/ if (Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
+/******/ hotUpdate[moduleId] = moreModules[moduleId];
+/******/ }
+/******/ }
+/******/ if (--hotWaitingFiles === 0 && hotChunksLoading === 0) {
+/******/ hotUpdateDownloaded();
+/******/ }
+/******/ }
+/******/
+/******/ function hotEnsureUpdateChunk(chunkId) {
+/******/ if (!hotAvailableFilesMap[chunkId]) {
+/******/ hotWaitingFilesMap[chunkId] = true;
+/******/ } else {
+/******/ hotRequestedFilesMap[chunkId] = true;
+/******/ hotWaitingFiles++;
+/******/ hotDownloadUpdateChunk(chunkId);
+/******/ }
+/******/ }
+/******/
+/******/ function hotUpdateDownloaded() {
+/******/ hotSetStatus("ready");
+/******/ var deferred = hotDeferred;
+/******/ hotDeferred = null;
+/******/ if (!deferred) return;
+/******/ if (hotApplyOnUpdate) {
+/******/ // Wrap deferred object in Promise to mark it as a well-handled Promise to
+/******/ // avoid triggering uncaught exception warning in Chrome.
+/******/ // See https://bugs.chromium.org/p/chromium/issues/detail?id=465666
+/******/ Promise.resolve()
+/******/ .then(function() {
+/******/ return hotApply(hotApplyOnUpdate);
+/******/ })
+/******/ .then(
+/******/ function(result) {
+/******/ deferred.resolve(result);
+/******/ },
+/******/ function(err) {
+/******/ deferred.reject(err);
+/******/ }
+/******/ );
+/******/ } else {
+/******/ var outdatedModules = [];
+/******/ for (var id in hotUpdate) {
+/******/ if (Object.prototype.hasOwnProperty.call(hotUpdate, id)) {
+/******/ outdatedModules.push(toModuleId(id));
+/******/ }
+/******/ }
+/******/ deferred.resolve(outdatedModules);
+/******/ }
+/******/ }
+/******/
+/******/ function hotApply(options) {
+/******/ if (hotStatus !== "ready")
+/******/ throw new Error("apply() is only allowed in ready status");
+/******/ options = options || {};
+/******/
+/******/ var cb;
+/******/ var i;
+/******/ var j;
+/******/ var module;
+/******/ var moduleId;
+/******/
+/******/ function getAffectedStuff(updateModuleId) {
+/******/ var outdatedModules = [updateModuleId];
+/******/ var outdatedDependencies = {};
+/******/
+/******/ var queue = outdatedModules.slice().map(function(id) {
+/******/ return {
+/******/ chain: [id],
+/******/ id: id
+/******/ };
+/******/ });
+/******/ while (queue.length > 0) {
+/******/ var queueItem = queue.pop();
+/******/ var moduleId = queueItem.id;
+/******/ var chain = queueItem.chain;
+/******/ module = installedModules[moduleId];
+/******/ if (!module || module.hot._selfAccepted) continue;
+/******/ if (module.hot._selfDeclined) {
+/******/ return {
+/******/ type: "self-declined",
+/******/ chain: chain,
+/******/ moduleId: moduleId
+/******/ };
+/******/ }
+/******/ if (module.hot._main) {
+/******/ return {
+/******/ type: "unaccepted",
+/******/ chain: chain,
+/******/ moduleId: moduleId
+/******/ };
+/******/ }
+/******/ for (var i = 0; i < module.parents.length; i++) {
+/******/ var parentId = module.parents[i];
+/******/ var parent = installedModules[parentId];
+/******/ if (!parent) continue;
+/******/ if (parent.hot._declinedDependencies[moduleId]) {
+/******/ return {
+/******/ type: "declined",
+/******/ chain: chain.concat([parentId]),
+/******/ moduleId: moduleId,
+/******/ parentId: parentId
+/******/ };
+/******/ }
+/******/ if (outdatedModules.includes(parentId)) continue;
+/******/ if (parent.hot._acceptedDependencies[moduleId]) {
+/******/ if (!outdatedDependencies[parentId])
+/******/ outdatedDependencies[parentId] = [];
+/******/ addAllToSet(outdatedDependencies[parentId], [moduleId]);
+/******/ continue;
+/******/ }
+/******/ delete outdatedDependencies[parentId];
+/******/ outdatedModules.push(parentId);
+/******/ queue.push({
+/******/ chain: chain.concat([parentId]),
+/******/ id: parentId
+/******/ });
+/******/ }
+/******/ }
+/******/
+/******/ return {
+/******/ type: "accepted",
+/******/ moduleId: updateModuleId,
+/******/ outdatedModules: outdatedModules,
+/******/ outdatedDependencies: outdatedDependencies
+/******/ };
+/******/ }
+/******/
+/******/ function addAllToSet(a, b) {
+/******/ for (var i = 0; i < b.length; i++) {
+/******/ var item = b[i];
+/******/ if (!a.includes(item)) a.push(item);
+/******/ }
+/******/ }
+/******/
+/******/ // at begin all updates modules are outdated
+/******/ // the "outdated" status can propagate to parents if they don't accept the children
+/******/ var outdatedDependencies = {};
+/******/ var outdatedModules = [];
+/******/ var appliedUpdate = {};
+/******/
+/******/ var warnUnexpectedRequire = function warnUnexpectedRequire() {
+/******/ console.warn(
+/******/ "[HMR] unexpected require(" + result.moduleId + ") to disposed module"
+/******/ );
+/******/ };
+/******/
+/******/ for (var id in hotUpdate) {
+/******/ if (Object.prototype.hasOwnProperty.call(hotUpdate, id)) {
+/******/ moduleId = toModuleId(id);
+/******/ var result;
+/******/ if (hotUpdate[id]) {
+/******/ result = getAffectedStuff(moduleId);
+/******/ } else {
+/******/ result = {
+/******/ type: "disposed",
+/******/ moduleId: id
+/******/ };
+/******/ }
+/******/ var abortError = false;
+/******/ var doApply = false;
+/******/ var doDispose = false;
+/******/ var chainInfo = "";
+/******/ if (result.chain) {
+/******/ chainInfo = "\nUpdate propagation: " + result.chain.join(" -> ");
+/******/ }
+/******/ switch (result.type) {
+/******/ case "self-declined":
+/******/ if (options.onDeclined) options.onDeclined(result);
+/******/ if (!options.ignoreDeclined)
+/******/ abortError = new Error(
+/******/ "Aborted because of self decline: " +
+/******/ result.moduleId +
+/******/ chainInfo
+/******/ );
+/******/ break;
+/******/ case "declined":
+/******/ if (options.onDeclined) options.onDeclined(result);
+/******/ if (!options.ignoreDeclined)
+/******/ abortError = new Error(
+/******/ "Aborted because of declined dependency: " +
+/******/ result.moduleId +
+/******/ " in " +
+/******/ result.parentId +
+/******/ chainInfo
+/******/ );
+/******/ break;
+/******/ case "unaccepted":
+/******/ if (options.onUnaccepted) options.onUnaccepted(result);
+/******/ if (!options.ignoreUnaccepted)
+/******/ abortError = new Error(
+/******/ "Aborted because " + moduleId + " is not accepted" + chainInfo
+/******/ );
+/******/ break;
+/******/ case "accepted":
+/******/ if (options.onAccepted) options.onAccepted(result);
+/******/ doApply = true;
+/******/ break;
+/******/ case "disposed":
+/******/ if (options.onDisposed) options.onDisposed(result);
+/******/ doDispose = true;
+/******/ break;
+/******/ default:
+/******/ throw new Error("Unexception type " + result.type);
+/******/ }
+/******/ if (abortError) {
+/******/ hotSetStatus("abort");
+/******/ return Promise.reject(abortError);
+/******/ }
+/******/ if (doApply) {
+/******/ appliedUpdate[moduleId] = hotUpdate[moduleId];
+/******/ addAllToSet(outdatedModules, result.outdatedModules);
+/******/ for (moduleId in result.outdatedDependencies) {
+/******/ if (
+/******/ Object.prototype.hasOwnProperty.call(
+/******/ result.outdatedDependencies,
+/******/ moduleId
+/******/ )
+/******/ ) {
+/******/ if (!outdatedDependencies[moduleId])
+/******/ outdatedDependencies[moduleId] = [];
+/******/ addAllToSet(
+/******/ outdatedDependencies[moduleId],
+/******/ result.outdatedDependencies[moduleId]
+/******/ );
+/******/ }
+/******/ }
+/******/ }
+/******/ if (doDispose) {
+/******/ addAllToSet(outdatedModules, [result.moduleId]);
+/******/ appliedUpdate[moduleId] = warnUnexpectedRequire;
+/******/ }
+/******/ }
+/******/ }
+/******/
+/******/ // Store self accepted outdated modules to require them later by the module system
+/******/ var outdatedSelfAcceptedModules = [];
+/******/ for (i = 0; i < outdatedModules.length; i++) {
+/******/ moduleId = outdatedModules[i];
+/******/ if (
+/******/ installedModules[moduleId] &&
+/******/ installedModules[moduleId].hot._selfAccepted
+/******/ )
+/******/ outdatedSelfAcceptedModules.push({
+/******/ module: moduleId,
+/******/ errorHandler: installedModules[moduleId].hot._selfAccepted
+/******/ });
+/******/ }
+/******/
+/******/ // Now in "dispose" phase
+/******/ hotSetStatus("dispose");
+/******/ Object.keys(hotAvailableFilesMap).forEach(function(chunkId) {
+/******/ if (hotAvailableFilesMap[chunkId] === false) {
+/******/ hotDisposeChunk(chunkId);
+/******/ }
+/******/ });
+/******/
+/******/ var idx;
+/******/ var queue = outdatedModules.slice();
+/******/ while (queue.length > 0) {
+/******/ moduleId = queue.pop();
+/******/ module = installedModules[moduleId];
+/******/ if (!module) continue;
+/******/
+/******/ var data = {};
+/******/
+/******/ // Call dispose handlers
+/******/ var disposeHandlers = module.hot._disposeHandlers;
+/******/ for (j = 0; j < disposeHandlers.length; j++) {
+/******/ cb = disposeHandlers[j];
+/******/ cb(data);
+/******/ }
+/******/ hotCurrentModuleData[moduleId] = data;
+/******/
+/******/ // disable module (this disables requires from this module)
+/******/ module.hot.active = false;
+/******/
+/******/ // remove module from cache
+/******/ delete installedModules[moduleId];
+/******/
+/******/ // when disposing there is no need to call dispose handler
+/******/ delete outdatedDependencies[moduleId];
+/******/
+/******/ // remove "parents" references from all children
+/******/ for (j = 0; j < module.children.length; j++) {
+/******/ var child = installedModules[module.children[j]];
+/******/ if (!child) continue;
+/******/ idx = child.parents.indexOf(moduleId);
+/******/ if (idx >= 0) {
+/******/ child.parents.splice(idx, 1);
+/******/ }
+/******/ }
+/******/ }
+/******/
+/******/ // remove outdated dependency from module children
+/******/ var dependency;
+/******/ var moduleOutdatedDependencies;
+/******/ for (moduleId in outdatedDependencies) {
+/******/ if (
+/******/ Object.prototype.hasOwnProperty.call(outdatedDependencies, moduleId)
+/******/ ) {
+/******/ module = installedModules[moduleId];
+/******/ if (module) {
+/******/ moduleOutdatedDependencies = outdatedDependencies[moduleId];
+/******/ for (j = 0; j < moduleOutdatedDependencies.length; j++) {
+/******/ dependency = moduleOutdatedDependencies[j];
+/******/ idx = module.children.indexOf(dependency);
+/******/ if (idx >= 0) module.children.splice(idx, 1);
+/******/ }
+/******/ }
+/******/ }
+/******/ }
+/******/
+/******/ // Not in "apply" phase
+/******/ hotSetStatus("apply");
+/******/
+/******/ hotCurrentHash = hotUpdateNewHash;
+/******/
+/******/ // insert new code
+/******/ for (moduleId in appliedUpdate) {
+/******/ if (Object.prototype.hasOwnProperty.call(appliedUpdate, moduleId)) {
+/******/ modules[moduleId] = appliedUpdate[moduleId];
+/******/ }
+/******/ }
+/******/
+/******/ // call accept handlers
+/******/ var error = null;
+/******/ for (moduleId in outdatedDependencies) {
+/******/ if (
+/******/ Object.prototype.hasOwnProperty.call(outdatedDependencies, moduleId)
+/******/ ) {
+/******/ module = installedModules[moduleId];
+/******/ if (module) {
+/******/ moduleOutdatedDependencies = outdatedDependencies[moduleId];
+/******/ var callbacks = [];
+/******/ for (i = 0; i < moduleOutdatedDependencies.length; i++) {
+/******/ dependency = moduleOutdatedDependencies[i];
+/******/ cb = module.hot._acceptedDependencies[dependency];
+/******/ if (cb) {
+/******/ if (callbacks.includes(cb)) continue;
+/******/ callbacks.push(cb);
+/******/ }
+/******/ }
+/******/ for (i = 0; i < callbacks.length; i++) {
+/******/ cb = callbacks[i];
+/******/ try {
+/******/ cb(moduleOutdatedDependencies);
+/******/ } catch (err) {
+/******/ if (options.onErrored) {
+/******/ options.onErrored({
+/******/ type: "accept-errored",
+/******/ moduleId: moduleId,
+/******/ dependencyId: moduleOutdatedDependencies[i],
+/******/ error: err
+/******/ });
+/******/ }
+/******/ if (!options.ignoreErrored) {
+/******/ if (!error) error = err;
+/******/ }
+/******/ }
+/******/ }
+/******/ }
+/******/ }
+/******/ }
+/******/
+/******/ // Load self accepted modules
+/******/ for (i = 0; i < outdatedSelfAcceptedModules.length; i++) {
+/******/ var item = outdatedSelfAcceptedModules[i];
+/******/ moduleId = item.module;
+/******/ hotCurrentParents = [moduleId];
+/******/ try {
+/******/ __webpack_require__(moduleId);
+/******/ } catch (err) {
+/******/ if (typeof item.errorHandler === "function") {
+/******/ try {
+/******/ item.errorHandler(err);
+/******/ } catch (err2) {
+/******/ if (options.onErrored) {
+/******/ options.onErrored({
+/******/ type: "self-accept-error-handler-errored",
+/******/ moduleId: moduleId,
+/******/ error: err2,
+/******/ originalError: err
+/******/ });
+/******/ }
+/******/ if (!options.ignoreErrored) {
+/******/ if (!error) error = err2;
+/******/ }
+/******/ if (!error) error = err;
+/******/ }
+/******/ } else {
+/******/ if (options.onErrored) {
+/******/ options.onErrored({
+/******/ type: "self-accept-errored",
+/******/ moduleId: moduleId,
+/******/ error: err
+/******/ });
+/******/ }
+/******/ if (!options.ignoreErrored) {
+/******/ if (!error) error = err;
+/******/ }
+/******/ }
+/******/ }
+/******/ }
+/******/
+/******/ // handle errors in accept handlers and self accepted module load
+/******/ if (error) {
+/******/ hotSetStatus("fail");
+/******/ return Promise.reject(error);
+/******/ }
+/******/
+/******/ hotSetStatus("idle");
+/******/ return new Promise(function(resolve) {
+/******/ resolve(outdatedModules);
+/******/ });
+/******/ }
+/******/
/******/ // The module cache
/******/ var installedModules = {};
/******/
@@ -13,11 +700,14 @@
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
-/******/ exports: {}
+/******/ exports: {},
+/******/ hot: hotCreateModule(moduleId),
+/******/ parents: (hotCurrentParentsTemp = hotCurrentParents, hotCurrentParents = [], hotCurrentParentsTemp),
+/******/ children: []
/******/ };
/******/
/******/ // Execute the module function
-/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+/******/ modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
@@ -64,9 +754,12 @@
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
+/******/ // __webpack_hash__
+/******/ __webpack_require__.h = function() { return hotCurrentHash; };
+/******/
/******/
/******/ // Load entry module and return exports
-/******/ return __webpack_require__(__webpack_require__.s = "./src/index.js");
+/******/ return hotCreateRequire("./src/index.js")(__webpack_require__.s = "./src/index.js");
/******/ })
/************************************************************************/
/******/ ({
@@ -110860,7 +111553,7 @@ var debugs = {};
var debugEnviron;
exports.debuglog = function(set) {
if (isUndefined(debugEnviron))
- debugEnviron = process.env.NODE_DEBUG || '';
+ debugEnviron = Object({"NODE_ENV":"development","PUBLIC_URL":""}).NODE_DEBUG || '';
set = set.toUpperCase();
if (!debugs[set]) {
if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
@@ -122557,7 +123250,7 @@ var isNode = typeof process !== "undefined" &&
classString(process).toLowerCase() === "[object process]";
function env(key, def) {
- return isNode ? process.env[key] : def;
+ return isNode ? Object({"NODE_ENV":"development","PUBLIC_URL":""})[key] : def;
}
var ret = {
@@ -138961,7 +139654,7 @@ var isNode = typeof process !== "undefined" &&
classString(process).toLowerCase() === "[object process]";
function env(key, def) {
- return isNode ? process.env[key] : def;
+ return isNode ? Object({"NODE_ENV":"development","PUBLIC_URL":""})[key] : def;
}
var ret = {
@@ -158535,7 +159228,32 @@ var update = __webpack_require__(/*! ../node_modules/style-loader/lib/addStyles.
if(content.locals) module.exports = content.locals;
-if(false) {}
+if(true) {
+ module.hot.accept(/*! !../node_modules/css-loader??ref--5-1!../node_modules/postcss-loader/lib??ref--5-2!./App.scss */ "./node_modules/css-loader/index.js??ref--5-1!./node_modules/postcss-loader/lib/index.js??ref--5-2!./src/App.scss", function(__WEBPACK_OUTDATED_DEPENDENCIES__) { (function() {
+ var newContent = __webpack_require__(/*! !../node_modules/css-loader??ref--5-1!../node_modules/postcss-loader/lib??ref--5-2!./App.scss */ "./node_modules/css-loader/index.js??ref--5-1!./node_modules/postcss-loader/lib/index.js??ref--5-2!./src/App.scss");
+
+ if(typeof newContent === 'string') newContent = [[module.i, newContent, '']];
+
+ var locals = (function(a, b) {
+ var key, idx = 0;
+
+ for(key in a) {
+ if(!b || a[key] !== b[key]) return false;
+ idx++;
+ }
+
+ for(key in b) idx--;
+
+ return idx === 0;
+ }(content.locals, newContent.locals));
+
+ if(!locals) throw new Error('Aborting CSS HMR due to changed css-modules locals.');
+
+ update(newContent);
+ })(__WEBPACK_OUTDATED_DEPENDENCIES__); });
+
+ module.hot.dispose(function() { update(); });
+}
/***/ }),
@@ -158597,7 +159315,32 @@ var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addS
if(content.locals) module.exports = content.locals;
-if(false) {}
+if(true) {
+ module.hot.accept(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/lib??ref--5-2!./index.scss */ "./node_modules/css-loader/index.js??ref--5-1!./node_modules/postcss-loader/lib/index.js??ref--5-2!./src/components/Header/index.scss", function(__WEBPACK_OUTDATED_DEPENDENCIES__) { (function() {
+ var newContent = __webpack_require__(/*! !../../../node_modules/css-loader??ref--5-1!../../../node_modules/postcss-loader/lib??ref--5-2!./index.scss */ "./node_modules/css-loader/index.js??ref--5-1!./node_modules/postcss-loader/lib/index.js??ref--5-2!./src/components/Header/index.scss");
+
+ if(typeof newContent === 'string') newContent = [[module.i, newContent, '']];
+
+ var locals = (function(a, b) {
+ var key, idx = 0;
+
+ for(key in a) {
+ if(!b || a[key] !== b[key]) return false;
+ idx++;
+ }
+
+ for(key in b) idx--;
+
+ return idx === 0;
+ }(content.locals, newContent.locals));
+
+ if(!locals) throw new Error('Aborting CSS HMR due to changed css-modules locals.');
+
+ update(newContent);
+ })(__WEBPACK_OUTDATED_DEPENDENCIES__); });
+
+ module.hot.dispose(function() { update(); });
+}
/***/ }),
@@ -158712,7 +159455,32 @@ var update = __webpack_require__(/*! ../../../../node_modules/style-loader/lib/a
if(content.locals) module.exports = content.locals;
-if(false) {}
+if(true) {
+ module.hot.accept(/*! !../../../../node_modules/css-loader??ref--5-1!../../../../node_modules/postcss-loader/lib??ref--5-2!./index.scss */ "./node_modules/css-loader/index.js??ref--5-1!./node_modules/postcss-loader/lib/index.js??ref--5-2!./src/components/layout/Page/index.scss", function(__WEBPACK_OUTDATED_DEPENDENCIES__) { (function() {
+ var newContent = __webpack_require__(/*! !../../../../node_modules/css-loader??ref--5-1!../../../../node_modules/postcss-loader/lib??ref--5-2!./index.scss */ "./node_modules/css-loader/index.js??ref--5-1!./node_modules/postcss-loader/lib/index.js??ref--5-2!./src/components/layout/Page/index.scss");
+
+ if(typeof newContent === 'string') newContent = [[module.i, newContent, '']];
+
+ var locals = (function(a, b) {
+ var key, idx = 0;
+
+ for(key in a) {
+ if(!b || a[key] !== b[key]) return false;
+ idx++;
+ }
+
+ for(key in b) idx--;
+
+ return idx === 0;
+ }(content.locals, newContent.locals));
+
+ if(!locals) throw new Error('Aborting CSS HMR due to changed css-modules locals.');
+
+ update(newContent);
+ })(__WEBPACK_OUTDATED_DEPENDENCIES__); });
+
+ module.hot.dispose(function() { update(); });
+}
/***/ }),
@@ -158775,7 +159543,32 @@ var update = __webpack_require__(/*! ../../../../node_modules/style-loader/lib/a
if(content.locals) module.exports = content.locals;
-if(false) {}
+if(true) {
+ module.hot.accept(/*! !../../../../node_modules/css-loader??ref--5-1!../../../../node_modules/postcss-loader/lib??ref--5-2!./index.scss */ "./node_modules/css-loader/index.js??ref--5-1!./node_modules/postcss-loader/lib/index.js??ref--5-2!./src/components/layout/PageFrame/index.scss", function(__WEBPACK_OUTDATED_DEPENDENCIES__) { (function() {
+ var newContent = __webpack_require__(/*! !../../../../node_modules/css-loader??ref--5-1!../../../../node_modules/postcss-loader/lib??ref--5-2!./index.scss */ "./node_modules/css-loader/index.js??ref--5-1!./node_modules/postcss-loader/lib/index.js??ref--5-2!./src/components/layout/PageFrame/index.scss");
+
+ if(typeof newContent === 'string') newContent = [[module.i, newContent, '']];
+
+ var locals = (function(a, b) {
+ var key, idx = 0;
+
+ for(key in a) {
+ if(!b || a[key] !== b[key]) return false;
+ idx++;
+ }
+
+ for(key in b) idx--;
+
+ return idx === 0;
+ }(content.locals, newContent.locals));
+
+ if(!locals) throw new Error('Aborting CSS HMR due to changed css-modules locals.');
+
+ update(newContent);
+ })(__WEBPACK_OUTDATED_DEPENDENCIES__); });
+
+ module.hot.dispose(function() { update(); });
+}
/***/ }),
diff --git a/dist/main.js.map b/dist/main.js.map
index fa1db5d0..5f7c576d 100644
--- a/dist/main.js.map
+++ b/dist/main.js.map
@@ -1 +1 @@
-{"version":3,"file":"main.js","sources":["webpack:///webpack/bootstrap","webpack:///./node_modules/asn1.js/lib/asn1.js","webpack:///./node_modules/asn1.js/lib/asn1/api.js","webpack:///./node_modules/asn1.js/lib/asn1/base/buffer.js","webpack:///./node_modules/asn1.js/lib/asn1/base/index.js","webpack:///./node_modules/asn1.js/lib/asn1/base/node.js","webpack:///./node_modules/asn1.js/lib/asn1/base/reporter.js","webpack:///./node_modules/asn1.js/lib/asn1/constants/der.js","webpack:///./node_modules/asn1.js/lib/asn1/constants/index.js","webpack:///./node_modules/asn1.js/lib/asn1/decoders/der.js","webpack:///./node_modules/asn1.js/lib/asn1/decoders/index.js","webpack:///./node_modules/asn1.js/lib/asn1/decoders/pem.js","webpack:///./node_modules/asn1.js/lib/asn1/encoders/der.js","webpack:///./node_modules/asn1.js/lib/asn1/encoders/index.js","webpack:///./node_modules/asn1.js/lib/asn1/encoders/pem.js","webpack:///./node_modules/babel-runtime/core-js/array/from.js","webpack:///./node_modules/babel-runtime/core-js/map.js","webpack:///./node_modules/babel-runtime/core-js/number/is-nan.js","webpack:///./node_modules/babel-runtime/core-js/number/min-safe-integer.js","webpack:///./node_modules/babel-runtime/core-js/object/assign.js","webpack:///./node_modules/babel-runtime/core-js/object/create.js","webpack:///./node_modules/babel-runtime/core-js/object/define-property.js","webpack:///./node_modules/babel-runtime/core-js/object/get-prototype-of.js","webpack:///./node_modules/babel-runtime/core-js/object/keys.js","webpack:///./node_modules/babel-runtime/core-js/object/set-prototype-of.js","webpack:///./node_modules/babel-runtime/core-js/symbol.js","webpack:///./node_modules/babel-runtime/core-js/symbol/iterator.js","webpack:///./node_modules/babel-runtime/helpers/classCallCheck.js","webpack:///./node_modules/babel-runtime/helpers/createClass.js","webpack:///./node_modules/babel-runtime/helpers/defineProperty.js","webpack:///./node_modules/babel-runtime/helpers/extends.js","webpack:///./node_modules/babel-runtime/helpers/inherits.js","webpack:///./node_modules/babel-runtime/helpers/objectWithoutProperties.js","webpack:///./node_modules/babel-runtime/helpers/possibleConstructorReturn.js","webpack:///./node_modules/babel-runtime/helpers/toConsumableArray.js","webpack:///./node_modules/babel-runtime/helpers/typeof.js","webpack:///./node_modules/base64-js/index.js","webpack:///./node_modules/bignumber.js/bignumber.js","webpack:///./node_modules/bn.js/lib/bn.js","webpack:///./node_modules/brcast/dist/brcast.es.js","webpack:///./node_modules/brorand/index.js","webpack:///./node_modules/browserify-aes/aes.js","webpack:///./node_modules/browserify-aes/authCipher.js","webpack:///./node_modules/browserify-aes/browser.js","webpack:///./node_modules/browserify-aes/decrypter.js","webpack:///./node_modules/browserify-aes/encrypter.js","webpack:///./node_modules/browserify-aes/ghash.js","webpack:///./node_modules/browserify-aes/incr32.js","webpack:///./node_modules/browserify-aes/modes/cbc.js","webpack:///./node_modules/browserify-aes/modes/cfb.js","webpack:///./node_modules/browserify-aes/modes/cfb1.js","webpack:///./node_modules/browserify-aes/modes/cfb8.js","webpack:///./node_modules/browserify-aes/modes/ctr.js","webpack:///./node_modules/browserify-aes/modes/ecb.js","webpack:///./node_modules/browserify-aes/modes/index.js","webpack:///./node_modules/browserify-aes/modes/ofb.js","webpack:///./node_modules/browserify-aes/streamCipher.js","webpack:///./node_modules/browserify-cipher/browser.js","webpack:///./node_modules/browserify-des/index.js","webpack:///./node_modules/browserify-des/modes.js","webpack:///./node_modules/browserify-rsa/index.js","webpack:///./node_modules/browserify-sign/algos.js","webpack:///./node_modules/browserify-sign/browser/index.js","webpack:///./node_modules/browserify-sign/browser/sign.js","webpack:///./node_modules/browserify-sign/browser/verify.js","webpack:///./node_modules/buffer-xor/index.js","webpack:///./node_modules/buffer/index.js","webpack:///./node_modules/buffer/node_modules/isarray/index.js","webpack:///./node_modules/cipher-base/index.js","webpack:///./node_modules/classnames/index.js","webpack:///./node_modules/co/index.js","webpack:///./node_modules/core-js/library/fn/array/from.js","webpack:///./node_modules/core-js/library/fn/map.js","webpack:///./node_modules/core-js/library/fn/number/is-nan.js","webpack:///./node_modules/core-js/library/fn/number/min-safe-integer.js","webpack:///./node_modules/core-js/library/fn/object/assign.js","webpack:///./node_modules/core-js/library/fn/object/create.js","webpack:///./node_modules/core-js/library/fn/object/define-property.js","webpack:///./node_modules/core-js/library/fn/object/get-prototype-of.js","webpack:///./node_modules/core-js/library/fn/object/keys.js","webpack:///./node_modules/core-js/library/fn/object/set-prototype-of.js","webpack:///./node_modules/core-js/library/fn/symbol/index.js","webpack:///./node_modules/core-js/library/fn/symbol/iterator.js","webpack:///./node_modules/core-js/library/modules/_a-function.js","webpack:///./node_modules/core-js/library/modules/_add-to-unscopables.js","webpack:///./node_modules/core-js/library/modules/_an-instance.js","webpack:///./node_modules/core-js/library/modules/_an-object.js","webpack:///./node_modules/core-js/library/modules/_array-from-iterable.js","webpack:///./node_modules/core-js/library/modules/_array-includes.js","webpack:///./node_modules/core-js/library/modules/_array-methods.js","webpack:///./node_modules/core-js/library/modules/_array-species-constructor.js","webpack:///./node_modules/core-js/library/modules/_array-species-create.js","webpack:///./node_modules/core-js/library/modules/_classof.js","webpack:///./node_modules/core-js/library/modules/_cof.js","webpack:///./node_modules/core-js/library/modules/_collection-strong.js","webpack:///./node_modules/core-js/library/modules/_collection-to-json.js","webpack:///./node_modules/core-js/library/modules/_collection.js","webpack:///./node_modules/core-js/library/modules/_core.js","webpack:///./node_modules/core-js/library/modules/_create-property.js","webpack:///./node_modules/core-js/library/modules/_ctx.js","webpack:///./node_modules/core-js/library/modules/_defined.js","webpack:///./node_modules/core-js/library/modules/_descriptors.js","webpack:///./node_modules/core-js/library/modules/_dom-create.js","webpack:///./node_modules/core-js/library/modules/_enum-bug-keys.js","webpack:///./node_modules/core-js/library/modules/_enum-keys.js","webpack:///./node_modules/core-js/library/modules/_export.js","webpack:///./node_modules/core-js/library/modules/_fails.js","webpack:///./node_modules/core-js/library/modules/_for-of.js","webpack:///./node_modules/core-js/library/modules/_global.js","webpack:///./node_modules/core-js/library/modules/_has.js","webpack:///./node_modules/core-js/library/modules/_hide.js","webpack:///./node_modules/core-js/library/modules/_html.js","webpack:///./node_modules/core-js/library/modules/_ie8-dom-define.js","webpack:///./node_modules/core-js/library/modules/_iobject.js","webpack:///./node_modules/core-js/library/modules/_is-array-iter.js","webpack:///./node_modules/core-js/library/modules/_is-array.js","webpack:///./node_modules/core-js/library/modules/_is-object.js","webpack:///./node_modules/core-js/library/modules/_iter-call.js","webpack:///./node_modules/core-js/library/modules/_iter-create.js","webpack:///./node_modules/core-js/library/modules/_iter-define.js","webpack:///./node_modules/core-js/library/modules/_iter-detect.js","webpack:///./node_modules/core-js/library/modules/_iter-step.js","webpack:///./node_modules/core-js/library/modules/_iterators.js","webpack:///./node_modules/core-js/library/modules/_library.js","webpack:///./node_modules/core-js/library/modules/_meta.js","webpack:///./node_modules/core-js/library/modules/_object-assign.js","webpack:///./node_modules/core-js/library/modules/_object-create.js","webpack:///./node_modules/core-js/library/modules/_object-dp.js","webpack:///./node_modules/core-js/library/modules/_object-dps.js","webpack:///./node_modules/core-js/library/modules/_object-gopd.js","webpack:///./node_modules/core-js/library/modules/_object-gopn-ext.js","webpack:///./node_modules/core-js/library/modules/_object-gopn.js","webpack:///./node_modules/core-js/library/modules/_object-gops.js","webpack:///./node_modules/core-js/library/modules/_object-gpo.js","webpack:///./node_modules/core-js/library/modules/_object-keys-internal.js","webpack:///./node_modules/core-js/library/modules/_object-keys.js","webpack:///./node_modules/core-js/library/modules/_object-pie.js","webpack:///./node_modules/core-js/library/modules/_object-sap.js","webpack:///./node_modules/core-js/library/modules/_property-desc.js","webpack:///./node_modules/core-js/library/modules/_redefine-all.js","webpack:///./node_modules/core-js/library/modules/_redefine.js","webpack:///./node_modules/core-js/library/modules/_set-collection-from.js","webpack:///./node_modules/core-js/library/modules/_set-collection-of.js","webpack:///./node_modules/core-js/library/modules/_set-proto.js","webpack:///./node_modules/core-js/library/modules/_set-species.js","webpack:///./node_modules/core-js/library/modules/_set-to-string-tag.js","webpack:///./node_modules/core-js/library/modules/_shared-key.js","webpack:///./node_modules/core-js/library/modules/_shared.js","webpack:///./node_modules/core-js/library/modules/_string-at.js","webpack:///./node_modules/core-js/library/modules/_to-absolute-index.js","webpack:///./node_modules/core-js/library/modules/_to-integer.js","webpack:///./node_modules/core-js/library/modules/_to-iobject.js","webpack:///./node_modules/core-js/library/modules/_to-length.js","webpack:///./node_modules/core-js/library/modules/_to-object.js","webpack:///./node_modules/core-js/library/modules/_to-primitive.js","webpack:///./node_modules/core-js/library/modules/_uid.js","webpack:///./node_modules/core-js/library/modules/_validate-collection.js","webpack:///./node_modules/core-js/library/modules/_wks-define.js","webpack:///./node_modules/core-js/library/modules/_wks-ext.js","webpack:///./node_modules/core-js/library/modules/_wks.js","webpack:///./node_modules/core-js/library/modules/core.get-iterator-method.js","webpack:///./node_modules/core-js/library/modules/es6.array.from.js","webpack:///./node_modules/core-js/library/modules/es6.array.iterator.js","webpack:///./node_modules/core-js/library/modules/es6.map.js","webpack:///./node_modules/core-js/library/modules/es6.number.is-nan.js","webpack:///./node_modules/core-js/library/modules/es6.number.min-safe-integer.js","webpack:///./node_modules/core-js/library/modules/es6.object.assign.js","webpack:///./node_modules/core-js/library/modules/es6.object.create.js","webpack:///./node_modules/core-js/library/modules/es6.object.define-property.js","webpack:///./node_modules/core-js/library/modules/es6.object.get-prototype-of.js","webpack:///./node_modules/core-js/library/modules/es6.object.keys.js","webpack:///./node_modules/core-js/library/modules/es6.object.set-prototype-of.js","webpack:///./node_modules/core-js/library/modules/es6.string.iterator.js","webpack:///./node_modules/core-js/library/modules/es6.symbol.js","webpack:///./node_modules/core-js/library/modules/es7.map.from.js","webpack:///./node_modules/core-js/library/modules/es7.map.of.js","webpack:///./node_modules/core-js/library/modules/es7.map.to-json.js","webpack:///./node_modules/core-js/library/modules/es7.symbol.async-iterator.js","webpack:///./node_modules/core-js/library/modules/es7.symbol.observable.js","webpack:///./node_modules/core-js/library/modules/web.dom.iterable.js","webpack:///./node_modules/core-util-is/lib/util.js","webpack:///./node_modules/create-ecdh/browser.js","webpack:///./node_modules/create-hash/browser.js","webpack:///./node_modules/create-hash/make-hash.js","webpack:///./node_modules/create-hash/md5.js","webpack:///./node_modules/create-hmac/browser.js","webpack:///./node_modules/create-hmac/legacy.js","webpack:///./node_modules/crypto-browserify/index.js","webpack:///./node_modules/crypto-js/core.js","webpack:///./node_modules/crypto-js/sha3.js","webpack:///./node_modules/crypto-js/x64-core.js","webpack:///./src/App.scss","webpack:///./src/components/Header/index.scss","webpack:///./src/components/layout/Page/index.scss","webpack:///./src/components/layout/PageFrame/index.scss","webpack:///./node_modules/css-loader/lib/css-base.js","webpack:///./node_modules/css-vendor/lib/camelize.js","webpack:///./node_modules/css-vendor/lib/index.js","webpack:///./node_modules/css-vendor/lib/prefix.js","webpack:///./node_modules/css-vendor/lib/supported-property.js","webpack:///./node_modules/css-vendor/lib/supported-value.js","webpack:///./node_modules/decode-uri-component/index.js","webpack:///./node_modules/deepmerge/dist/es.js","webpack:///./node_modules/des.js/lib/des.js","webpack:///./node_modules/des.js/lib/des/cbc.js","webpack:///./node_modules/des.js/lib/des/cipher.js","webpack:///./node_modules/des.js/lib/des/des.js","webpack:///./node_modules/des.js/lib/des/ede.js","webpack:///./node_modules/des.js/lib/des/utils.js","webpack:///./node_modules/diffie-hellman/browser.js","webpack:///./node_modules/diffie-hellman/lib/dh.js","webpack:///./node_modules/diffie-hellman/lib/generatePrime.js","webpack:///./node_modules/dom-helpers/activeElement.js","webpack:///./node_modules/dom-helpers/ownerDocument.js","webpack:///./node_modules/dom-helpers/ownerWindow.js","webpack:///./node_modules/dom-helpers/query/contains.js","webpack:///./node_modules/dom-helpers/query/isWindow.js","webpack:///./node_modules/dom-helpers/style/getComputedStyle.js","webpack:///./node_modules/dom-helpers/style/index.js","webpack:///./node_modules/dom-helpers/style/removeStyle.js","webpack:///./node_modules/dom-helpers/transition/isTransform.js","webpack:///./node_modules/dom-helpers/transition/properties.js","webpack:///./node_modules/dom-helpers/util/camelize.js","webpack:///./node_modules/dom-helpers/util/camelizeStyle.js","webpack:///./node_modules/dom-helpers/util/hyphenate.js","webpack:///./node_modules/dom-helpers/util/hyphenateStyle.js","webpack:///./node_modules/dom-helpers/util/inDOM.js","webpack:///./node_modules/dom-helpers/util/scrollbarSize.js","webpack:///./node_modules/elliptic/lib/elliptic.js","webpack:///./node_modules/elliptic/lib/elliptic/curve/base.js","webpack:///./node_modules/elliptic/lib/elliptic/curve/edwards.js","webpack:///./node_modules/elliptic/lib/elliptic/curve/index.js","webpack:///./node_modules/elliptic/lib/elliptic/curve/mont.js","webpack:///./node_modules/elliptic/lib/elliptic/curve/short.js","webpack:///./node_modules/elliptic/lib/elliptic/curves.js","webpack:///./node_modules/elliptic/lib/elliptic/ec/index.js","webpack:///./node_modules/elliptic/lib/elliptic/ec/key.js","webpack:///./node_modules/elliptic/lib/elliptic/ec/signature.js","webpack:///./node_modules/elliptic/lib/elliptic/eddsa/index.js","webpack:///./node_modules/elliptic/lib/elliptic/eddsa/key.js","webpack:///./node_modules/elliptic/lib/elliptic/eddsa/signature.js","webpack:///./node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js","webpack:///./node_modules/elliptic/lib/elliptic/utils.js","webpack:///./node_modules/eth-lib/lib/array.js","webpack:///./node_modules/eth-lib/lib/bytes.js","webpack:///./node_modules/eth-lib/lib/hash.js","webpack:///./node_modules/ethjs-abi/lib/index.js","webpack:///./node_modules/ethjs-abi/lib/utils/index.js","webpack:///./node_modules/ethjs-abi/node_modules/bn.js/lib/bn.js","webpack:///./node_modules/ethjs-abi/node_modules/js-sha3/src/sha3.js","webpack:///./node_modules/ethjs-unit/lib/index.js","webpack:///./node_modules/ethjs-unit/node_modules/bn.js/lib/bn.js","webpack:///./node_modules/events/events.js","webpack:///./node_modules/evp_bytestokey/index.js","webpack:///./node_modules/fast-deep-equal/index.js","webpack:///./node_modules/fast-json-stable-stringify/index.js","webpack:///./node_modules/fbjs/lib/EventListener.js","webpack:///./node_modules/fbjs/lib/ExecutionEnvironment.js","webpack:///./node_modules/fbjs/lib/camelize.js","webpack:///./node_modules/fbjs/lib/camelizeStyleName.js","webpack:///./node_modules/fbjs/lib/containsNode.js","webpack:///./node_modules/fbjs/lib/emptyFunction.js","webpack:///./node_modules/fbjs/lib/emptyObject.js","webpack:///./node_modules/fbjs/lib/focusNode.js","webpack:///./node_modules/fbjs/lib/getActiveElement.js","webpack:///./node_modules/fbjs/lib/hyphenate.js","webpack:///./node_modules/fbjs/lib/hyphenateStyleName.js","webpack:///./node_modules/fbjs/lib/invariant.js","webpack:///./node_modules/fbjs/lib/isNode.js","webpack:///./node_modules/fbjs/lib/isTextNode.js","webpack:///./node_modules/fbjs/lib/shallowEqual.js","webpack:///./node_modules/fbjs/lib/warning.js","webpack:///./node_modules/final-form/dist/final-form.es.js","webpack:///./node_modules/for-each/index.js","webpack:///./node_modules/global/window.js","webpack:///./node_modules/hash-base/index.js","webpack:///./node_modules/hash.js/lib/hash.js","webpack:///./node_modules/hash.js/lib/hash/common.js","webpack:///./node_modules/hash.js/lib/hash/hmac.js","webpack:///./node_modules/hash.js/lib/hash/ripemd.js","webpack:///./node_modules/hash.js/lib/hash/sha.js","webpack:///./node_modules/hash.js/lib/hash/sha/1.js","webpack:///./node_modules/hash.js/lib/hash/sha/224.js","webpack:///./node_modules/hash.js/lib/hash/sha/256.js","webpack:///./node_modules/hash.js/lib/hash/sha/384.js","webpack:///./node_modules/hash.js/lib/hash/sha/512.js","webpack:///./node_modules/hash.js/lib/hash/sha/common.js","webpack:///./node_modules/hash.js/lib/hash/utils.js","webpack:///./node_modules/hmac-drbg/lib/hmac-drbg.js","webpack:///./node_modules/hoist-non-react-statics/index.js","webpack:///./node_modules/hyphenate-style-name/index.js","webpack:///./node_modules/ieee754/index.js","webpack:///./node_modules/indexof/index.js","webpack:///./node_modules/inherits/inherits_browser.js","webpack:///./node_modules/is-function/index.js","webpack:///./node_modules/is-hex-prefixed/src/index.js","webpack:///./node_modules/is-in-browser/dist/module.js","webpack:///./node_modules/json-schema-traverse/index.js","webpack:///./node_modules/jss-camel-case/lib/index.js","webpack:///./node_modules/jss-default-unit/lib/defaultUnits.js","webpack:///./node_modules/jss-default-unit/lib/index.js","webpack:///./node_modules/jss-global/lib/index.js","webpack:///./node_modules/jss-nested/lib/index.js","webpack:///./node_modules/jss-props-sort/lib/index.js","webpack:///./node_modules/jss-vendor-prefixer/lib/index.js","webpack:///./node_modules/jss/lib/Jss.js","webpack:///./node_modules/jss/lib/PluginsRegistry.js","webpack:///./node_modules/jss/lib/RuleList.js","webpack:///./node_modules/jss/lib/SheetsManager.js","webpack:///./node_modules/jss/lib/SheetsRegistry.js","webpack:///./node_modules/jss/lib/StyleSheet.js","webpack:///./node_modules/jss/lib/index.js","webpack:///./node_modules/jss/lib/plugins/functions.js","webpack:///./node_modules/jss/lib/plugins/observables.js","webpack:///./node_modules/jss/lib/plugins/rules.js","webpack:///./node_modules/jss/lib/renderers/DomRenderer.js","webpack:///./node_modules/jss/lib/renderers/VirtualRenderer.js","webpack:///./node_modules/jss/lib/rules/ConditionalRule.js","webpack:///./node_modules/jss/lib/rules/FontFaceRule.js","webpack:///./node_modules/jss/lib/rules/KeyframesRule.js","webpack:///./node_modules/jss/lib/rules/SimpleRule.js","webpack:///./node_modules/jss/lib/rules/StyleRule.js","webpack:///./node_modules/jss/lib/rules/ViewportRule.js","webpack:///./node_modules/jss/lib/sheets.js","webpack:///./node_modules/jss/lib/utils/cloneStyle.js","webpack:///./node_modules/jss/lib/utils/createGenerateClassName.js","webpack:///./node_modules/jss/lib/utils/createRule.js","webpack:///./node_modules/jss/lib/utils/escape.js","webpack:///./node_modules/jss/lib/utils/getDynamicStyles.js","webpack:///./node_modules/jss/lib/utils/isObservable.js","webpack:///./node_modules/jss/lib/utils/linkRule.js","webpack:///./node_modules/jss/lib/utils/moduleId.js","webpack:///./node_modules/jss/lib/utils/toCss.js","webpack:///./node_modules/jss/lib/utils/toCssValue.js","webpack:///./node_modules/jss/node_modules/symbol-observable/es/index.js","webpack:///./node_modules/jss/node_modules/symbol-observable/es/ponyfill.js","webpack:///./node_modules/keycode/index.js","webpack:///./node_modules/lodash/_Symbol.js","webpack:///./node_modules/lodash/_baseGetTag.js","webpack:///./node_modules/lodash/_freeGlobal.js","webpack:///./node_modules/lodash/_getRawTag.js","webpack:///./node_modules/lodash/_objectToString.js","webpack:///./node_modules/lodash/_root.js","webpack:///./node_modules/lodash/debounce.js","webpack:///./node_modules/lodash/isObject.js","webpack:///./node_modules/lodash/isObjectLike.js","webpack:///./node_modules/lodash/isSymbol.js","webpack:///./node_modules/lodash/now.js","webpack:///./node_modules/lodash/toNumber.js","webpack:///./node_modules/material-ui/Button/Button.js","webpack:///./node_modules/material-ui/Button/index.js","webpack:///./node_modules/material-ui/ButtonBase/ButtonBase.js","webpack:///./node_modules/material-ui/ButtonBase/Ripple.js","webpack:///./node_modules/material-ui/ButtonBase/TouchRipple.js","webpack:///./node_modules/material-ui/ButtonBase/createRippleHandler.js","webpack:///./node_modules/material-ui/ButtonBase/index.js","webpack:///./node_modules/material-ui/Form/FormControl.js","webpack:///./node_modules/material-ui/Form/FormControlLabel.js","webpack:///./node_modules/material-ui/Form/FormGroup.js","webpack:///./node_modules/material-ui/Form/FormHelperText.js","webpack:///./node_modules/material-ui/Form/FormLabel.js","webpack:///./node_modules/material-ui/Form/index.js","webpack:///./node_modules/material-ui/Input/Input.js","webpack:///./node_modules/material-ui/Input/InputAdornment.js","webpack:///./node_modules/material-ui/Input/InputLabel.js","webpack:///./node_modules/material-ui/Input/Textarea.js","webpack:///./node_modules/material-ui/Input/index.js","webpack:///./node_modules/material-ui/List/List.js","webpack:///./node_modules/material-ui/List/ListItem.js","webpack:///./node_modules/material-ui/List/ListItemAvatar.js","webpack:///./node_modules/material-ui/List/ListItemIcon.js","webpack:///./node_modules/material-ui/List/ListItemSecondaryAction.js","webpack:///./node_modules/material-ui/List/ListItemText.js","webpack:///./node_modules/material-ui/List/ListSubheader.js","webpack:///./node_modules/material-ui/List/index.js","webpack:///./node_modules/material-ui/Menu/Menu.js","webpack:///./node_modules/material-ui/Menu/MenuList.js","webpack:///./node_modules/material-ui/Modal/Backdrop.js","webpack:///./node_modules/material-ui/Modal/Modal.js","webpack:///./node_modules/material-ui/Modal/ModalManager.js","webpack:///./node_modules/material-ui/Modal/index.js","webpack:///./node_modules/material-ui/Modal/isOverflowing.js","webpack:///./node_modules/material-ui/Modal/manageAriaHidden.js","webpack:///./node_modules/material-ui/Paper/Paper.js","webpack:///./node_modules/material-ui/Paper/index.js","webpack:///./node_modules/material-ui/Popover/Popover.js","webpack:///./node_modules/material-ui/Popover/index.js","webpack:///./node_modules/material-ui/Portal/LegacyPortal.js","webpack:///./node_modules/material-ui/Portal/Portal.js","webpack:///./node_modules/material-ui/Portal/index.js","webpack:///./node_modules/material-ui/Select/Select.js","webpack:///./node_modules/material-ui/Select/SelectInput.js","webpack:///./node_modules/material-ui/SvgIcon/SvgIcon.js","webpack:///./node_modules/material-ui/SvgIcon/index.js","webpack:///./node_modules/material-ui/TextField/TextField.js","webpack:///./node_modules/material-ui/TextField/index.js","webpack:///./node_modules/material-ui/Typography/Typography.js","webpack:///./node_modules/material-ui/Typography/index.js","webpack:///./node_modules/material-ui/colors/common.js","webpack:///./node_modules/material-ui/colors/grey.js","webpack:///./node_modules/material-ui/colors/indigo.js","webpack:///./node_modules/material-ui/colors/pink.js","webpack:///./node_modules/material-ui/colors/red.js","webpack:///./node_modules/material-ui/internal/RefHolder.js","webpack:///./node_modules/material-ui/internal/svg-icons/ArrowDropDown.js","webpack:///./node_modules/material-ui/styles/MuiThemeProvider.js","webpack:///./node_modules/material-ui/styles/colorManipulator.js","webpack:///./node_modules/material-ui/styles/createBreakpoints.js","webpack:///./node_modules/material-ui/styles/createGenerateClassName.js","webpack:///./node_modules/material-ui/styles/createMixins.js","webpack:///./node_modules/material-ui/styles/createMuiTheme.js","webpack:///./node_modules/material-ui/styles/createPalette.js","webpack:///./node_modules/material-ui/styles/createTypography.js","webpack:///./node_modules/material-ui/styles/getStylesCreator.js","webpack:///./node_modules/material-ui/styles/index.js","webpack:///./node_modules/material-ui/styles/jssPreset.js","webpack:///./node_modules/material-ui/styles/shadows.js","webpack:///./node_modules/material-ui/styles/spacing.js","webpack:///./node_modules/material-ui/styles/themeListener.js","webpack:///./node_modules/material-ui/styles/transitions.js","webpack:///./node_modules/material-ui/styles/withStyles.js","webpack:///./node_modules/material-ui/styles/withTheme.js","webpack:///./node_modules/material-ui/styles/zIndex.js","webpack:///./node_modules/material-ui/transitions/Fade.js","webpack:///./node_modules/material-ui/transitions/Grow.js","webpack:///./node_modules/material-ui/transitions/utils.js","webpack:///./node_modules/material-ui/utils/addEventListener.js","webpack:///./node_modules/material-ui/utils/exactProp.js","webpack:///./node_modules/material-ui/utils/helpers.js","webpack:///./node_modules/material-ui/utils/keyboardFocus.js","webpack:///./node_modules/material-ui/utils/reactHelpers.js","webpack:///./node_modules/md5.js/index.js","webpack:///./node_modules/md5.js/node_modules/hash-base/index.js","webpack:///./node_modules/miller-rabin/lib/mr.js","webpack:///./node_modules/minimalistic-assert/index.js","webpack:///./node_modules/minimalistic-crypto-utils/lib/utils.js","webpack:///./node_modules/node-libs-browser/node_modules/string_decoder/lib/string_decoder.js","webpack:///./node_modules/number-to-bn/node_modules/bn.js/lib/bn.js","webpack:///./node_modules/number-to-bn/src/index.js","webpack:///./node_modules/object-assign/index.js","webpack:///./node_modules/oboe/dist/oboe-browser.js","webpack:///./node_modules/parse-asn1/asn1.js","webpack:///./node_modules/parse-asn1/certificate.js","webpack:///./node_modules/parse-asn1/fixProc.js","webpack:///./node_modules/parse-asn1/index.js","webpack:///./node_modules/parse-headers/parse-headers.js","webpack:///./node_modules/pbkdf2/browser.js","webpack:///./node_modules/pbkdf2/lib/async.js","webpack:///./node_modules/pbkdf2/lib/default-encoding.js","webpack:///./node_modules/pbkdf2/lib/precondition.js","webpack:///./node_modules/pbkdf2/lib/sync-browser.js","webpack:///./node_modules/process-nextick-args/index.js","webpack:///./node_modules/process/browser.js","webpack:///./node_modules/prop-types/checkPropTypes.js","webpack:///./node_modules/prop-types/factoryWithTypeCheckers.js","webpack:///./node_modules/prop-types/index.js","webpack:///./node_modules/prop-types/lib/ReactPropTypesSecret.js","webpack:///./node_modules/public-encrypt/browser.js","webpack:///./node_modules/public-encrypt/mgf.js","webpack:///./node_modules/public-encrypt/privateDecrypt.js","webpack:///./node_modules/public-encrypt/publicEncrypt.js","webpack:///./node_modules/public-encrypt/withPublic.js","webpack:///./node_modules/public-encrypt/xor.js","webpack:///./node_modules/punycode/punycode.js","webpack:///./node_modules/query-string/index.js","webpack:///./node_modules/querystring-es3/decode.js","webpack:///./node_modules/querystring-es3/encode.js","webpack:///./node_modules/querystring-es3/index.js","webpack:///./node_modules/randombytes/browser.js","webpack:///./node_modules/randomfill/browser.js","webpack:///./node_modules/randomhex/src/browser.js","webpack:///./node_modules/randomhex/src/crypto.js","webpack:///./node_modules/randomhex/src/index.js","webpack:///./node_modules/react-dom/cjs/react-dom.development.js","webpack:///./node_modules/react-dom/index.js","webpack:///./node_modules/react-event-listener/lib/index.js","webpack:///./node_modules/react-event-listener/lib/supports.js","webpack:///./node_modules/react-final-form/dist/react-final-form.es.js","webpack:///./node_modules/react-jss/lib/contextTypes.js","webpack:///./node_modules/react-jss/lib/ns.js","webpack:///./node_modules/react-jss/lib/propTypes.js","webpack:///./node_modules/react-transition-group/Transition.js","webpack:///./node_modules/react-transition-group/TransitionGroup.js","webpack:///./node_modules/react-transition-group/utils/ChildMapping.js","webpack:///./node_modules/react-transition-group/utils/PropTypes.js","webpack:///./node_modules/react/cjs/react.development.js","webpack:///./node_modules/react/index.js","webpack:///./node_modules/recompose/getDisplayName.js","webpack:///./node_modules/recompose/pure.js","webpack:///./node_modules/recompose/setDisplayName.js","webpack:///./node_modules/recompose/setStatic.js","webpack:///./node_modules/recompose/shallowEqual.js","webpack:///./node_modules/recompose/shouldUpdate.js","webpack:///./node_modules/recompose/wrapDisplayName.js","webpack:///./node_modules/ripemd160/index.js","webpack:///./node_modules/safe-buffer/index.js","webpack:///./node_modules/scrypt.js/js.js","webpack:///./node_modules/scryptsy/lib/scrypt.js","webpack:///./node_modules/setimmediate/setImmediate.js","webpack:///./node_modules/sha.js/hash.js","webpack:///./node_modules/sha.js/index.js","webpack:///./node_modules/sha.js/sha.js","webpack:///./node_modules/sha.js/sha1.js","webpack:///./node_modules/sha.js/sha224.js","webpack:///./node_modules/sha.js/sha256.js","webpack:///./node_modules/sha.js/sha384.js","webpack:///./node_modules/sha.js/sha512.js","webpack:///./node_modules/stream-browserify/index.js","webpack:///./node_modules/stream-browserify/node_modules/isarray/index.js","webpack:///./node_modules/stream-browserify/node_modules/readable-stream/duplex-browser.js","webpack:///./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js","webpack:///./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_passthrough.js","webpack:///./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_readable.js","webpack:///./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_transform.js","webpack:///./node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_writable.js","webpack:///./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/BufferList.js","webpack:///./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/destroy.js","webpack:///./node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/stream-browser.js","webpack:///./node_modules/stream-browserify/node_modules/readable-stream/passthrough.js","webpack:///./node_modules/stream-browserify/node_modules/readable-stream/readable-browser.js","webpack:///./node_modules/stream-browserify/node_modules/readable-stream/transform.js","webpack:///./node_modules/stream-browserify/node_modules/readable-stream/writable-browser.js","webpack:///./node_modules/strict-uri-encode/index.js","webpack:///./node_modules/strip-hex-prefix/src/index.js","webpack:///./node_modules/style-loader/lib/addStyles.js","webpack:///./node_modules/style-loader/lib/urls.js","webpack:///./node_modules/swarm-js/lib/api-browser.js","webpack:///./node_modules/swarm-js/lib/pick.js","webpack:///./node_modules/swarm-js/lib/swarm-hash.js","webpack:///./node_modules/swarm-js/lib/swarm.js","webpack:///./node_modules/timers-browserify/main.js","webpack:///./node_modules/trim/index.js","webpack:///./node_modules/truffle-blockchain-utils/index.js","webpack:///./node_modules/truffle-contract-schema/index.js","webpack:///./node_modules/truffle-contract-schema/node_modules/ajv/lib/$data.js","webpack:///./node_modules/truffle-contract-schema/node_modules/ajv/lib/ajv.js","webpack:///./node_modules/truffle-contract-schema/node_modules/ajv/lib/cache.js","webpack:///./node_modules/truffle-contract-schema/node_modules/ajv/lib/compile/_rules.js","webpack:///./node_modules/truffle-contract-schema/node_modules/ajv/lib/compile/async.js","webpack:///./node_modules/truffle-contract-schema/node_modules/ajv/lib/compile/error_classes.js","webpack:///./node_modules/truffle-contract-schema/node_modules/ajv/lib/compile/formats.js","webpack:///./node_modules/truffle-contract-schema/node_modules/ajv/lib/compile/index.js","webpack:///./node_modules/truffle-contract-schema/node_modules/ajv/lib/compile/resolve.js","webpack:///./node_modules/truffle-contract-schema/node_modules/ajv/lib/compile/rules.js","webpack:///./node_modules/truffle-contract-schema/node_modules/ajv/lib/compile/schema_obj.js","webpack:///./node_modules/truffle-contract-schema/node_modules/ajv/lib/compile/ucs2length.js","webpack:///./node_modules/truffle-contract-schema/node_modules/ajv/lib/compile/util.js","webpack:///./node_modules/truffle-contract-schema/node_modules/ajv/lib/dotjs/_limit.js","webpack:///./node_modules/truffle-contract-schema/node_modules/ajv/lib/dotjs/_limitItems.js","webpack:///./node_modules/truffle-contract-schema/node_modules/ajv/lib/dotjs/_limitLength.js","webpack:///./node_modules/truffle-contract-schema/node_modules/ajv/lib/dotjs/_limitProperties.js","webpack:///./node_modules/truffle-contract-schema/node_modules/ajv/lib/dotjs/allOf.js","webpack:///./node_modules/truffle-contract-schema/node_modules/ajv/lib/dotjs/anyOf.js","webpack:///./node_modules/truffle-contract-schema/node_modules/ajv/lib/dotjs/const.js","webpack:///./node_modules/truffle-contract-schema/node_modules/ajv/lib/dotjs/contains.js","webpack:///./node_modules/truffle-contract-schema/node_modules/ajv/lib/dotjs/custom.js","webpack:///./node_modules/truffle-contract-schema/node_modules/ajv/lib/dotjs/dependencies.js","webpack:///./node_modules/truffle-contract-schema/node_modules/ajv/lib/dotjs/enum.js","webpack:///./node_modules/truffle-contract-schema/node_modules/ajv/lib/dotjs/format.js","webpack:///./node_modules/truffle-contract-schema/node_modules/ajv/lib/dotjs/items.js","webpack:///./node_modules/truffle-contract-schema/node_modules/ajv/lib/dotjs/multipleOf.js","webpack:///./node_modules/truffle-contract-schema/node_modules/ajv/lib/dotjs/not.js","webpack:///./node_modules/truffle-contract-schema/node_modules/ajv/lib/dotjs/oneOf.js","webpack:///./node_modules/truffle-contract-schema/node_modules/ajv/lib/dotjs/pattern.js","webpack:///./node_modules/truffle-contract-schema/node_modules/ajv/lib/dotjs/properties.js","webpack:///./node_modules/truffle-contract-schema/node_modules/ajv/lib/dotjs/propertyNames.js","webpack:///./node_modules/truffle-contract-schema/node_modules/ajv/lib/dotjs/ref.js","webpack:///./node_modules/truffle-contract-schema/node_modules/ajv/lib/dotjs/required.js","webpack:///./node_modules/truffle-contract-schema/node_modules/ajv/lib/dotjs/uniqueItems.js","webpack:///./node_modules/truffle-contract-schema/node_modules/ajv/lib/dotjs/validate.js","webpack:///./node_modules/truffle-contract-schema/node_modules/ajv/lib/keyword.js","webpack:///./node_modules/truffle-contract-schema/node_modules/ajv/lib/patternGroups.js","webpack:///./node_modules/truffle-contract/contract.js","webpack:///./node_modules/truffle-contract/index.js","webpack:///./node_modules/truffle-contract/node_modules/crypto-js/aes.js","webpack:///./node_modules/truffle-contract/node_modules/crypto-js/cipher-core.js","webpack:///./node_modules/truffle-contract/node_modules/crypto-js/core.js","webpack:///./node_modules/truffle-contract/node_modules/crypto-js/enc-base64.js","webpack:///./node_modules/truffle-contract/node_modules/crypto-js/enc-utf16.js","webpack:///./node_modules/truffle-contract/node_modules/crypto-js/evpkdf.js","webpack:///./node_modules/truffle-contract/node_modules/crypto-js/format-hex.js","webpack:///./node_modules/truffle-contract/node_modules/crypto-js/hmac.js","webpack:///./node_modules/truffle-contract/node_modules/crypto-js/index.js","webpack:///./node_modules/truffle-contract/node_modules/crypto-js/lib-typedarrays.js","webpack:///./node_modules/truffle-contract/node_modules/crypto-js/md5.js","webpack:///./node_modules/truffle-contract/node_modules/crypto-js/mode-cfb.js","webpack:///./node_modules/truffle-contract/node_modules/crypto-js/mode-ctr-gladman.js","webpack:///./node_modules/truffle-contract/node_modules/crypto-js/mode-ctr.js","webpack:///./node_modules/truffle-contract/node_modules/crypto-js/mode-ecb.js","webpack:///./node_modules/truffle-contract/node_modules/crypto-js/mode-ofb.js","webpack:///./node_modules/truffle-contract/node_modules/crypto-js/pad-ansix923.js","webpack:///./node_modules/truffle-contract/node_modules/crypto-js/pad-iso10126.js","webpack:///./node_modules/truffle-contract/node_modules/crypto-js/pad-iso97971.js","webpack:///./node_modules/truffle-contract/node_modules/crypto-js/pad-nopadding.js","webpack:///./node_modules/truffle-contract/node_modules/crypto-js/pad-zeropadding.js","webpack:///./node_modules/truffle-contract/node_modules/crypto-js/pbkdf2.js","webpack:///./node_modules/truffle-contract/node_modules/crypto-js/rabbit-legacy.js","webpack:///./node_modules/truffle-contract/node_modules/crypto-js/rabbit.js","webpack:///./node_modules/truffle-contract/node_modules/crypto-js/rc4.js","webpack:///./node_modules/truffle-contract/node_modules/crypto-js/ripemd160.js","webpack:///./node_modules/truffle-contract/node_modules/crypto-js/sha1.js","webpack:///./node_modules/truffle-contract/node_modules/crypto-js/sha224.js","webpack:///./node_modules/truffle-contract/node_modules/crypto-js/sha256.js","webpack:///./node_modules/truffle-contract/node_modules/crypto-js/sha3.js","webpack:///./node_modules/truffle-contract/node_modules/crypto-js/sha384.js","webpack:///./node_modules/truffle-contract/node_modules/crypto-js/sha512.js","webpack:///./node_modules/truffle-contract/node_modules/crypto-js/tripledes.js","webpack:///./node_modules/truffle-contract/node_modules/crypto-js/x64-core.js","webpack:///./node_modules/truffle-contract/node_modules/web3/index.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/solidity/address.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/solidity/bool.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/solidity/bytes.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/solidity/coder.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/solidity/dynamicbytes.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/solidity/formatters.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/solidity/int.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/solidity/param.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/solidity/real.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/solidity/string.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/solidity/type.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/solidity/uint.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/solidity/ureal.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/utils/browser-xhr.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/utils/config.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/utils/sha3.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/utils/utils.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/web3.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/web3/allevents.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/web3/batch.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/web3/contract.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/web3/errors.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/web3/event.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/web3/extend.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/web3/filter.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/web3/formatters.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/web3/function.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/web3/httpprovider.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/web3/iban.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/web3/ipcprovider.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/web3/jsonrpc.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/web3/method.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/web3/methods/db.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/web3/methods/eth.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/web3/methods/net.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/web3/methods/personal.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/web3/methods/shh.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/web3/methods/swarm.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/web3/methods/watches.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/web3/namereg.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/web3/property.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/web3/requestmanager.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/web3/settings.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/web3/syncing.js","webpack:///./node_modules/truffle-contract/node_modules/web3/lib/web3/transfer.js","webpack:///./node_modules/truffle-contract/statuserror.js","webpack:///./node_modules/truffle-error/extendablebuiltin.js","webpack:///./node_modules/truffle-error/index.js","webpack:///./node_modules/url-set-query/index.js","webpack:///./node_modules/url/url.js","webpack:///./node_modules/url/util.js","webpack:///./node_modules/utf8/utf8.js","webpack:///./node_modules/util-deprecate/browser.js","webpack:///./node_modules/util/node_modules/inherits/inherits_browser.js","webpack:///./node_modules/util/support/isBufferBrowser.js","webpack:///./node_modules/util/util.js","webpack:///./node_modules/vm-browserify/index.js","webpack:///./node_modules/warning/browser.js","webpack:///./node_modules/web3-bzz/node_modules/underscore/underscore.js","webpack:///./node_modules/web3-bzz/src/index.js","webpack:///./node_modules/web3-core-helpers/node_modules/underscore/underscore.js","webpack:///./node_modules/web3-core-helpers/src/errors.js","webpack:///./node_modules/web3-core-helpers/src/formatters.js","webpack:///./node_modules/web3-core-helpers/src/index.js","webpack:///./node_modules/web3-core-method/node_modules/underscore/underscore.js","webpack:///./node_modules/web3-core-method/src/index.js","webpack:///./node_modules/web3-core-promievent/node_modules/bluebird/js/browser/bluebird.js","webpack:///./node_modules/web3-core-promievent/node_modules/eventemitter3/index.js","webpack:///./node_modules/web3-core-promievent/src/index.js","webpack:///./node_modules/web3-core-requestmanager/node_modules/underscore/underscore.js","webpack:///./node_modules/web3-core-requestmanager/src/batch.js","webpack:///./node_modules/web3-core-requestmanager/src/givenProvider.js","webpack:///./node_modules/web3-core-requestmanager/src/index.js","webpack:///./node_modules/web3-core-requestmanager/src/jsonrpc.js","webpack:///./node_modules/web3-core-subscriptions/node_modules/eventemitter3/index.js","webpack:///./node_modules/web3-core-subscriptions/node_modules/underscore/underscore.js","webpack:///./node_modules/web3-core-subscriptions/src/index.js","webpack:///./node_modules/web3-core-subscriptions/src/subscription.js","webpack:///./node_modules/web3-core/src/extend.js","webpack:///./node_modules/web3-core/src/index.js","webpack:///./node_modules/web3-eth-abi/node_modules/bn.js/lib/bn.js","webpack:///./node_modules/web3-eth-abi/node_modules/underscore/underscore.js","webpack:///./node_modules/web3-eth-abi/src/formatters.js","webpack:///./node_modules/web3-eth-abi/src/index.js","webpack:///./node_modules/web3-eth-abi/src/param.js","webpack:///./node_modules/web3-eth-abi/src/type.js","webpack:///./node_modules/web3-eth-abi/src/types/address.js","webpack:///./node_modules/web3-eth-abi/src/types/bool.js","webpack:///./node_modules/web3-eth-abi/src/types/bytes.js","webpack:///./node_modules/web3-eth-abi/src/types/dynamicbytes.js","webpack:///./node_modules/web3-eth-abi/src/types/int.js","webpack:///./node_modules/web3-eth-abi/src/types/string.js","webpack:///./node_modules/web3-eth-abi/src/types/uint.js","webpack:///./node_modules/web3-eth-accounts/node_modules/bluebird/js/browser/bluebird.js","webpack:///./node_modules/web3-eth-accounts/node_modules/eth-lib/lib/account.js","webpack:///./node_modules/web3-eth-accounts/node_modules/eth-lib/lib/array.js","webpack:///./node_modules/web3-eth-accounts/node_modules/eth-lib/lib/bytes.js","webpack:///./node_modules/web3-eth-accounts/node_modules/eth-lib/lib/hash.js","webpack:///./node_modules/web3-eth-accounts/node_modules/eth-lib/lib/nat.js","webpack:///./node_modules/web3-eth-accounts/node_modules/eth-lib/lib/rlp.js","webpack:///./node_modules/web3-eth-accounts/node_modules/underscore/underscore.js","webpack:///./node_modules/web3-eth-accounts/node_modules/uuid/rng-browser.js","webpack:///./node_modules/web3-eth-accounts/node_modules/uuid/uuid.js","webpack:///./node_modules/web3-eth-accounts/src/index.js","webpack:///./node_modules/web3-eth-contract/node_modules/underscore/underscore.js","webpack:///./node_modules/web3-eth-contract/src/index.js","webpack:///./node_modules/web3-eth-iban/src/index.js","webpack:///./node_modules/web3-eth-personal/src/index.js","webpack:///./node_modules/web3-eth/node_modules/underscore/underscore.js","webpack:///./node_modules/web3-eth/src/getNetworkType.js","webpack:///./node_modules/web3-eth/src/index.js","webpack:///./node_modules/web3-net/src/index.js","webpack:///./node_modules/web3-providers-http/src/index.js","webpack:///./node_modules/web3-providers-ipc/node_modules/underscore/underscore.js","webpack:///./node_modules/web3-providers-ipc/src/index.js","webpack:///./node_modules/web3-providers-ws/node_modules/underscore/underscore.js","webpack:///./node_modules/web3-providers-ws/src/index.js","webpack:///./node_modules/web3-shh/src/index.js","webpack:///./node_modules/web3-utils/node_modules/bn.js/lib/bn.js","webpack:///./node_modules/web3-utils/node_modules/underscore/underscore.js","webpack:///./node_modules/web3-utils/src/index.js","webpack:///./node_modules/web3-utils/src/soliditySha3.js","webpack:///./node_modules/web3-utils/src/utils.js","webpack:///./node_modules/web3/src/index.js","webpack:///(webpack)/buildin/global.js","webpack:///(webpack)/buildin/harmony-module.js","webpack:///(webpack)/buildin/module.js","webpack:///./node_modules/websocket/lib/browser.js","webpack:///./node_modules/websocket/lib/version.js","webpack:///./node_modules/xhr-request-promise/index.js","webpack:///./node_modules/xhr-request/index.js","webpack:///./node_modules/xhr-request/lib/ensure-header.js","webpack:///./node_modules/xhr-request/lib/normalize-response.js","webpack:///./node_modules/xhr-request/lib/request-browser.js","webpack:///./node_modules/xhr/index.js","webpack:///./node_modules/xhr2/lib/browser.js","webpack:///./node_modules/xtend/immutable.js","webpack:///src/App.js","webpack:///./src/App.scss?e298","webpack:///src/components/Header/index.jsx","webpack:///./src/components/Header/index.scss?8f3b","webpack:///src/components/forms/TextField/index.jsx","webpack:///src/components/layout/Page/index.jsx","webpack:///./src/components/layout/Page/index.scss?759e","webpack:///src/components/layout/PageFrame/index.jsx","webpack:///./src/components/layout/PageFrame/index.scss?0e08","webpack:///src/index.js","webpack:///src/theme/mui.js","webpack:///src/theme/variables.js","webpack:///src/utils/getWeb3.js","webpack:///buffer (ignored)","webpack:///util (ignored)","webpack:///util (ignored)?8c51","webpack:///crypto (ignored)"],"sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/index.js\");\n","var asn1 = exports;\n\nasn1.bignum = require('bn.js');\n\nasn1.define = require('./asn1/api').define;\nasn1.base = require('./asn1/base');\nasn1.constants = require('./asn1/constants');\nasn1.decoders = require('./asn1/decoders');\nasn1.encoders = require('./asn1/encoders');\n","var asn1 = require('../asn1');\nvar inherits = require('inherits');\n\nvar api = exports;\n\napi.define = function define(name, body) {\n return new Entity(name, body);\n};\n\nfunction Entity(name, body) {\n this.name = name;\n this.body = body;\n\n this.decoders = {};\n this.encoders = {};\n};\n\nEntity.prototype._createNamed = function createNamed(base) {\n var named;\n try {\n named = require('vm').runInThisContext(\n '(function ' + this.name + '(entity) {\\n' +\n ' this._initNamed(entity);\\n' +\n '})'\n );\n } catch (e) {\n named = function (entity) {\n this._initNamed(entity);\n };\n }\n inherits(named, base);\n named.prototype._initNamed = function initnamed(entity) {\n base.call(this, entity);\n };\n\n return new named(this);\n};\n\nEntity.prototype._getDecoder = function _getDecoder(enc) {\n enc = enc || 'der';\n // Lazily create decoder\n if (!this.decoders.hasOwnProperty(enc))\n this.decoders[enc] = this._createNamed(asn1.decoders[enc]);\n return this.decoders[enc];\n};\n\nEntity.prototype.decode = function decode(data, enc, options) {\n return this._getDecoder(enc).decode(data, options);\n};\n\nEntity.prototype._getEncoder = function _getEncoder(enc) {\n enc = enc || 'der';\n // Lazily create encoder\n if (!this.encoders.hasOwnProperty(enc))\n this.encoders[enc] = this._createNamed(asn1.encoders[enc]);\n return this.encoders[enc];\n};\n\nEntity.prototype.encode = function encode(data, enc, /* internal */ reporter) {\n return this._getEncoder(enc).encode(data, reporter);\n};\n","var inherits = require('inherits');\nvar Reporter = require('../base').Reporter;\nvar Buffer = require('buffer').Buffer;\n\nfunction DecoderBuffer(base, options) {\n Reporter.call(this, options);\n if (!Buffer.isBuffer(base)) {\n this.error('Input not Buffer');\n return;\n }\n\n this.base = base;\n this.offset = 0;\n this.length = base.length;\n}\ninherits(DecoderBuffer, Reporter);\nexports.DecoderBuffer = DecoderBuffer;\n\nDecoderBuffer.prototype.save = function save() {\n return { offset: this.offset, reporter: Reporter.prototype.save.call(this) };\n};\n\nDecoderBuffer.prototype.restore = function restore(save) {\n // Return skipped data\n var res = new DecoderBuffer(this.base);\n res.offset = save.offset;\n res.length = this.offset;\n\n this.offset = save.offset;\n Reporter.prototype.restore.call(this, save.reporter);\n\n return res;\n};\n\nDecoderBuffer.prototype.isEmpty = function isEmpty() {\n return this.offset === this.length;\n};\n\nDecoderBuffer.prototype.readUInt8 = function readUInt8(fail) {\n if (this.offset + 1 <= this.length)\n return this.base.readUInt8(this.offset++, true);\n else\n return this.error(fail || 'DecoderBuffer overrun');\n}\n\nDecoderBuffer.prototype.skip = function skip(bytes, fail) {\n if (!(this.offset + bytes <= this.length))\n return this.error(fail || 'DecoderBuffer overrun');\n\n var res = new DecoderBuffer(this.base);\n\n // Share reporter state\n res._reporterState = this._reporterState;\n\n res.offset = this.offset;\n res.length = this.offset + bytes;\n this.offset += bytes;\n return res;\n}\n\nDecoderBuffer.prototype.raw = function raw(save) {\n return this.base.slice(save ? save.offset : this.offset, this.length);\n}\n\nfunction EncoderBuffer(value, reporter) {\n if (Array.isArray(value)) {\n this.length = 0;\n this.value = value.map(function(item) {\n if (!(item instanceof EncoderBuffer))\n item = new EncoderBuffer(item, reporter);\n this.length += item.length;\n return item;\n }, this);\n } else if (typeof value === 'number') {\n if (!(0 <= value && value <= 0xff))\n return reporter.error('non-byte EncoderBuffer value');\n this.value = value;\n this.length = 1;\n } else if (typeof value === 'string') {\n this.value = value;\n this.length = Buffer.byteLength(value);\n } else if (Buffer.isBuffer(value)) {\n this.value = value;\n this.length = value.length;\n } else {\n return reporter.error('Unsupported type: ' + typeof value);\n }\n}\nexports.EncoderBuffer = EncoderBuffer;\n\nEncoderBuffer.prototype.join = function join(out, offset) {\n if (!out)\n out = new Buffer(this.length);\n if (!offset)\n offset = 0;\n\n if (this.length === 0)\n return out;\n\n if (Array.isArray(this.value)) {\n this.value.forEach(function(item) {\n item.join(out, offset);\n offset += item.length;\n });\n } else {\n if (typeof this.value === 'number')\n out[offset] = this.value;\n else if (typeof this.value === 'string')\n out.write(this.value, offset);\n else if (Buffer.isBuffer(this.value))\n this.value.copy(out, offset);\n offset += this.length;\n }\n\n return out;\n};\n","var base = exports;\n\nbase.Reporter = require('./reporter').Reporter;\nbase.DecoderBuffer = require('./buffer').DecoderBuffer;\nbase.EncoderBuffer = require('./buffer').EncoderBuffer;\nbase.Node = require('./node');\n","var Reporter = require('../base').Reporter;\nvar EncoderBuffer = require('../base').EncoderBuffer;\nvar DecoderBuffer = require('../base').DecoderBuffer;\nvar assert = require('minimalistic-assert');\n\n// Supported tags\nvar tags = [\n 'seq', 'seqof', 'set', 'setof', 'objid', 'bool',\n 'gentime', 'utctime', 'null_', 'enum', 'int', 'objDesc',\n 'bitstr', 'bmpstr', 'charstr', 'genstr', 'graphstr', 'ia5str', 'iso646str',\n 'numstr', 'octstr', 'printstr', 't61str', 'unistr', 'utf8str', 'videostr'\n];\n\n// Public methods list\nvar methods = [\n 'key', 'obj', 'use', 'optional', 'explicit', 'implicit', 'def', 'choice',\n 'any', 'contains'\n].concat(tags);\n\n// Overrided methods list\nvar overrided = [\n '_peekTag', '_decodeTag', '_use',\n '_decodeStr', '_decodeObjid', '_decodeTime',\n '_decodeNull', '_decodeInt', '_decodeBool', '_decodeList',\n\n '_encodeComposite', '_encodeStr', '_encodeObjid', '_encodeTime',\n '_encodeNull', '_encodeInt', '_encodeBool'\n];\n\nfunction Node(enc, parent) {\n var state = {};\n this._baseState = state;\n\n state.enc = enc;\n\n state.parent = parent || null;\n state.children = null;\n\n // State\n state.tag = null;\n state.args = null;\n state.reverseArgs = null;\n state.choice = null;\n state.optional = false;\n state.any = false;\n state.obj = false;\n state.use = null;\n state.useDecoder = null;\n state.key = null;\n state['default'] = null;\n state.explicit = null;\n state.implicit = null;\n state.contains = null;\n\n // Should create new instance on each method\n if (!state.parent) {\n state.children = [];\n this._wrap();\n }\n}\nmodule.exports = Node;\n\nvar stateProps = [\n 'enc', 'parent', 'children', 'tag', 'args', 'reverseArgs', 'choice',\n 'optional', 'any', 'obj', 'use', 'alteredUse', 'key', 'default', 'explicit',\n 'implicit', 'contains'\n];\n\nNode.prototype.clone = function clone() {\n var state = this._baseState;\n var cstate = {};\n stateProps.forEach(function(prop) {\n cstate[prop] = state[prop];\n });\n var res = new this.constructor(cstate.parent);\n res._baseState = cstate;\n return res;\n};\n\nNode.prototype._wrap = function wrap() {\n var state = this._baseState;\n methods.forEach(function(method) {\n this[method] = function _wrappedMethod() {\n var clone = new this.constructor(this);\n state.children.push(clone);\n return clone[method].apply(clone, arguments);\n };\n }, this);\n};\n\nNode.prototype._init = function init(body) {\n var state = this._baseState;\n\n assert(state.parent === null);\n body.call(this);\n\n // Filter children\n state.children = state.children.filter(function(child) {\n return child._baseState.parent === this;\n }, this);\n assert.equal(state.children.length, 1, 'Root node can have only one child');\n};\n\nNode.prototype._useArgs = function useArgs(args) {\n var state = this._baseState;\n\n // Filter children and args\n var children = args.filter(function(arg) {\n return arg instanceof this.constructor;\n }, this);\n args = args.filter(function(arg) {\n return !(arg instanceof this.constructor);\n }, this);\n\n if (children.length !== 0) {\n assert(state.children === null);\n state.children = children;\n\n // Replace parent to maintain backward link\n children.forEach(function(child) {\n child._baseState.parent = this;\n }, this);\n }\n if (args.length !== 0) {\n assert(state.args === null);\n state.args = args;\n state.reverseArgs = args.map(function(arg) {\n if (typeof arg !== 'object' || arg.constructor !== Object)\n return arg;\n\n var res = {};\n Object.keys(arg).forEach(function(key) {\n if (key == (key | 0))\n key |= 0;\n var value = arg[key];\n res[value] = key;\n });\n return res;\n });\n }\n};\n\n//\n// Overrided methods\n//\n\noverrided.forEach(function(method) {\n Node.prototype[method] = function _overrided() {\n var state = this._baseState;\n throw new Error(method + ' not implemented for encoding: ' + state.enc);\n };\n});\n\n//\n// Public methods\n//\n\ntags.forEach(function(tag) {\n Node.prototype[tag] = function _tagMethod() {\n var state = this._baseState;\n var args = Array.prototype.slice.call(arguments);\n\n assert(state.tag === null);\n state.tag = tag;\n\n this._useArgs(args);\n\n return this;\n };\n});\n\nNode.prototype.use = function use(item) {\n assert(item);\n var state = this._baseState;\n\n assert(state.use === null);\n state.use = item;\n\n return this;\n};\n\nNode.prototype.optional = function optional() {\n var state = this._baseState;\n\n state.optional = true;\n\n return this;\n};\n\nNode.prototype.def = function def(val) {\n var state = this._baseState;\n\n assert(state['default'] === null);\n state['default'] = val;\n state.optional = true;\n\n return this;\n};\n\nNode.prototype.explicit = function explicit(num) {\n var state = this._baseState;\n\n assert(state.explicit === null && state.implicit === null);\n state.explicit = num;\n\n return this;\n};\n\nNode.prototype.implicit = function implicit(num) {\n var state = this._baseState;\n\n assert(state.explicit === null && state.implicit === null);\n state.implicit = num;\n\n return this;\n};\n\nNode.prototype.obj = function obj() {\n var state = this._baseState;\n var args = Array.prototype.slice.call(arguments);\n\n state.obj = true;\n\n if (args.length !== 0)\n this._useArgs(args);\n\n return this;\n};\n\nNode.prototype.key = function key(newKey) {\n var state = this._baseState;\n\n assert(state.key === null);\n state.key = newKey;\n\n return this;\n};\n\nNode.prototype.any = function any() {\n var state = this._baseState;\n\n state.any = true;\n\n return this;\n};\n\nNode.prototype.choice = function choice(obj) {\n var state = this._baseState;\n\n assert(state.choice === null);\n state.choice = obj;\n this._useArgs(Object.keys(obj).map(function(key) {\n return obj[key];\n }));\n\n return this;\n};\n\nNode.prototype.contains = function contains(item) {\n var state = this._baseState;\n\n assert(state.use === null);\n state.contains = item;\n\n return this;\n};\n\n//\n// Decoding\n//\n\nNode.prototype._decode = function decode(input, options) {\n var state = this._baseState;\n\n // Decode root node\n if (state.parent === null)\n return input.wrapResult(state.children[0]._decode(input, options));\n\n var result = state['default'];\n var present = true;\n\n var prevKey = null;\n if (state.key !== null)\n prevKey = input.enterKey(state.key);\n\n // Check if tag is there\n if (state.optional) {\n var tag = null;\n if (state.explicit !== null)\n tag = state.explicit;\n else if (state.implicit !== null)\n tag = state.implicit;\n else if (state.tag !== null)\n tag = state.tag;\n\n if (tag === null && !state.any) {\n // Trial and Error\n var save = input.save();\n try {\n if (state.choice === null)\n this._decodeGeneric(state.tag, input, options);\n else\n this._decodeChoice(input, options);\n present = true;\n } catch (e) {\n present = false;\n }\n input.restore(save);\n } else {\n present = this._peekTag(input, tag, state.any);\n\n if (input.isError(present))\n return present;\n }\n }\n\n // Push object on stack\n var prevObj;\n if (state.obj && present)\n prevObj = input.enterObject();\n\n if (present) {\n // Unwrap explicit values\n if (state.explicit !== null) {\n var explicit = this._decodeTag(input, state.explicit);\n if (input.isError(explicit))\n return explicit;\n input = explicit;\n }\n\n var start = input.offset;\n\n // Unwrap implicit and normal values\n if (state.use === null && state.choice === null) {\n if (state.any)\n var save = input.save();\n var body = this._decodeTag(\n input,\n state.implicit !== null ? state.implicit : state.tag,\n state.any\n );\n if (input.isError(body))\n return body;\n\n if (state.any)\n result = input.raw(save);\n else\n input = body;\n }\n\n if (options && options.track && state.tag !== null)\n options.track(input.path(), start, input.length, 'tagged');\n\n if (options && options.track && state.tag !== null)\n options.track(input.path(), input.offset, input.length, 'content');\n\n // Select proper method for tag\n if (state.any)\n result = result;\n else if (state.choice === null)\n result = this._decodeGeneric(state.tag, input, options);\n else\n result = this._decodeChoice(input, options);\n\n if (input.isError(result))\n return result;\n\n // Decode children\n if (!state.any && state.choice === null && state.children !== null) {\n state.children.forEach(function decodeChildren(child) {\n // NOTE: We are ignoring errors here, to let parser continue with other\n // parts of encoded data\n child._decode(input, options);\n });\n }\n\n // Decode contained/encoded by schema, only in bit or octet strings\n if (state.contains && (state.tag === 'octstr' || state.tag === 'bitstr')) {\n var data = new DecoderBuffer(result);\n result = this._getUse(state.contains, input._reporterState.obj)\n ._decode(data, options);\n }\n }\n\n // Pop object\n if (state.obj && present)\n result = input.leaveObject(prevObj);\n\n // Set key\n if (state.key !== null && (result !== null || present === true))\n input.leaveKey(prevKey, state.key, result);\n else if (prevKey !== null)\n input.exitKey(prevKey);\n\n return result;\n};\n\nNode.prototype._decodeGeneric = function decodeGeneric(tag, input, options) {\n var state = this._baseState;\n\n if (tag === 'seq' || tag === 'set')\n return null;\n if (tag === 'seqof' || tag === 'setof')\n return this._decodeList(input, tag, state.args[0], options);\n else if (/str$/.test(tag))\n return this._decodeStr(input, tag, options);\n else if (tag === 'objid' && state.args)\n return this._decodeObjid(input, state.args[0], state.args[1], options);\n else if (tag === 'objid')\n return this._decodeObjid(input, null, null, options);\n else if (tag === 'gentime' || tag === 'utctime')\n return this._decodeTime(input, tag, options);\n else if (tag === 'null_')\n return this._decodeNull(input, options);\n else if (tag === 'bool')\n return this._decodeBool(input, options);\n else if (tag === 'objDesc')\n return this._decodeStr(input, tag, options);\n else if (tag === 'int' || tag === 'enum')\n return this._decodeInt(input, state.args && state.args[0], options);\n\n if (state.use !== null) {\n return this._getUse(state.use, input._reporterState.obj)\n ._decode(input, options);\n } else {\n return input.error('unknown tag: ' + tag);\n }\n};\n\nNode.prototype._getUse = function _getUse(entity, obj) {\n\n var state = this._baseState;\n // Create altered use decoder if implicit is set\n state.useDecoder = this._use(entity, obj);\n assert(state.useDecoder._baseState.parent === null);\n state.useDecoder = state.useDecoder._baseState.children[0];\n if (state.implicit !== state.useDecoder._baseState.implicit) {\n state.useDecoder = state.useDecoder.clone();\n state.useDecoder._baseState.implicit = state.implicit;\n }\n return state.useDecoder;\n};\n\nNode.prototype._decodeChoice = function decodeChoice(input, options) {\n var state = this._baseState;\n var result = null;\n var match = false;\n\n Object.keys(state.choice).some(function(key) {\n var save = input.save();\n var node = state.choice[key];\n try {\n var value = node._decode(input, options);\n if (input.isError(value))\n return false;\n\n result = { type: key, value: value };\n match = true;\n } catch (e) {\n input.restore(save);\n return false;\n }\n return true;\n }, this);\n\n if (!match)\n return input.error('Choice not matched');\n\n return result;\n};\n\n//\n// Encoding\n//\n\nNode.prototype._createEncoderBuffer = function createEncoderBuffer(data) {\n return new EncoderBuffer(data, this.reporter);\n};\n\nNode.prototype._encode = function encode(data, reporter, parent) {\n var state = this._baseState;\n if (state['default'] !== null && state['default'] === data)\n return;\n\n var result = this._encodeValue(data, reporter, parent);\n if (result === undefined)\n return;\n\n if (this._skipDefault(result, reporter, parent))\n return;\n\n return result;\n};\n\nNode.prototype._encodeValue = function encode(data, reporter, parent) {\n var state = this._baseState;\n\n // Decode root node\n if (state.parent === null)\n return state.children[0]._encode(data, reporter || new Reporter());\n\n var result = null;\n\n // Set reporter to share it with a child class\n this.reporter = reporter;\n\n // Check if data is there\n if (state.optional && data === undefined) {\n if (state['default'] !== null)\n data = state['default']\n else\n return;\n }\n\n // Encode children first\n var content = null;\n var primitive = false;\n if (state.any) {\n // Anything that was given is translated to buffer\n result = this._createEncoderBuffer(data);\n } else if (state.choice) {\n result = this._encodeChoice(data, reporter);\n } else if (state.contains) {\n content = this._getUse(state.contains, parent)._encode(data, reporter);\n primitive = true;\n } else if (state.children) {\n content = state.children.map(function(child) {\n if (child._baseState.tag === 'null_')\n return child._encode(null, reporter, data);\n\n if (child._baseState.key === null)\n return reporter.error('Child should have a key');\n var prevKey = reporter.enterKey(child._baseState.key);\n\n if (typeof data !== 'object')\n return reporter.error('Child expected, but input is not object');\n\n var res = child._encode(data[child._baseState.key], reporter, data);\n reporter.leaveKey(prevKey);\n\n return res;\n }, this).filter(function(child) {\n return child;\n });\n content = this._createEncoderBuffer(content);\n } else {\n if (state.tag === 'seqof' || state.tag === 'setof') {\n // TODO(indutny): this should be thrown on DSL level\n if (!(state.args && state.args.length === 1))\n return reporter.error('Too many args for : ' + state.tag);\n\n if (!Array.isArray(data))\n return reporter.error('seqof/setof, but data is not Array');\n\n var child = this.clone();\n child._baseState.implicit = null;\n content = this._createEncoderBuffer(data.map(function(item) {\n var state = this._baseState;\n\n return this._getUse(state.args[0], data)._encode(item, reporter);\n }, child));\n } else if (state.use !== null) {\n result = this._getUse(state.use, parent)._encode(data, reporter);\n } else {\n content = this._encodePrimitive(state.tag, data);\n primitive = true;\n }\n }\n\n // Encode data itself\n var result;\n if (!state.any && state.choice === null) {\n var tag = state.implicit !== null ? state.implicit : state.tag;\n var cls = state.implicit === null ? 'universal' : 'context';\n\n if (tag === null) {\n if (state.use === null)\n reporter.error('Tag could be omitted only for .use()');\n } else {\n if (state.use === null)\n result = this._encodeComposite(tag, primitive, cls, content);\n }\n }\n\n // Wrap in explicit\n if (state.explicit !== null)\n result = this._encodeComposite(state.explicit, false, 'context', result);\n\n return result;\n};\n\nNode.prototype._encodeChoice = function encodeChoice(data, reporter) {\n var state = this._baseState;\n\n var node = state.choice[data.type];\n if (!node) {\n assert(\n false,\n data.type + ' not found in ' +\n JSON.stringify(Object.keys(state.choice)));\n }\n return node._encode(data.value, reporter);\n};\n\nNode.prototype._encodePrimitive = function encodePrimitive(tag, data) {\n var state = this._baseState;\n\n if (/str$/.test(tag))\n return this._encodeStr(data, tag);\n else if (tag === 'objid' && state.args)\n return this._encodeObjid(data, state.reverseArgs[0], state.args[1]);\n else if (tag === 'objid')\n return this._encodeObjid(data, null, null);\n else if (tag === 'gentime' || tag === 'utctime')\n return this._encodeTime(data, tag);\n else if (tag === 'null_')\n return this._encodeNull();\n else if (tag === 'int' || tag === 'enum')\n return this._encodeInt(data, state.args && state.reverseArgs[0]);\n else if (tag === 'bool')\n return this._encodeBool(data);\n else if (tag === 'objDesc')\n return this._encodeStr(data, tag);\n else\n throw new Error('Unsupported tag: ' + tag);\n};\n\nNode.prototype._isNumstr = function isNumstr(str) {\n return /^[0-9 ]*$/.test(str);\n};\n\nNode.prototype._isPrintstr = function isPrintstr(str) {\n return /^[A-Za-z0-9 '\\(\\)\\+,\\-\\.\\/:=\\?]*$/.test(str);\n};\n","var inherits = require('inherits');\n\nfunction Reporter(options) {\n this._reporterState = {\n obj: null,\n path: [],\n options: options || {},\n errors: []\n };\n}\nexports.Reporter = Reporter;\n\nReporter.prototype.isError = function isError(obj) {\n return obj instanceof ReporterError;\n};\n\nReporter.prototype.save = function save() {\n var state = this._reporterState;\n\n return { obj: state.obj, pathLen: state.path.length };\n};\n\nReporter.prototype.restore = function restore(data) {\n var state = this._reporterState;\n\n state.obj = data.obj;\n state.path = state.path.slice(0, data.pathLen);\n};\n\nReporter.prototype.enterKey = function enterKey(key) {\n return this._reporterState.path.push(key);\n};\n\nReporter.prototype.exitKey = function exitKey(index) {\n var state = this._reporterState;\n\n state.path = state.path.slice(0, index - 1);\n};\n\nReporter.prototype.leaveKey = function leaveKey(index, key, value) {\n var state = this._reporterState;\n\n this.exitKey(index);\n if (state.obj !== null)\n state.obj[key] = value;\n};\n\nReporter.prototype.path = function path() {\n return this._reporterState.path.join('/');\n};\n\nReporter.prototype.enterObject = function enterObject() {\n var state = this._reporterState;\n\n var prev = state.obj;\n state.obj = {};\n return prev;\n};\n\nReporter.prototype.leaveObject = function leaveObject(prev) {\n var state = this._reporterState;\n\n var now = state.obj;\n state.obj = prev;\n return now;\n};\n\nReporter.prototype.error = function error(msg) {\n var err;\n var state = this._reporterState;\n\n var inherited = msg instanceof ReporterError;\n if (inherited) {\n err = msg;\n } else {\n err = new ReporterError(state.path.map(function(elem) {\n return '[' + JSON.stringify(elem) + ']';\n }).join(''), msg.message || msg, msg.stack);\n }\n\n if (!state.options.partial)\n throw err;\n\n if (!inherited)\n state.errors.push(err);\n\n return err;\n};\n\nReporter.prototype.wrapResult = function wrapResult(result) {\n var state = this._reporterState;\n if (!state.options.partial)\n return result;\n\n return {\n result: this.isError(result) ? null : result,\n errors: state.errors\n };\n};\n\nfunction ReporterError(path, msg) {\n this.path = path;\n this.rethrow(msg);\n};\ninherits(ReporterError, Error);\n\nReporterError.prototype.rethrow = function rethrow(msg) {\n this.message = msg + ' at: ' + (this.path || '(shallow)');\n if (Error.captureStackTrace)\n Error.captureStackTrace(this, ReporterError);\n\n if (!this.stack) {\n try {\n // IE only adds stack when thrown\n throw new Error(this.message);\n } catch (e) {\n this.stack = e.stack;\n }\n }\n return this;\n};\n","var constants = require('../constants');\n\nexports.tagClass = {\n 0: 'universal',\n 1: 'application',\n 2: 'context',\n 3: 'private'\n};\nexports.tagClassByName = constants._reverse(exports.tagClass);\n\nexports.tag = {\n 0x00: 'end',\n 0x01: 'bool',\n 0x02: 'int',\n 0x03: 'bitstr',\n 0x04: 'octstr',\n 0x05: 'null_',\n 0x06: 'objid',\n 0x07: 'objDesc',\n 0x08: 'external',\n 0x09: 'real',\n 0x0a: 'enum',\n 0x0b: 'embed',\n 0x0c: 'utf8str',\n 0x0d: 'relativeOid',\n 0x10: 'seq',\n 0x11: 'set',\n 0x12: 'numstr',\n 0x13: 'printstr',\n 0x14: 't61str',\n 0x15: 'videostr',\n 0x16: 'ia5str',\n 0x17: 'utctime',\n 0x18: 'gentime',\n 0x19: 'graphstr',\n 0x1a: 'iso646str',\n 0x1b: 'genstr',\n 0x1c: 'unistr',\n 0x1d: 'charstr',\n 0x1e: 'bmpstr'\n};\nexports.tagByName = constants._reverse(exports.tag);\n","var constants = exports;\n\n// Helper\nconstants._reverse = function reverse(map) {\n var res = {};\n\n Object.keys(map).forEach(function(key) {\n // Convert key to integer if it is stringified\n if ((key | 0) == key)\n key = key | 0;\n\n var value = map[key];\n res[value] = key;\n });\n\n return res;\n};\n\nconstants.der = require('./der');\n","var inherits = require('inherits');\n\nvar asn1 = require('../../asn1');\nvar base = asn1.base;\nvar bignum = asn1.bignum;\n\n// Import DER constants\nvar der = asn1.constants.der;\n\nfunction DERDecoder(entity) {\n this.enc = 'der';\n this.name = entity.name;\n this.entity = entity;\n\n // Construct base tree\n this.tree = new DERNode();\n this.tree._init(entity.body);\n};\nmodule.exports = DERDecoder;\n\nDERDecoder.prototype.decode = function decode(data, options) {\n if (!(data instanceof base.DecoderBuffer))\n data = new base.DecoderBuffer(data, options);\n\n return this.tree._decode(data, options);\n};\n\n// Tree methods\n\nfunction DERNode(parent) {\n base.Node.call(this, 'der', parent);\n}\ninherits(DERNode, base.Node);\n\nDERNode.prototype._peekTag = function peekTag(buffer, tag, any) {\n if (buffer.isEmpty())\n return false;\n\n var state = buffer.save();\n var decodedTag = derDecodeTag(buffer, 'Failed to peek tag: \"' + tag + '\"');\n if (buffer.isError(decodedTag))\n return decodedTag;\n\n buffer.restore(state);\n\n return decodedTag.tag === tag || decodedTag.tagStr === tag ||\n (decodedTag.tagStr + 'of') === tag || any;\n};\n\nDERNode.prototype._decodeTag = function decodeTag(buffer, tag, any) {\n var decodedTag = derDecodeTag(buffer,\n 'Failed to decode tag of \"' + tag + '\"');\n if (buffer.isError(decodedTag))\n return decodedTag;\n\n var len = derDecodeLen(buffer,\n decodedTag.primitive,\n 'Failed to get length of \"' + tag + '\"');\n\n // Failure\n if (buffer.isError(len))\n return len;\n\n if (!any &&\n decodedTag.tag !== tag &&\n decodedTag.tagStr !== tag &&\n decodedTag.tagStr + 'of' !== tag) {\n return buffer.error('Failed to match tag: \"' + tag + '\"');\n }\n\n if (decodedTag.primitive || len !== null)\n return buffer.skip(len, 'Failed to match body of: \"' + tag + '\"');\n\n // Indefinite length... find END tag\n var state = buffer.save();\n var res = this._skipUntilEnd(\n buffer,\n 'Failed to skip indefinite length body: \"' + this.tag + '\"');\n if (buffer.isError(res))\n return res;\n\n len = buffer.offset - state.offset;\n buffer.restore(state);\n return buffer.skip(len, 'Failed to match body of: \"' + tag + '\"');\n};\n\nDERNode.prototype._skipUntilEnd = function skipUntilEnd(buffer, fail) {\n while (true) {\n var tag = derDecodeTag(buffer, fail);\n if (buffer.isError(tag))\n return tag;\n var len = derDecodeLen(buffer, tag.primitive, fail);\n if (buffer.isError(len))\n return len;\n\n var res;\n if (tag.primitive || len !== null)\n res = buffer.skip(len)\n else\n res = this._skipUntilEnd(buffer, fail);\n\n // Failure\n if (buffer.isError(res))\n return res;\n\n if (tag.tagStr === 'end')\n break;\n }\n};\n\nDERNode.prototype._decodeList = function decodeList(buffer, tag, decoder,\n options) {\n var result = [];\n while (!buffer.isEmpty()) {\n var possibleEnd = this._peekTag(buffer, 'end');\n if (buffer.isError(possibleEnd))\n return possibleEnd;\n\n var res = decoder.decode(buffer, 'der', options);\n if (buffer.isError(res) && possibleEnd)\n break;\n result.push(res);\n }\n return result;\n};\n\nDERNode.prototype._decodeStr = function decodeStr(buffer, tag) {\n if (tag === 'bitstr') {\n var unused = buffer.readUInt8();\n if (buffer.isError(unused))\n return unused;\n return { unused: unused, data: buffer.raw() };\n } else if (tag === 'bmpstr') {\n var raw = buffer.raw();\n if (raw.length % 2 === 1)\n return buffer.error('Decoding of string type: bmpstr length mismatch');\n\n var str = '';\n for (var i = 0; i < raw.length / 2; i++) {\n str += String.fromCharCode(raw.readUInt16BE(i * 2));\n }\n return str;\n } else if (tag === 'numstr') {\n var numstr = buffer.raw().toString('ascii');\n if (!this._isNumstr(numstr)) {\n return buffer.error('Decoding of string type: ' +\n 'numstr unsupported characters');\n }\n return numstr;\n } else if (tag === 'octstr') {\n return buffer.raw();\n } else if (tag === 'objDesc') {\n return buffer.raw();\n } else if (tag === 'printstr') {\n var printstr = buffer.raw().toString('ascii');\n if (!this._isPrintstr(printstr)) {\n return buffer.error('Decoding of string type: ' +\n 'printstr unsupported characters');\n }\n return printstr;\n } else if (/str$/.test(tag)) {\n return buffer.raw().toString();\n } else {\n return buffer.error('Decoding of string type: ' + tag + ' unsupported');\n }\n};\n\nDERNode.prototype._decodeObjid = function decodeObjid(buffer, values, relative) {\n var result;\n var identifiers = [];\n var ident = 0;\n while (!buffer.isEmpty()) {\n var subident = buffer.readUInt8();\n ident <<= 7;\n ident |= subident & 0x7f;\n if ((subident & 0x80) === 0) {\n identifiers.push(ident);\n ident = 0;\n }\n }\n if (subident & 0x80)\n identifiers.push(ident);\n\n var first = (identifiers[0] / 40) | 0;\n var second = identifiers[0] % 40;\n\n if (relative)\n result = identifiers;\n else\n result = [first, second].concat(identifiers.slice(1));\n\n if (values) {\n var tmp = values[result.join(' ')];\n if (tmp === undefined)\n tmp = values[result.join('.')];\n if (tmp !== undefined)\n result = tmp;\n }\n\n return result;\n};\n\nDERNode.prototype._decodeTime = function decodeTime(buffer, tag) {\n var str = buffer.raw().toString();\n if (tag === 'gentime') {\n var year = str.slice(0, 4) | 0;\n var mon = str.slice(4, 6) | 0;\n var day = str.slice(6, 8) | 0;\n var hour = str.slice(8, 10) | 0;\n var min = str.slice(10, 12) | 0;\n var sec = str.slice(12, 14) | 0;\n } else if (tag === 'utctime') {\n var year = str.slice(0, 2) | 0;\n var mon = str.slice(2, 4) | 0;\n var day = str.slice(4, 6) | 0;\n var hour = str.slice(6, 8) | 0;\n var min = str.slice(8, 10) | 0;\n var sec = str.slice(10, 12) | 0;\n if (year < 70)\n year = 2000 + year;\n else\n year = 1900 + year;\n } else {\n return buffer.error('Decoding ' + tag + ' time is not supported yet');\n }\n\n return Date.UTC(year, mon - 1, day, hour, min, sec, 0);\n};\n\nDERNode.prototype._decodeNull = function decodeNull(buffer) {\n return null;\n};\n\nDERNode.prototype._decodeBool = function decodeBool(buffer) {\n var res = buffer.readUInt8();\n if (buffer.isError(res))\n return res;\n else\n return res !== 0;\n};\n\nDERNode.prototype._decodeInt = function decodeInt(buffer, values) {\n // Bigint, return as it is (assume big endian)\n var raw = buffer.raw();\n var res = new bignum(raw);\n\n if (values)\n res = values[res.toString(10)] || res;\n\n return res;\n};\n\nDERNode.prototype._use = function use(entity, obj) {\n if (typeof entity === 'function')\n entity = entity(obj);\n return entity._getDecoder('der').tree;\n};\n\n// Utility methods\n\nfunction derDecodeTag(buf, fail) {\n var tag = buf.readUInt8(fail);\n if (buf.isError(tag))\n return tag;\n\n var cls = der.tagClass[tag >> 6];\n var primitive = (tag & 0x20) === 0;\n\n // Multi-octet tag - load\n if ((tag & 0x1f) === 0x1f) {\n var oct = tag;\n tag = 0;\n while ((oct & 0x80) === 0x80) {\n oct = buf.readUInt8(fail);\n if (buf.isError(oct))\n return oct;\n\n tag <<= 7;\n tag |= oct & 0x7f;\n }\n } else {\n tag &= 0x1f;\n }\n var tagStr = der.tag[tag];\n\n return {\n cls: cls,\n primitive: primitive,\n tag: tag,\n tagStr: tagStr\n };\n}\n\nfunction derDecodeLen(buf, primitive, fail) {\n var len = buf.readUInt8(fail);\n if (buf.isError(len))\n return len;\n\n // Indefinite form\n if (!primitive && len === 0x80)\n return null;\n\n // Definite form\n if ((len & 0x80) === 0) {\n // Short form\n return len;\n }\n\n // Long form\n var num = len & 0x7f;\n if (num > 4)\n return buf.error('length octect is too long');\n\n len = 0;\n for (var i = 0; i < num; i++) {\n len <<= 8;\n var j = buf.readUInt8(fail);\n if (buf.isError(j))\n return j;\n len |= j;\n }\n\n return len;\n}\n","var decoders = exports;\n\ndecoders.der = require('./der');\ndecoders.pem = require('./pem');\n","var inherits = require('inherits');\nvar Buffer = require('buffer').Buffer;\n\nvar DERDecoder = require('./der');\n\nfunction PEMDecoder(entity) {\n DERDecoder.call(this, entity);\n this.enc = 'pem';\n};\ninherits(PEMDecoder, DERDecoder);\nmodule.exports = PEMDecoder;\n\nPEMDecoder.prototype.decode = function decode(data, options) {\n var lines = data.toString().split(/[\\r\\n]+/g);\n\n var label = options.label.toUpperCase();\n\n var re = /^-----(BEGIN|END) ([^-]+)-----$/;\n var start = -1;\n var end = -1;\n for (var i = 0; i < lines.length; i++) {\n var match = lines[i].match(re);\n if (match === null)\n continue;\n\n if (match[2] !== label)\n continue;\n\n if (start === -1) {\n if (match[1] !== 'BEGIN')\n break;\n start = i;\n } else {\n if (match[1] !== 'END')\n break;\n end = i;\n break;\n }\n }\n if (start === -1 || end === -1)\n throw new Error('PEM section not found for: ' + label);\n\n var base64 = lines.slice(start + 1, end).join('');\n // Remove excessive symbols\n base64.replace(/[^a-z0-9\\+\\/=]+/gi, '');\n\n var input = new Buffer(base64, 'base64');\n return DERDecoder.prototype.decode.call(this, input, options);\n};\n","var inherits = require('inherits');\nvar Buffer = require('buffer').Buffer;\n\nvar asn1 = require('../../asn1');\nvar base = asn1.base;\n\n// Import DER constants\nvar der = asn1.constants.der;\n\nfunction DEREncoder(entity) {\n this.enc = 'der';\n this.name = entity.name;\n this.entity = entity;\n\n // Construct base tree\n this.tree = new DERNode();\n this.tree._init(entity.body);\n};\nmodule.exports = DEREncoder;\n\nDEREncoder.prototype.encode = function encode(data, reporter) {\n return this.tree._encode(data, reporter).join();\n};\n\n// Tree methods\n\nfunction DERNode(parent) {\n base.Node.call(this, 'der', parent);\n}\ninherits(DERNode, base.Node);\n\nDERNode.prototype._encodeComposite = function encodeComposite(tag,\n primitive,\n cls,\n content) {\n var encodedTag = encodeTag(tag, primitive, cls, this.reporter);\n\n // Short form\n if (content.length < 0x80) {\n var header = new Buffer(2);\n header[0] = encodedTag;\n header[1] = content.length;\n return this._createEncoderBuffer([ header, content ]);\n }\n\n // Long form\n // Count octets required to store length\n var lenOctets = 1;\n for (var i = content.length; i >= 0x100; i >>= 8)\n lenOctets++;\n\n var header = new Buffer(1 + 1 + lenOctets);\n header[0] = encodedTag;\n header[1] = 0x80 | lenOctets;\n\n for (var i = 1 + lenOctets, j = content.length; j > 0; i--, j >>= 8)\n header[i] = j & 0xff;\n\n return this._createEncoderBuffer([ header, content ]);\n};\n\nDERNode.prototype._encodeStr = function encodeStr(str, tag) {\n if (tag === 'bitstr') {\n return this._createEncoderBuffer([ str.unused | 0, str.data ]);\n } else if (tag === 'bmpstr') {\n var buf = new Buffer(str.length * 2);\n for (var i = 0; i < str.length; i++) {\n buf.writeUInt16BE(str.charCodeAt(i), i * 2);\n }\n return this._createEncoderBuffer(buf);\n } else if (tag === 'numstr') {\n if (!this._isNumstr(str)) {\n return this.reporter.error('Encoding of string type: numstr supports ' +\n 'only digits and space');\n }\n return this._createEncoderBuffer(str);\n } else if (tag === 'printstr') {\n if (!this._isPrintstr(str)) {\n return this.reporter.error('Encoding of string type: printstr supports ' +\n 'only latin upper and lower case letters, ' +\n 'digits, space, apostrophe, left and rigth ' +\n 'parenthesis, plus sign, comma, hyphen, ' +\n 'dot, slash, colon, equal sign, ' +\n 'question mark');\n }\n return this._createEncoderBuffer(str);\n } else if (/str$/.test(tag)) {\n return this._createEncoderBuffer(str);\n } else if (tag === 'objDesc') {\n return this._createEncoderBuffer(str);\n } else {\n return this.reporter.error('Encoding of string type: ' + tag +\n ' unsupported');\n }\n};\n\nDERNode.prototype._encodeObjid = function encodeObjid(id, values, relative) {\n if (typeof id === 'string') {\n if (!values)\n return this.reporter.error('string objid given, but no values map found');\n if (!values.hasOwnProperty(id))\n return this.reporter.error('objid not found in values map');\n id = values[id].split(/[\\s\\.]+/g);\n for (var i = 0; i < id.length; i++)\n id[i] |= 0;\n } else if (Array.isArray(id)) {\n id = id.slice();\n for (var i = 0; i < id.length; i++)\n id[i] |= 0;\n }\n\n if (!Array.isArray(id)) {\n return this.reporter.error('objid() should be either array or string, ' +\n 'got: ' + JSON.stringify(id));\n }\n\n if (!relative) {\n if (id[1] >= 40)\n return this.reporter.error('Second objid identifier OOB');\n id.splice(0, 2, id[0] * 40 + id[1]);\n }\n\n // Count number of octets\n var size = 0;\n for (var i = 0; i < id.length; i++) {\n var ident = id[i];\n for (size++; ident >= 0x80; ident >>= 7)\n size++;\n }\n\n var objid = new Buffer(size);\n var offset = objid.length - 1;\n for (var i = id.length - 1; i >= 0; i--) {\n var ident = id[i];\n objid[offset--] = ident & 0x7f;\n while ((ident >>= 7) > 0)\n objid[offset--] = 0x80 | (ident & 0x7f);\n }\n\n return this._createEncoderBuffer(objid);\n};\n\nfunction two(num) {\n if (num < 10)\n return '0' + num;\n else\n return num;\n}\n\nDERNode.prototype._encodeTime = function encodeTime(time, tag) {\n var str;\n var date = new Date(time);\n\n if (tag === 'gentime') {\n str = [\n two(date.getFullYear()),\n two(date.getUTCMonth() + 1),\n two(date.getUTCDate()),\n two(date.getUTCHours()),\n two(date.getUTCMinutes()),\n two(date.getUTCSeconds()),\n 'Z'\n ].join('');\n } else if (tag === 'utctime') {\n str = [\n two(date.getFullYear() % 100),\n two(date.getUTCMonth() + 1),\n two(date.getUTCDate()),\n two(date.getUTCHours()),\n two(date.getUTCMinutes()),\n two(date.getUTCSeconds()),\n 'Z'\n ].join('');\n } else {\n this.reporter.error('Encoding ' + tag + ' time is not supported yet');\n }\n\n return this._encodeStr(str, 'octstr');\n};\n\nDERNode.prototype._encodeNull = function encodeNull() {\n return this._createEncoderBuffer('');\n};\n\nDERNode.prototype._encodeInt = function encodeInt(num, values) {\n if (typeof num === 'string') {\n if (!values)\n return this.reporter.error('String int or enum given, but no values map');\n if (!values.hasOwnProperty(num)) {\n return this.reporter.error('Values map doesn\\'t contain: ' +\n JSON.stringify(num));\n }\n num = values[num];\n }\n\n // Bignum, assume big endian\n if (typeof num !== 'number' && !Buffer.isBuffer(num)) {\n var numArray = num.toArray();\n if (!num.sign && numArray[0] & 0x80) {\n numArray.unshift(0);\n }\n num = new Buffer(numArray);\n }\n\n if (Buffer.isBuffer(num)) {\n var size = num.length;\n if (num.length === 0)\n size++;\n\n var out = new Buffer(size);\n num.copy(out);\n if (num.length === 0)\n out[0] = 0\n return this._createEncoderBuffer(out);\n }\n\n if (num < 0x80)\n return this._createEncoderBuffer(num);\n\n if (num < 0x100)\n return this._createEncoderBuffer([0, num]);\n\n var size = 1;\n for (var i = num; i >= 0x100; i >>= 8)\n size++;\n\n var out = new Array(size);\n for (var i = out.length - 1; i >= 0; i--) {\n out[i] = num & 0xff;\n num >>= 8;\n }\n if(out[0] & 0x80) {\n out.unshift(0);\n }\n\n return this._createEncoderBuffer(new Buffer(out));\n};\n\nDERNode.prototype._encodeBool = function encodeBool(value) {\n return this._createEncoderBuffer(value ? 0xff : 0);\n};\n\nDERNode.prototype._use = function use(entity, obj) {\n if (typeof entity === 'function')\n entity = entity(obj);\n return entity._getEncoder('der').tree;\n};\n\nDERNode.prototype._skipDefault = function skipDefault(dataBuffer, reporter, parent) {\n var state = this._baseState;\n var i;\n if (state['default'] === null)\n return false;\n\n var data = dataBuffer.join();\n if (state.defaultBuffer === undefined)\n state.defaultBuffer = this._encodeValue(state['default'], reporter, parent).join();\n\n if (data.length !== state.defaultBuffer.length)\n return false;\n\n for (i=0; i < data.length; i++)\n if (data[i] !== state.defaultBuffer[i])\n return false;\n\n return true;\n};\n\n// Utility methods\n\nfunction encodeTag(tag, primitive, cls, reporter) {\n var res;\n\n if (tag === 'seqof')\n tag = 'seq';\n else if (tag === 'setof')\n tag = 'set';\n\n if (der.tagByName.hasOwnProperty(tag))\n res = der.tagByName[tag];\n else if (typeof tag === 'number' && (tag | 0) === tag)\n res = tag;\n else\n return reporter.error('Unknown tag: ' + tag);\n\n if (res >= 0x1f)\n return reporter.error('Multi-octet tag encoding unsupported');\n\n if (!primitive)\n res |= 0x20;\n\n res |= (der.tagClassByName[cls || 'universal'] << 6);\n\n return res;\n}\n","var encoders = exports;\n\nencoders.der = require('./der');\nencoders.pem = require('./pem');\n","var inherits = require('inherits');\n\nvar DEREncoder = require('./der');\n\nfunction PEMEncoder(entity) {\n DEREncoder.call(this, entity);\n this.enc = 'pem';\n};\ninherits(PEMEncoder, DEREncoder);\nmodule.exports = PEMEncoder;\n\nPEMEncoder.prototype.encode = function encode(data, options) {\n var buf = DEREncoder.prototype.encode.call(this, data);\n\n var p = buf.toString('base64');\n var out = [ '-----BEGIN ' + options.label + '-----' ];\n for (var i = 0; i < p.length; i += 64)\n out.push(p.slice(i, i + 64));\n out.push('-----END ' + options.label + '-----');\n return out.join('\\n');\n};\n","module.exports = { \"default\": require(\"core-js/library/fn/array/from\"), __esModule: true };","module.exports = { \"default\": require(\"core-js/library/fn/map\"), __esModule: true };","module.exports = { \"default\": require(\"core-js/library/fn/number/is-nan\"), __esModule: true };","module.exports = { \"default\": require(\"core-js/library/fn/number/min-safe-integer\"), __esModule: true };","module.exports = { \"default\": require(\"core-js/library/fn/object/assign\"), __esModule: true };","module.exports = { \"default\": require(\"core-js/library/fn/object/create\"), __esModule: true };","module.exports = { \"default\": require(\"core-js/library/fn/object/define-property\"), __esModule: true };","module.exports = { \"default\": require(\"core-js/library/fn/object/get-prototype-of\"), __esModule: true };","module.exports = { \"default\": require(\"core-js/library/fn/object/keys\"), __esModule: true };","module.exports = { \"default\": require(\"core-js/library/fn/object/set-prototype-of\"), __esModule: true };","module.exports = { \"default\": require(\"core-js/library/fn/symbol\"), __esModule: true };","module.exports = { \"default\": require(\"core-js/library/fn/symbol/iterator\"), __esModule: true };","\"use strict\";\n\nexports.__esModule = true;\n\nexports.default = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};","\"use strict\";\n\nexports.__esModule = true;\n\nvar _defineProperty = require(\"../core-js/object/define-property\");\n\nvar _defineProperty2 = _interopRequireDefault(_defineProperty);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n (0, _defineProperty2.default)(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();","\"use strict\";\n\nexports.__esModule = true;\n\nvar _defineProperty = require(\"../core-js/object/define-property\");\n\nvar _defineProperty2 = _interopRequireDefault(_defineProperty);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (obj, key, value) {\n if (key in obj) {\n (0, _defineProperty2.default)(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n};","\"use strict\";\n\nexports.__esModule = true;\n\nvar _assign = require(\"../core-js/object/assign\");\n\nvar _assign2 = _interopRequireDefault(_assign);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = _assign2.default || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};","\"use strict\";\n\nexports.__esModule = true;\n\nvar _setPrototypeOf = require(\"../core-js/object/set-prototype-of\");\n\nvar _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf);\n\nvar _create = require(\"../core-js/object/create\");\n\nvar _create2 = _interopRequireDefault(_create);\n\nvar _typeof2 = require(\"../helpers/typeof\");\n\nvar _typeof3 = _interopRequireDefault(_typeof2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + (typeof superClass === \"undefined\" ? \"undefined\" : (0, _typeof3.default)(superClass)));\n }\n\n subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass;\n};","\"use strict\";\n\nexports.__esModule = true;\n\nexports.default = function (obj, keys) {\n var target = {};\n\n for (var i in obj) {\n if (keys.indexOf(i) >= 0) continue;\n if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;\n target[i] = obj[i];\n }\n\n return target;\n};","\"use strict\";\n\nexports.__esModule = true;\n\nvar _typeof2 = require(\"../helpers/typeof\");\n\nvar _typeof3 = _interopRequireDefault(_typeof2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && ((typeof call === \"undefined\" ? \"undefined\" : (0, _typeof3.default)(call)) === \"object\" || typeof call === \"function\") ? call : self;\n};","\"use strict\";\n\nexports.__esModule = true;\n\nvar _from = require(\"../core-js/array/from\");\n\nvar _from2 = _interopRequireDefault(_from);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n } else {\n return (0, _from2.default)(arr);\n }\n};","\"use strict\";\n\nexports.__esModule = true;\n\nvar _iterator = require(\"../core-js/symbol/iterator\");\n\nvar _iterator2 = _interopRequireDefault(_iterator);\n\nvar _symbol = require(\"../core-js/symbol\");\n\nvar _symbol2 = _interopRequireDefault(_symbol);\n\nvar _typeof = typeof _symbol2.default === \"function\" && typeof _iterator2.default === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === \"function\" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? \"symbol\" : typeof obj; };\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = typeof _symbol2.default === \"function\" && _typeof(_iterator2.default) === \"symbol\" ? function (obj) {\n return typeof obj === \"undefined\" ? \"undefined\" : _typeof(obj);\n} : function (obj) {\n return obj && typeof _symbol2.default === \"function\" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? \"symbol\" : typeof obj === \"undefined\" ? \"undefined\" : _typeof(obj);\n};","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction placeHoldersCount (b64) {\n var len = b64.length\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // the number of equal signs (place holders)\n // if there are two placeholders, than the two characters before it\n // represent one byte\n // if there is only one, then the three characters before it represent 2 bytes\n // this is just a cheap hack to not do indexOf twice\n return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0\n}\n\nfunction byteLength (b64) {\n // base64 is 4/3 + up to two characters of the original data\n return (b64.length * 3 / 4) - placeHoldersCount(b64)\n}\n\nfunction toByteArray (b64) {\n var i, l, tmp, placeHolders, arr\n var len = b64.length\n placeHolders = placeHoldersCount(b64)\n\n arr = new Arr((len * 3 / 4) - placeHolders)\n\n // if there are placeholders, only get up to the last complete 4 chars\n l = placeHolders > 0 ? len - 4 : len\n\n var L = 0\n\n for (i = 0; i < l; i += 4) {\n tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]\n arr[L++] = (tmp >> 16) & 0xFF\n arr[L++] = (tmp >> 8) & 0xFF\n arr[L++] = tmp & 0xFF\n }\n\n if (placeHolders === 2) {\n tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[L++] = tmp & 0xFF\n } else if (placeHolders === 1) {\n tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[L++] = (tmp >> 8) & 0xFF\n arr[L++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp = ((uint8[i] << 16) & 0xFF0000) + ((uint8[i + 1] << 8) & 0xFF00) + (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var output = ''\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n output += lookup[tmp >> 2]\n output += lookup[(tmp << 4) & 0x3F]\n output += '=='\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + (uint8[len - 1])\n output += lookup[tmp >> 10]\n output += lookup[(tmp >> 4) & 0x3F]\n output += lookup[(tmp << 2) & 0x3F]\n output += '='\n }\n\n parts.push(output)\n\n return parts.join('')\n}\n","/*! bignumber.js v2.0.7 https://github.com/MikeMcl/bignumber.js/LICENCE */\n\n;(function (global) {\n 'use strict';\n\n /*\n bignumber.js v2.0.7\n A JavaScript library for arbitrary-precision arithmetic.\n https://github.com/MikeMcl/bignumber.js\n Copyright (c) 2015 Michael Mclaughlin \n MIT Expat Licence\n */\n\n\n var BigNumber, crypto, parseNumeric,\n isNumeric = /^-?(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i,\n mathceil = Math.ceil,\n mathfloor = Math.floor,\n notBool = ' not a boolean or binary digit',\n roundingMode = 'rounding mode',\n tooManyDigits = 'number type has more than 15 significant digits',\n ALPHABET = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_',\n BASE = 1e14,\n LOG_BASE = 14,\n MAX_SAFE_INTEGER = 0x1fffffffffffff, // 2^53 - 1\n // MAX_INT32 = 0x7fffffff, // 2^31 - 1\n POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13],\n SQRT_BASE = 1e7,\n\n /*\n * The limit on the value of DECIMAL_PLACES, TO_EXP_NEG, TO_EXP_POS, MIN_EXP, MAX_EXP, and\n * the arguments to toExponential, toFixed, toFormat, and toPrecision, beyond which an\n * exception is thrown (if ERRORS is true).\n */\n MAX = 1E9; // 0 to MAX_INT32\n\n\n /*\n * Create and return a BigNumber constructor.\n */\n function another(configObj) {\n var div,\n\n // id tracks the caller function, so its name can be included in error messages.\n id = 0,\n P = BigNumber.prototype,\n ONE = new BigNumber(1),\n\n\n /********************************* EDITABLE DEFAULTS **********************************/\n\n\n /*\n * The default values below must be integers within the inclusive ranges stated.\n * The values can also be changed at run-time using BigNumber.config.\n */\n\n // The maximum number of decimal places for operations involving division.\n DECIMAL_PLACES = 20, // 0 to MAX\n\n /*\n * The rounding mode used when rounding to the above decimal places, and when using\n * toExponential, toFixed, toFormat and toPrecision, and round (default value).\n * UP 0 Away from zero.\n * DOWN 1 Towards zero.\n * CEIL 2 Towards +Infinity.\n * FLOOR 3 Towards -Infinity.\n * HALF_UP 4 Towards nearest neighbour. If equidistant, up.\n * HALF_DOWN 5 Towards nearest neighbour. If equidistant, down.\n * HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour.\n * HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity.\n * HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity.\n */\n ROUNDING_MODE = 4, // 0 to 8\n\n // EXPONENTIAL_AT : [TO_EXP_NEG , TO_EXP_POS]\n\n // The exponent value at and beneath which toString returns exponential notation.\n // Number type: -7\n TO_EXP_NEG = -7, // 0 to -MAX\n\n // The exponent value at and above which toString returns exponential notation.\n // Number type: 21\n TO_EXP_POS = 21, // 0 to MAX\n\n // RANGE : [MIN_EXP, MAX_EXP]\n\n // The minimum exponent value, beneath which underflow to zero occurs.\n // Number type: -324 (5e-324)\n MIN_EXP = -1e7, // -1 to -MAX\n\n // The maximum exponent value, above which overflow to Infinity occurs.\n // Number type: 308 (1.7976931348623157e+308)\n // For MAX_EXP > 1e7, e.g. new BigNumber('1e100000000').plus(1) may be slow.\n MAX_EXP = 1e7, // 1 to MAX\n\n // Whether BigNumber Errors are ever thrown.\n ERRORS = true, // true or false\n\n // Change to intValidatorNoErrors if ERRORS is false.\n isValidInt = intValidatorWithErrors, // intValidatorWithErrors/intValidatorNoErrors\n\n // Whether to use cryptographically-secure random number generation, if available.\n CRYPTO = false, // true or false\n\n /*\n * The modulo mode used when calculating the modulus: a mod n.\n * The quotient (q = a / n) is calculated according to the corresponding rounding mode.\n * The remainder (r) is calculated as: r = a - n * q.\n *\n * UP 0 The remainder is positive if the dividend is negative, else is negative.\n * DOWN 1 The remainder has the same sign as the dividend.\n * This modulo mode is commonly known as 'truncated division' and is\n * equivalent to (a % n) in JavaScript.\n * FLOOR 3 The remainder has the same sign as the divisor (Python %).\n * HALF_EVEN 6 This modulo mode implements the IEEE 754 remainder function.\n * EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)).\n * The remainder is always positive.\n *\n * The truncated division, floored division, Euclidian division and IEEE 754 remainder\n * modes are commonly used for the modulus operation.\n * Although the other rounding modes can also be used, they may not give useful results.\n */\n MODULO_MODE = 1, // 0 to 9\n\n // The maximum number of significant digits of the result of the toPower operation.\n // If POW_PRECISION is 0, there will be unlimited significant digits.\n POW_PRECISION = 100, // 0 to MAX\n\n // The format specification used by the BigNumber.prototype.toFormat method.\n FORMAT = {\n decimalSeparator: '.',\n groupSeparator: ',',\n groupSize: 3,\n secondaryGroupSize: 0,\n fractionGroupSeparator: '\\xA0', // non-breaking space\n fractionGroupSize: 0\n };\n\n\n /******************************************************************************************/\n\n\n // CONSTRUCTOR\n\n\n /*\n * The BigNumber constructor and exported function.\n * Create and return a new instance of a BigNumber object.\n *\n * n {number|string|BigNumber} A numeric value.\n * [b] {number} The base of n. Integer, 2 to 64 inclusive.\n */\n function BigNumber( n, b ) {\n var c, e, i, num, len, str,\n x = this;\n\n // Enable constructor usage without new.\n if ( !( x instanceof BigNumber ) ) {\n\n // 'BigNumber() constructor call without new: {n}'\n if (ERRORS) raise( 26, 'constructor call without new', n );\n return new BigNumber( n, b );\n }\n\n // 'new BigNumber() base not an integer: {b}'\n // 'new BigNumber() base out of range: {b}'\n if ( b == null || !isValidInt( b, 2, 64, id, 'base' ) ) {\n\n // Duplicate.\n if ( n instanceof BigNumber ) {\n x.s = n.s;\n x.e = n.e;\n x.c = ( n = n.c ) ? n.slice() : n;\n id = 0;\n return;\n }\n\n if ( ( num = typeof n == 'number' ) && n * 0 == 0 ) {\n x.s = 1 / n < 0 ? ( n = -n, -1 ) : 1;\n\n // Fast path for integers.\n if ( n === ~~n ) {\n for ( e = 0, i = n; i >= 10; i /= 10, e++ );\n x.e = e;\n x.c = [n];\n id = 0;\n return;\n }\n\n str = n + '';\n } else {\n if ( !isNumeric.test( str = n + '' ) ) return parseNumeric( x, str, num );\n x.s = str.charCodeAt(0) === 45 ? ( str = str.slice(1), -1 ) : 1;\n }\n } else {\n b = b | 0;\n str = n + '';\n\n // Ensure return value is rounded to DECIMAL_PLACES as with other bases.\n // Allow exponential notation to be used with base 10 argument.\n if ( b == 10 ) {\n x = new BigNumber( n instanceof BigNumber ? n : str );\n return round( x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE );\n }\n\n // Avoid potential interpretation of Infinity and NaN as base 44+ values.\n // Any number in exponential form will fail due to the [Ee][+-].\n if ( ( num = typeof n == 'number' ) && n * 0 != 0 ||\n !( new RegExp( '^-?' + ( c = '[' + ALPHABET.slice( 0, b ) + ']+' ) +\n '(?:\\\\.' + c + ')?$',b < 37 ? 'i' : '' ) ).test(str) ) {\n return parseNumeric( x, str, num, b );\n }\n\n if (num) {\n x.s = 1 / n < 0 ? ( str = str.slice(1), -1 ) : 1;\n\n if ( ERRORS && str.replace( /^0\\.0*|\\./, '' ).length > 15 ) {\n\n // 'new BigNumber() number type has more than 15 significant digits: {n}'\n raise( id, tooManyDigits, n );\n }\n\n // Prevent later check for length on converted number.\n num = false;\n } else {\n x.s = str.charCodeAt(0) === 45 ? ( str = str.slice(1), -1 ) : 1;\n }\n\n str = convertBase( str, 10, b, x.s );\n }\n\n // Decimal point?\n if ( ( e = str.indexOf('.') ) > -1 ) str = str.replace( '.', '' );\n\n // Exponential form?\n if ( ( i = str.search( /e/i ) ) > 0 ) {\n\n // Determine exponent.\n if ( e < 0 ) e = i;\n e += +str.slice( i + 1 );\n str = str.substring( 0, i );\n } else if ( e < 0 ) {\n\n // Integer.\n e = str.length;\n }\n\n // Determine leading zeros.\n for ( i = 0; str.charCodeAt(i) === 48; i++ );\n\n // Determine trailing zeros.\n for ( len = str.length; str.charCodeAt(--len) === 48; );\n str = str.slice( i, len + 1 );\n\n if (str) {\n len = str.length;\n\n // Disallow numbers with over 15 significant digits if number type.\n // 'new BigNumber() number type has more than 15 significant digits: {n}'\n if ( num && ERRORS && len > 15 ) raise( id, tooManyDigits, x.s * n );\n\n e = e - i - 1;\n\n // Overflow?\n if ( e > MAX_EXP ) {\n\n // Infinity.\n x.c = x.e = null;\n\n // Underflow?\n } else if ( e < MIN_EXP ) {\n\n // Zero.\n x.c = [ x.e = 0 ];\n } else {\n x.e = e;\n x.c = [];\n\n // Transform base\n\n // e is the base 10 exponent.\n // i is where to slice str to get the first element of the coefficient array.\n i = ( e + 1 ) % LOG_BASE;\n if ( e < 0 ) i += LOG_BASE;\n\n if ( i < len ) {\n if (i) x.c.push( +str.slice( 0, i ) );\n\n for ( len -= LOG_BASE; i < len; ) {\n x.c.push( +str.slice( i, i += LOG_BASE ) );\n }\n\n str = str.slice(i);\n i = LOG_BASE - str.length;\n } else {\n i -= len;\n }\n\n for ( ; i--; str += '0' );\n x.c.push( +str );\n }\n } else {\n\n // Zero.\n x.c = [ x.e = 0 ];\n }\n\n id = 0;\n }\n\n\n // CONSTRUCTOR PROPERTIES\n\n\n BigNumber.another = another;\n\n BigNumber.ROUND_UP = 0;\n BigNumber.ROUND_DOWN = 1;\n BigNumber.ROUND_CEIL = 2;\n BigNumber.ROUND_FLOOR = 3;\n BigNumber.ROUND_HALF_UP = 4;\n BigNumber.ROUND_HALF_DOWN = 5;\n BigNumber.ROUND_HALF_EVEN = 6;\n BigNumber.ROUND_HALF_CEIL = 7;\n BigNumber.ROUND_HALF_FLOOR = 8;\n BigNumber.EUCLID = 9;\n\n\n /*\n * Configure infrequently-changing library-wide settings.\n *\n * Accept an object or an argument list, with one or many of the following properties or\n * parameters respectively:\n *\n * DECIMAL_PLACES {number} Integer, 0 to MAX inclusive\n * ROUNDING_MODE {number} Integer, 0 to 8 inclusive\n * EXPONENTIAL_AT {number|number[]} Integer, -MAX to MAX inclusive or\n * [integer -MAX to 0 incl., 0 to MAX incl.]\n * RANGE {number|number[]} Non-zero integer, -MAX to MAX inclusive or\n * [integer -MAX to -1 incl., integer 1 to MAX incl.]\n * ERRORS {boolean|number} true, false, 1 or 0\n * CRYPTO {boolean|number} true, false, 1 or 0\n * MODULO_MODE {number} 0 to 9 inclusive\n * POW_PRECISION {number} 0 to MAX inclusive\n * FORMAT {object} See BigNumber.prototype.toFormat\n * decimalSeparator {string}\n * groupSeparator {string}\n * groupSize {number}\n * secondaryGroupSize {number}\n * fractionGroupSeparator {string}\n * fractionGroupSize {number}\n *\n * (The values assigned to the above FORMAT object properties are not checked for validity.)\n *\n * E.g.\n * BigNumber.config(20, 4) is equivalent to\n * BigNumber.config({ DECIMAL_PLACES : 20, ROUNDING_MODE : 4 })\n *\n * Ignore properties/parameters set to null or undefined.\n * Return an object with the properties current values.\n */\n BigNumber.config = function () {\n var v, p,\n i = 0,\n r = {},\n a = arguments,\n o = a[0],\n has = o && typeof o == 'object'\n ? function () { if ( o.hasOwnProperty(p) ) return ( v = o[p] ) != null; }\n : function () { if ( a.length > i ) return ( v = a[i++] ) != null; };\n\n // DECIMAL_PLACES {number} Integer, 0 to MAX inclusive.\n // 'config() DECIMAL_PLACES not an integer: {v}'\n // 'config() DECIMAL_PLACES out of range: {v}'\n if ( has( p = 'DECIMAL_PLACES' ) && isValidInt( v, 0, MAX, 2, p ) ) {\n DECIMAL_PLACES = v | 0;\n }\n r[p] = DECIMAL_PLACES;\n\n // ROUNDING_MODE {number} Integer, 0 to 8 inclusive.\n // 'config() ROUNDING_MODE not an integer: {v}'\n // 'config() ROUNDING_MODE out of range: {v}'\n if ( has( p = 'ROUNDING_MODE' ) && isValidInt( v, 0, 8, 2, p ) ) {\n ROUNDING_MODE = v | 0;\n }\n r[p] = ROUNDING_MODE;\n\n // EXPONENTIAL_AT {number|number[]}\n // Integer, -MAX to MAX inclusive or [integer -MAX to 0 inclusive, 0 to MAX inclusive].\n // 'config() EXPONENTIAL_AT not an integer: {v}'\n // 'config() EXPONENTIAL_AT out of range: {v}'\n if ( has( p = 'EXPONENTIAL_AT' ) ) {\n\n if ( isArray(v) ) {\n if ( isValidInt( v[0], -MAX, 0, 2, p ) && isValidInt( v[1], 0, MAX, 2, p ) ) {\n TO_EXP_NEG = v[0] | 0;\n TO_EXP_POS = v[1] | 0;\n }\n } else if ( isValidInt( v, -MAX, MAX, 2, p ) ) {\n TO_EXP_NEG = -( TO_EXP_POS = ( v < 0 ? -v : v ) | 0 );\n }\n }\n r[p] = [ TO_EXP_NEG, TO_EXP_POS ];\n\n // RANGE {number|number[]} Non-zero integer, -MAX to MAX inclusive or\n // [integer -MAX to -1 inclusive, integer 1 to MAX inclusive].\n // 'config() RANGE not an integer: {v}'\n // 'config() RANGE cannot be zero: {v}'\n // 'config() RANGE out of range: {v}'\n if ( has( p = 'RANGE' ) ) {\n\n if ( isArray(v) ) {\n if ( isValidInt( v[0], -MAX, -1, 2, p ) && isValidInt( v[1], 1, MAX, 2, p ) ) {\n MIN_EXP = v[0] | 0;\n MAX_EXP = v[1] | 0;\n }\n } else if ( isValidInt( v, -MAX, MAX, 2, p ) ) {\n if ( v | 0 ) MIN_EXP = -( MAX_EXP = ( v < 0 ? -v : v ) | 0 );\n else if (ERRORS) raise( 2, p + ' cannot be zero', v );\n }\n }\n r[p] = [ MIN_EXP, MAX_EXP ];\n\n // ERRORS {boolean|number} true, false, 1 or 0.\n // 'config() ERRORS not a boolean or binary digit: {v}'\n if ( has( p = 'ERRORS' ) ) {\n\n if ( v === !!v || v === 1 || v === 0 ) {\n id = 0;\n isValidInt = ( ERRORS = !!v ) ? intValidatorWithErrors : intValidatorNoErrors;\n } else if (ERRORS) {\n raise( 2, p + notBool, v );\n }\n }\n r[p] = ERRORS;\n\n // CRYPTO {boolean|number} true, false, 1 or 0.\n // 'config() CRYPTO not a boolean or binary digit: {v}'\n // 'config() crypto unavailable: {crypto}'\n if ( has( p = 'CRYPTO' ) ) {\n\n if ( v === !!v || v === 1 || v === 0 ) {\n CRYPTO = !!( v && crypto && typeof crypto == 'object' );\n if ( v && !CRYPTO && ERRORS ) raise( 2, 'crypto unavailable', crypto );\n } else if (ERRORS) {\n raise( 2, p + notBool, v );\n }\n }\n r[p] = CRYPTO;\n\n // MODULO_MODE {number} Integer, 0 to 9 inclusive.\n // 'config() MODULO_MODE not an integer: {v}'\n // 'config() MODULO_MODE out of range: {v}'\n if ( has( p = 'MODULO_MODE' ) && isValidInt( v, 0, 9, 2, p ) ) {\n MODULO_MODE = v | 0;\n }\n r[p] = MODULO_MODE;\n\n // POW_PRECISION {number} Integer, 0 to MAX inclusive.\n // 'config() POW_PRECISION not an integer: {v}'\n // 'config() POW_PRECISION out of range: {v}'\n if ( has( p = 'POW_PRECISION' ) && isValidInt( v, 0, MAX, 2, p ) ) {\n POW_PRECISION = v | 0;\n }\n r[p] = POW_PRECISION;\n\n // FORMAT {object}\n // 'config() FORMAT not an object: {v}'\n if ( has( p = 'FORMAT' ) ) {\n\n if ( typeof v == 'object' ) {\n FORMAT = v;\n } else if (ERRORS) {\n raise( 2, p + ' not an object', v );\n }\n }\n r[p] = FORMAT;\n\n return r;\n };\n\n\n /*\n * Return a new BigNumber whose value is the maximum of the arguments.\n *\n * arguments {number|string|BigNumber}\n */\n BigNumber.max = function () { return maxOrMin( arguments, P.lt ); };\n\n\n /*\n * Return a new BigNumber whose value is the minimum of the arguments.\n *\n * arguments {number|string|BigNumber}\n */\n BigNumber.min = function () { return maxOrMin( arguments, P.gt ); };\n\n\n /*\n * Return a new BigNumber with a random value equal to or greater than 0 and less than 1,\n * and with dp, or DECIMAL_PLACES if dp is omitted, decimal places (or less if trailing\n * zeros are produced).\n *\n * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\n *\n * 'random() decimal places not an integer: {dp}'\n * 'random() decimal places out of range: {dp}'\n * 'random() crypto unavailable: {crypto}'\n */\n BigNumber.random = (function () {\n var pow2_53 = 0x20000000000000;\n\n // Return a 53 bit integer n, where 0 <= n < 9007199254740992.\n // Check if Math.random() produces more than 32 bits of randomness.\n // If it does, assume at least 53 bits are produced, otherwise assume at least 30 bits.\n // 0x40000000 is 2^30, 0x800000 is 2^23, 0x1fffff is 2^21 - 1.\n var random53bitInt = (Math.random() * pow2_53) & 0x1fffff\n ? function () { return mathfloor( Math.random() * pow2_53 ); }\n : function () { return ((Math.random() * 0x40000000 | 0) * 0x800000) +\n (Math.random() * 0x800000 | 0); };\n\n return function (dp) {\n var a, b, e, k, v,\n i = 0,\n c = [],\n rand = new BigNumber(ONE);\n\n dp = dp == null || !isValidInt( dp, 0, MAX, 14 ) ? DECIMAL_PLACES : dp | 0;\n k = mathceil( dp / LOG_BASE );\n\n if (CRYPTO) {\n\n // Browsers supporting crypto.getRandomValues.\n if ( crypto && crypto.getRandomValues ) {\n\n a = crypto.getRandomValues( new Uint32Array( k *= 2 ) );\n\n for ( ; i < k; ) {\n\n // 53 bits:\n // ((Math.pow(2, 32) - 1) * Math.pow(2, 21)).toString(2)\n // 11111 11111111 11111111 11111111 11100000 00000000 00000000\n // ((Math.pow(2, 32) - 1) >>> 11).toString(2)\n // 11111 11111111 11111111\n // 0x20000 is 2^21.\n v = a[i] * 0x20000 + (a[i + 1] >>> 11);\n\n // Rejection sampling:\n // 0 <= v < 9007199254740992\n // Probability that v >= 9e15, is\n // 7199254740992 / 9007199254740992 ~= 0.0008, i.e. 1 in 1251\n if ( v >= 9e15 ) {\n b = crypto.getRandomValues( new Uint32Array(2) );\n a[i] = b[0];\n a[i + 1] = b[1];\n } else {\n\n // 0 <= v <= 8999999999999999\n // 0 <= (v % 1e14) <= 99999999999999\n c.push( v % 1e14 );\n i += 2;\n }\n }\n i = k / 2;\n\n // Node.js supporting crypto.randomBytes.\n } else if ( crypto && crypto.randomBytes ) {\n\n // buffer\n a = crypto.randomBytes( k *= 7 );\n\n for ( ; i < k; ) {\n\n // 0x1000000000000 is 2^48, 0x10000000000 is 2^40\n // 0x100000000 is 2^32, 0x1000000 is 2^24\n // 11111 11111111 11111111 11111111 11111111 11111111 11111111\n // 0 <= v < 9007199254740992\n v = ( ( a[i] & 31 ) * 0x1000000000000 ) + ( a[i + 1] * 0x10000000000 ) +\n ( a[i + 2] * 0x100000000 ) + ( a[i + 3] * 0x1000000 ) +\n ( a[i + 4] << 16 ) + ( a[i + 5] << 8 ) + a[i + 6];\n\n if ( v >= 9e15 ) {\n crypto.randomBytes(7).copy( a, i );\n } else {\n\n // 0 <= (v % 1e14) <= 99999999999999\n c.push( v % 1e14 );\n i += 7;\n }\n }\n i = k / 7;\n } else if (ERRORS) {\n raise( 14, 'crypto unavailable', crypto );\n }\n }\n\n // Use Math.random: CRYPTO is false or crypto is unavailable and ERRORS is false.\n if (!i) {\n\n for ( ; i < k; ) {\n v = random53bitInt();\n if ( v < 9e15 ) c[i++] = v % 1e14;\n }\n }\n\n k = c[--i];\n dp %= LOG_BASE;\n\n // Convert trailing digits to zeros according to dp.\n if ( k && dp ) {\n v = POWS_TEN[LOG_BASE - dp];\n c[i] = mathfloor( k / v ) * v;\n }\n\n // Remove trailing elements which are zero.\n for ( ; c[i] === 0; c.pop(), i-- );\n\n // Zero?\n if ( i < 0 ) {\n c = [ e = 0 ];\n } else {\n\n // Remove leading elements which are zero and adjust exponent accordingly.\n for ( e = -1 ; c[0] === 0; c.shift(), e -= LOG_BASE);\n\n // Count the digits of the first element of c to determine leading zeros, and...\n for ( i = 1, v = c[0]; v >= 10; v /= 10, i++);\n\n // adjust the exponent accordingly.\n if ( i < LOG_BASE ) e -= LOG_BASE - i;\n }\n\n rand.e = e;\n rand.c = c;\n return rand;\n };\n })();\n\n\n // PRIVATE FUNCTIONS\n\n\n // Convert a numeric string of baseIn to a numeric string of baseOut.\n function convertBase( str, baseOut, baseIn, sign ) {\n var d, e, k, r, x, xc, y,\n i = str.indexOf( '.' ),\n dp = DECIMAL_PLACES,\n rm = ROUNDING_MODE;\n\n if ( baseIn < 37 ) str = str.toLowerCase();\n\n // Non-integer.\n if ( i >= 0 ) {\n k = POW_PRECISION;\n\n // Unlimited precision.\n POW_PRECISION = 0;\n str = str.replace( '.', '' );\n y = new BigNumber(baseIn);\n x = y.pow( str.length - i );\n POW_PRECISION = k;\n\n // Convert str as if an integer, then restore the fraction part by dividing the\n // result by its base raised to a power.\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\n y.e = y.c.length;\n }\n\n // Convert the number as integer.\n xc = toBaseOut( str, baseIn, baseOut );\n e = k = xc.length;\n\n // Remove trailing zeros.\n for ( ; xc[--k] == 0; xc.pop() );\n if ( !xc[0] ) return '0';\n\n if ( i < 0 ) {\n --e;\n } else {\n x.c = xc;\n x.e = e;\n\n // sign is needed for correct rounding.\n x.s = sign;\n x = div( x, y, dp, rm, baseOut );\n xc = x.c;\n r = x.r;\n e = x.e;\n }\n\n d = e + dp + 1;\n\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\n i = xc[d];\n k = baseOut / 2;\n r = r || d < 0 || xc[d + 1] != null;\n\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\n rm == ( x.s < 0 ? 8 : 7 ) );\n\n if ( d < 1 || !xc[0] ) {\n\n // 1^-dp or 0.\n str = r ? toFixedPoint( '1', -dp ) : '0';\n } else {\n xc.length = d;\n\n if (r) {\n\n // Rounding up may mean the previous digit has to be rounded up and so on.\n for ( --baseOut; ++xc[--d] > baseOut; ) {\n xc[d] = 0;\n\n if ( !d ) {\n ++e;\n xc.unshift(1);\n }\n }\n }\n\n // Determine trailing zeros.\n for ( k = xc.length; !xc[--k]; );\n\n // E.g. [4, 11, 15] becomes 4bf.\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\n str = toFixedPoint( str, e );\n }\n\n // The caller will add the sign.\n return str;\n }\n\n\n // Perform division in the specified base. Called by div and convertBase.\n div = (function () {\n\n // Assume non-zero x and k.\n function multiply( x, k, base ) {\n var m, temp, xlo, xhi,\n carry = 0,\n i = x.length,\n klo = k % SQRT_BASE,\n khi = k / SQRT_BASE | 0;\n\n for ( x = x.slice(); i--; ) {\n xlo = x[i] % SQRT_BASE;\n xhi = x[i] / SQRT_BASE | 0;\n m = khi * xlo + xhi * klo;\n temp = klo * xlo + ( ( m % SQRT_BASE ) * SQRT_BASE ) + carry;\n carry = ( temp / base | 0 ) + ( m / SQRT_BASE | 0 ) + khi * xhi;\n x[i] = temp % base;\n }\n\n if (carry) x.unshift(carry);\n\n return x;\n }\n\n function compare( a, b, aL, bL ) {\n var i, cmp;\n\n if ( aL != bL ) {\n cmp = aL > bL ? 1 : -1;\n } else {\n\n for ( i = cmp = 0; i < aL; i++ ) {\n\n if ( a[i] != b[i] ) {\n cmp = a[i] > b[i] ? 1 : -1;\n break;\n }\n }\n }\n return cmp;\n }\n\n function subtract( a, b, aL, base ) {\n var i = 0;\n\n // Subtract b from a.\n for ( ; aL--; ) {\n a[aL] -= i;\n i = a[aL] < b[aL] ? 1 : 0;\n a[aL] = i * base + a[aL] - b[aL];\n }\n\n // Remove leading zeros.\n for ( ; !a[0] && a.length > 1; a.shift() );\n }\n\n // x: dividend, y: divisor.\n return function ( x, y, dp, rm, base ) {\n var cmp, e, i, more, n, prod, prodL, q, qc, rem, remL, rem0, xi, xL, yc0,\n yL, yz,\n s = x.s == y.s ? 1 : -1,\n xc = x.c,\n yc = y.c;\n\n // Either NaN, Infinity or 0?\n if ( !xc || !xc[0] || !yc || !yc[0] ) {\n\n return new BigNumber(\n\n // Return NaN if either NaN, or both Infinity or 0.\n !x.s || !y.s || ( xc ? yc && xc[0] == yc[0] : !yc ) ? NaN :\n\n // Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0.\n xc && xc[0] == 0 || !yc ? s * 0 : s / 0\n );\n }\n\n q = new BigNumber(s);\n qc = q.c = [];\n e = x.e - y.e;\n s = dp + e + 1;\n\n if ( !base ) {\n base = BASE;\n e = bitFloor( x.e / LOG_BASE ) - bitFloor( y.e / LOG_BASE );\n s = s / LOG_BASE | 0;\n }\n\n // Result exponent may be one less then the current value of e.\n // The coefficients of the BigNumbers from convertBase may have trailing zeros.\n for ( i = 0; yc[i] == ( xc[i] || 0 ); i++ );\n if ( yc[i] > ( xc[i] || 0 ) ) e--;\n\n if ( s < 0 ) {\n qc.push(1);\n more = true;\n } else {\n xL = xc.length;\n yL = yc.length;\n i = 0;\n s += 2;\n\n // Normalise xc and yc so highest order digit of yc is >= base / 2.\n\n n = mathfloor( base / ( yc[0] + 1 ) );\n\n // Not necessary, but to handle odd bases where yc[0] == ( base / 2 ) - 1.\n // if ( n > 1 || n++ == 1 && yc[0] < base / 2 ) {\n if ( n > 1 ) {\n yc = multiply( yc, n, base );\n xc = multiply( xc, n, base );\n yL = yc.length;\n xL = xc.length;\n }\n\n xi = yL;\n rem = xc.slice( 0, yL );\n remL = rem.length;\n\n // Add zeros to make remainder as long as divisor.\n for ( ; remL < yL; rem[remL++] = 0 );\n yz = yc.slice();\n yz.unshift(0);\n yc0 = yc[0];\n if ( yc[1] >= base / 2 ) yc0++;\n // Not necessary, but to prevent trial digit n > base, when using base 3.\n // else if ( base == 3 && yc0 == 1 ) yc0 = 1 + 1e-15;\n\n do {\n n = 0;\n\n // Compare divisor and remainder.\n cmp = compare( yc, rem, yL, remL );\n\n // If divisor < remainder.\n if ( cmp < 0 ) {\n\n // Calculate trial digit, n.\n\n rem0 = rem[0];\n if ( yL != remL ) rem0 = rem0 * base + ( rem[1] || 0 );\n\n // n is how many times the divisor goes into the current remainder.\n n = mathfloor( rem0 / yc0 );\n\n // Algorithm:\n // 1. product = divisor * trial digit (n)\n // 2. if product > remainder: product -= divisor, n--\n // 3. remainder -= product\n // 4. if product was < remainder at 2:\n // 5. compare new remainder and divisor\n // 6. If remainder > divisor: remainder -= divisor, n++\n\n if ( n > 1 ) {\n\n // n may be > base only when base is 3.\n if (n >= base) n = base - 1;\n\n // product = divisor * trial digit.\n prod = multiply( yc, n, base );\n prodL = prod.length;\n remL = rem.length;\n\n // Compare product and remainder.\n // If product > remainder.\n // Trial digit n too high.\n // n is 1 too high about 5% of the time, and is not known to have\n // ever been more than 1 too high.\n while ( compare( prod, rem, prodL, remL ) == 1 ) {\n n--;\n\n // Subtract divisor from product.\n subtract( prod, yL < prodL ? yz : yc, prodL, base );\n prodL = prod.length;\n cmp = 1;\n }\n } else {\n\n // n is 0 or 1, cmp is -1.\n // If n is 0, there is no need to compare yc and rem again below,\n // so change cmp to 1 to avoid it.\n // If n is 1, leave cmp as -1, so yc and rem are compared again.\n if ( n == 0 ) {\n\n // divisor < remainder, so n must be at least 1.\n cmp = n = 1;\n }\n\n // product = divisor\n prod = yc.slice();\n prodL = prod.length;\n }\n\n if ( prodL < remL ) prod.unshift(0);\n\n // Subtract product from remainder.\n subtract( rem, prod, remL, base );\n remL = rem.length;\n\n // If product was < remainder.\n if ( cmp == -1 ) {\n\n // Compare divisor and new remainder.\n // If divisor < new remainder, subtract divisor from remainder.\n // Trial digit n too low.\n // n is 1 too low about 5% of the time, and very rarely 2 too low.\n while ( compare( yc, rem, yL, remL ) < 1 ) {\n n++;\n\n // Subtract divisor from remainder.\n subtract( rem, yL < remL ? yz : yc, remL, base );\n remL = rem.length;\n }\n }\n } else if ( cmp === 0 ) {\n n++;\n rem = [0];\n } // else cmp === 1 and n will be 0\n\n // Add the next digit, n, to the result array.\n qc[i++] = n;\n\n // Update the remainder.\n if ( rem[0] ) {\n rem[remL++] = xc[xi] || 0;\n } else {\n rem = [ xc[xi] ];\n remL = 1;\n }\n } while ( ( xi++ < xL || rem[0] != null ) && s-- );\n\n more = rem[0] != null;\n\n // Leading zero?\n if ( !qc[0] ) qc.shift();\n }\n\n if ( base == BASE ) {\n\n // To calculate q.e, first get the number of digits of qc[0].\n for ( i = 1, s = qc[0]; s >= 10; s /= 10, i++ );\n round( q, dp + ( q.e = i + e * LOG_BASE - 1 ) + 1, rm, more );\n\n // Caller is convertBase.\n } else {\n q.e = e;\n q.r = +more;\n }\n\n return q;\n };\n })();\n\n\n /*\n * Return a string representing the value of BigNumber n in fixed-point or exponential\n * notation rounded to the specified decimal places or significant digits.\n *\n * n is a BigNumber.\n * i is the index of the last digit required (i.e. the digit that may be rounded up).\n * rm is the rounding mode.\n * caller is caller id: toExponential 19, toFixed 20, toFormat 21, toPrecision 24.\n */\n function format( n, i, rm, caller ) {\n var c0, e, ne, len, str;\n\n rm = rm != null && isValidInt( rm, 0, 8, caller, roundingMode )\n ? rm | 0 : ROUNDING_MODE;\n\n if ( !n.c ) return n.toString();\n c0 = n.c[0];\n ne = n.e;\n\n if ( i == null ) {\n str = coeffToString( n.c );\n str = caller == 19 || caller == 24 && ne <= TO_EXP_NEG\n ? toExponential( str, ne )\n : toFixedPoint( str, ne );\n } else {\n n = round( new BigNumber(n), i, rm );\n\n // n.e may have changed if the value was rounded up.\n e = n.e;\n\n str = coeffToString( n.c );\n len = str.length;\n\n // toPrecision returns exponential notation if the number of significant digits\n // specified is less than the number of digits necessary to represent the integer\n // part of the value in fixed-point notation.\n\n // Exponential notation.\n if ( caller == 19 || caller == 24 && ( i <= e || e <= TO_EXP_NEG ) ) {\n\n // Append zeros?\n for ( ; len < i; str += '0', len++ );\n str = toExponential( str, e );\n\n // Fixed-point notation.\n } else {\n i -= ne;\n str = toFixedPoint( str, e );\n\n // Append zeros?\n if ( e + 1 > len ) {\n if ( --i > 0 ) for ( str += '.'; i--; str += '0' );\n } else {\n i += e - len;\n if ( i > 0 ) {\n if ( e + 1 == len ) str += '.';\n for ( ; i--; str += '0' );\n }\n }\n }\n }\n\n return n.s < 0 && c0 ? '-' + str : str;\n }\n\n\n // Handle BigNumber.max and BigNumber.min.\n function maxOrMin( args, method ) {\n var m, n,\n i = 0;\n\n if ( isArray( args[0] ) ) args = args[0];\n m = new BigNumber( args[0] );\n\n for ( ; ++i < args.length; ) {\n n = new BigNumber( args[i] );\n\n // If any number is NaN, return NaN.\n if ( !n.s ) {\n m = n;\n break;\n } else if ( method.call( m, n ) ) {\n m = n;\n }\n }\n\n return m;\n }\n\n\n /*\n * Return true if n is an integer in range, otherwise throw.\n * Use for argument validation when ERRORS is true.\n */\n function intValidatorWithErrors( n, min, max, caller, name ) {\n if ( n < min || n > max || n != truncate(n) ) {\n raise( caller, ( name || 'decimal places' ) +\n ( n < min || n > max ? ' out of range' : ' not an integer' ), n );\n }\n\n return true;\n }\n\n\n /*\n * Strip trailing zeros, calculate base 10 exponent and check against MIN_EXP and MAX_EXP.\n * Called by minus, plus and times.\n */\n function normalise( n, c, e ) {\n var i = 1,\n j = c.length;\n\n // Remove trailing zeros.\n for ( ; !c[--j]; c.pop() );\n\n // Calculate the base 10 exponent. First get the number of digits of c[0].\n for ( j = c[0]; j >= 10; j /= 10, i++ );\n\n // Overflow?\n if ( ( e = i + e * LOG_BASE - 1 ) > MAX_EXP ) {\n\n // Infinity.\n n.c = n.e = null;\n\n // Underflow?\n } else if ( e < MIN_EXP ) {\n\n // Zero.\n n.c = [ n.e = 0 ];\n } else {\n n.e = e;\n n.c = c;\n }\n\n return n;\n }\n\n\n // Handle values that fail the validity test in BigNumber.\n parseNumeric = (function () {\n var basePrefix = /^(-?)0([xbo])/i,\n dotAfter = /^([^.]+)\\.$/,\n dotBefore = /^\\.([^.]+)$/,\n isInfinityOrNaN = /^-?(Infinity|NaN)$/,\n whitespaceOrPlus = /^\\s*\\+|^\\s+|\\s+$/g;\n\n return function ( x, str, num, b ) {\n var base,\n s = num ? str : str.replace( whitespaceOrPlus, '' );\n\n // No exception on ±Infinity or NaN.\n if ( isInfinityOrNaN.test(s) ) {\n x.s = isNaN(s) ? null : s < 0 ? -1 : 1;\n } else {\n if ( !num ) {\n\n // basePrefix = /^(-?)0([xbo])(?=\\w[\\w.]*$)/i\n s = s.replace( basePrefix, function ( m, p1, p2 ) {\n base = ( p2 = p2.toLowerCase() ) == 'x' ? 16 : p2 == 'b' ? 2 : 8;\n return !b || b == base ? p1 : m;\n });\n\n if (b) {\n base = b;\n\n // E.g. '1.' to '1', '.1' to '0.1'\n s = s.replace( dotAfter, '$1' ).replace( dotBefore, '0.$1' );\n }\n\n if ( str != s ) return new BigNumber( s, base );\n }\n\n // 'new BigNumber() not a number: {n}'\n // 'new BigNumber() not a base {b} number: {n}'\n if (ERRORS) raise( id, 'not a' + ( b ? ' base ' + b : '' ) + ' number', str );\n x.s = null;\n }\n\n x.c = x.e = null;\n id = 0;\n }\n })();\n\n\n // Throw a BigNumber Error.\n function raise( caller, msg, val ) {\n var error = new Error( [\n 'new BigNumber', // 0\n 'cmp', // 1\n 'config', // 2\n 'div', // 3\n 'divToInt', // 4\n 'eq', // 5\n 'gt', // 6\n 'gte', // 7\n 'lt', // 8\n 'lte', // 9\n 'minus', // 10\n 'mod', // 11\n 'plus', // 12\n 'precision', // 13\n 'random', // 14\n 'round', // 15\n 'shift', // 16\n 'times', // 17\n 'toDigits', // 18\n 'toExponential', // 19\n 'toFixed', // 20\n 'toFormat', // 21\n 'toFraction', // 22\n 'pow', // 23\n 'toPrecision', // 24\n 'toString', // 25\n 'BigNumber' // 26\n ][caller] + '() ' + msg + ': ' + val );\n\n error.name = 'BigNumber Error';\n id = 0;\n throw error;\n }\n\n\n /*\n * Round x to sd significant digits using rounding mode rm. Check for over/under-flow.\n * If r is truthy, it is known that there are more digits after the rounding digit.\n */\n function round( x, sd, rm, r ) {\n var d, i, j, k, n, ni, rd,\n xc = x.c,\n pows10 = POWS_TEN;\n\n // if x is not Infinity or NaN...\n if (xc) {\n\n // rd is the rounding digit, i.e. the digit after the digit that may be rounded up.\n // n is a base 1e14 number, the value of the element of array x.c containing rd.\n // ni is the index of n within x.c.\n // d is the number of digits of n.\n // i is the index of rd within n including leading zeros.\n // j is the actual index of rd within n (if < 0, rd is a leading zero).\n out: {\n\n // Get the number of digits of the first element of xc.\n for ( d = 1, k = xc[0]; k >= 10; k /= 10, d++ );\n i = sd - d;\n\n // If the rounding digit is in the first element of xc...\n if ( i < 0 ) {\n i += LOG_BASE;\n j = sd;\n n = xc[ ni = 0 ];\n\n // Get the rounding digit at index j of n.\n rd = n / pows10[ d - j - 1 ] % 10 | 0;\n } else {\n ni = mathceil( ( i + 1 ) / LOG_BASE );\n\n if ( ni >= xc.length ) {\n\n if (r) {\n\n // Needed by sqrt.\n for ( ; xc.length <= ni; xc.push(0) );\n n = rd = 0;\n d = 1;\n i %= LOG_BASE;\n j = i - LOG_BASE + 1;\n } else {\n break out;\n }\n } else {\n n = k = xc[ni];\n\n // Get the number of digits of n.\n for ( d = 1; k >= 10; k /= 10, d++ );\n\n // Get the index of rd within n.\n i %= LOG_BASE;\n\n // Get the index of rd within n, adjusted for leading zeros.\n // The number of leading zeros of n is given by LOG_BASE - d.\n j = i - LOG_BASE + d;\n\n // Get the rounding digit at index j of n.\n rd = j < 0 ? 0 : n / pows10[ d - j - 1 ] % 10 | 0;\n }\n }\n\n r = r || sd < 0 ||\n\n // Are there any non-zero digits after the rounding digit?\n // The expression n % pows10[ d - j - 1 ] returns all digits of n to the right\n // of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714.\n xc[ni + 1] != null || ( j < 0 ? n : n % pows10[ d - j - 1 ] );\n\n r = rm < 4\n ? ( rd || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\n : rd > 5 || rd == 5 && ( rm == 4 || r || rm == 6 &&\n\n // Check whether the digit to the left of the rounding digit is odd.\n ( ( i > 0 ? j > 0 ? n / pows10[ d - j ] : 0 : xc[ni - 1] ) % 10 ) & 1 ||\n rm == ( x.s < 0 ? 8 : 7 ) );\n\n if ( sd < 1 || !xc[0] ) {\n xc.length = 0;\n\n if (r) {\n\n // Convert sd to decimal places.\n sd -= x.e + 1;\n\n // 1, 0.1, 0.01, 0.001, 0.0001 etc.\n xc[0] = pows10[ sd % LOG_BASE ];\n x.e = -sd || 0;\n } else {\n\n // Zero.\n xc[0] = x.e = 0;\n }\n\n return x;\n }\n\n // Remove excess digits.\n if ( i == 0 ) {\n xc.length = ni;\n k = 1;\n ni--;\n } else {\n xc.length = ni + 1;\n k = pows10[ LOG_BASE - i ];\n\n // E.g. 56700 becomes 56000 if 7 is the rounding digit.\n // j > 0 means i > number of leading zeros of n.\n xc[ni] = j > 0 ? mathfloor( n / pows10[ d - j ] % pows10[j] ) * k : 0;\n }\n\n // Round up?\n if (r) {\n\n for ( ; ; ) {\n\n // If the digit to be rounded up is in the first element of xc...\n if ( ni == 0 ) {\n\n // i will be the length of xc[0] before k is added.\n for ( i = 1, j = xc[0]; j >= 10; j /= 10, i++ );\n j = xc[0] += k;\n for ( k = 1; j >= 10; j /= 10, k++ );\n\n // if i != k the length has increased.\n if ( i != k ) {\n x.e++;\n if ( xc[0] == BASE ) xc[0] = 1;\n }\n\n break;\n } else {\n xc[ni] += k;\n if ( xc[ni] != BASE ) break;\n xc[ni--] = 0;\n k = 1;\n }\n }\n }\n\n // Remove trailing zeros.\n for ( i = xc.length; xc[--i] === 0; xc.pop() );\n }\n\n // Overflow? Infinity.\n if ( x.e > MAX_EXP ) {\n x.c = x.e = null;\n\n // Underflow? Zero.\n } else if ( x.e < MIN_EXP ) {\n x.c = [ x.e = 0 ];\n }\n }\n\n return x;\n }\n\n\n // PROTOTYPE/INSTANCE METHODS\n\n\n /*\n * Return a new BigNumber whose value is the absolute value of this BigNumber.\n */\n P.absoluteValue = P.abs = function () {\n var x = new BigNumber(this);\n if ( x.s < 0 ) x.s = 1;\n return x;\n };\n\n\n /*\n * Return a new BigNumber whose value is the value of this BigNumber rounded to a whole\n * number in the direction of Infinity.\n */\n P.ceil = function () {\n return round( new BigNumber(this), this.e + 1, 2 );\n };\n\n\n /*\n * Return\n * 1 if the value of this BigNumber is greater than the value of BigNumber(y, b),\n * -1 if the value of this BigNumber is less than the value of BigNumber(y, b),\n * 0 if they have the same value,\n * or null if the value of either is NaN.\n */\n P.comparedTo = P.cmp = function ( y, b ) {\n id = 1;\n return compare( this, new BigNumber( y, b ) );\n };\n\n\n /*\n * Return the number of decimal places of the value of this BigNumber, or null if the value\n * of this BigNumber is ±Infinity or NaN.\n */\n P.decimalPlaces = P.dp = function () {\n var n, v,\n c = this.c;\n\n if ( !c ) return null;\n n = ( ( v = c.length - 1 ) - bitFloor( this.e / LOG_BASE ) ) * LOG_BASE;\n\n // Subtract the number of trailing zeros of the last number.\n if ( v = c[v] ) for ( ; v % 10 == 0; v /= 10, n-- );\n if ( n < 0 ) n = 0;\n\n return n;\n };\n\n\n /*\n * n / 0 = I\n * n / N = N\n * n / I = 0\n * 0 / n = 0\n * 0 / 0 = N\n * 0 / N = N\n * 0 / I = 0\n * N / n = N\n * N / 0 = N\n * N / N = N\n * N / I = N\n * I / n = I\n * I / 0 = I\n * I / N = N\n * I / I = N\n *\n * Return a new BigNumber whose value is the value of this BigNumber divided by the value of\n * BigNumber(y, b), rounded according to DECIMAL_PLACES and ROUNDING_MODE.\n */\n P.dividedBy = P.div = function ( y, b ) {\n id = 3;\n return div( this, new BigNumber( y, b ), DECIMAL_PLACES, ROUNDING_MODE );\n };\n\n\n /*\n * Return a new BigNumber whose value is the integer part of dividing the value of this\n * BigNumber by the value of BigNumber(y, b).\n */\n P.dividedToIntegerBy = P.divToInt = function ( y, b ) {\n id = 4;\n return div( this, new BigNumber( y, b ), 0, 1 );\n };\n\n\n /*\n * Return true if the value of this BigNumber is equal to the value of BigNumber(y, b),\n * otherwise returns false.\n */\n P.equals = P.eq = function ( y, b ) {\n id = 5;\n return compare( this, new BigNumber( y, b ) ) === 0;\n };\n\n\n /*\n * Return a new BigNumber whose value is the value of this BigNumber rounded to a whole\n * number in the direction of -Infinity.\n */\n P.floor = function () {\n return round( new BigNumber(this), this.e + 1, 3 );\n };\n\n\n /*\n * Return true if the value of this BigNumber is greater than the value of BigNumber(y, b),\n * otherwise returns false.\n */\n P.greaterThan = P.gt = function ( y, b ) {\n id = 6;\n return compare( this, new BigNumber( y, b ) ) > 0;\n };\n\n\n /*\n * Return true if the value of this BigNumber is greater than or equal to the value of\n * BigNumber(y, b), otherwise returns false.\n */\n P.greaterThanOrEqualTo = P.gte = function ( y, b ) {\n id = 7;\n return ( b = compare( this, new BigNumber( y, b ) ) ) === 1 || b === 0;\n\n };\n\n\n /*\n * Return true if the value of this BigNumber is a finite number, otherwise returns false.\n */\n P.isFinite = function () {\n return !!this.c;\n };\n\n\n /*\n * Return true if the value of this BigNumber is an integer, otherwise return false.\n */\n P.isInteger = P.isInt = function () {\n return !!this.c && bitFloor( this.e / LOG_BASE ) > this.c.length - 2;\n };\n\n\n /*\n * Return true if the value of this BigNumber is NaN, otherwise returns false.\n */\n P.isNaN = function () {\n return !this.s;\n };\n\n\n /*\n * Return true if the value of this BigNumber is negative, otherwise returns false.\n */\n P.isNegative = P.isNeg = function () {\n return this.s < 0;\n };\n\n\n /*\n * Return true if the value of this BigNumber is 0 or -0, otherwise returns false.\n */\n P.isZero = function () {\n return !!this.c && this.c[0] == 0;\n };\n\n\n /*\n * Return true if the value of this BigNumber is less than the value of BigNumber(y, b),\n * otherwise returns false.\n */\n P.lessThan = P.lt = function ( y, b ) {\n id = 8;\n return compare( this, new BigNumber( y, b ) ) < 0;\n };\n\n\n /*\n * Return true if the value of this BigNumber is less than or equal to the value of\n * BigNumber(y, b), otherwise returns false.\n */\n P.lessThanOrEqualTo = P.lte = function ( y, b ) {\n id = 9;\n return ( b = compare( this, new BigNumber( y, b ) ) ) === -1 || b === 0;\n };\n\n\n /*\n * n - 0 = n\n * n - N = N\n * n - I = -I\n * 0 - n = -n\n * 0 - 0 = 0\n * 0 - N = N\n * 0 - I = -I\n * N - n = N\n * N - 0 = N\n * N - N = N\n * N - I = N\n * I - n = I\n * I - 0 = I\n * I - N = N\n * I - I = N\n *\n * Return a new BigNumber whose value is the value of this BigNumber minus the value of\n * BigNumber(y, b).\n */\n P.minus = P.sub = function ( y, b ) {\n var i, j, t, xLTy,\n x = this,\n a = x.s;\n\n id = 10;\n y = new BigNumber( y, b );\n b = y.s;\n\n // Either NaN?\n if ( !a || !b ) return new BigNumber(NaN);\n\n // Signs differ?\n if ( a != b ) {\n y.s = -b;\n return x.plus(y);\n }\n\n var xe = x.e / LOG_BASE,\n ye = y.e / LOG_BASE,\n xc = x.c,\n yc = y.c;\n\n if ( !xe || !ye ) {\n\n // Either Infinity?\n if ( !xc || !yc ) return xc ? ( y.s = -b, y ) : new BigNumber( yc ? x : NaN );\n\n // Either zero?\n if ( !xc[0] || !yc[0] ) {\n\n // Return y if y is non-zero, x if x is non-zero, or zero if both are zero.\n return yc[0] ? ( y.s = -b, y ) : new BigNumber( xc[0] ? x :\n\n // IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity\n ROUNDING_MODE == 3 ? -0 : 0 );\n }\n }\n\n xe = bitFloor(xe);\n ye = bitFloor(ye);\n xc = xc.slice();\n\n // Determine which is the bigger number.\n if ( a = xe - ye ) {\n\n if ( xLTy = a < 0 ) {\n a = -a;\n t = xc;\n } else {\n ye = xe;\n t = yc;\n }\n\n t.reverse();\n\n // Prepend zeros to equalise exponents.\n for ( b = a; b--; t.push(0) );\n t.reverse();\n } else {\n\n // Exponents equal. Check digit by digit.\n j = ( xLTy = ( a = xc.length ) < ( b = yc.length ) ) ? a : b;\n\n for ( a = b = 0; b < j; b++ ) {\n\n if ( xc[b] != yc[b] ) {\n xLTy = xc[b] < yc[b];\n break;\n }\n }\n }\n\n // x < y? Point xc to the array of the bigger number.\n if (xLTy) t = xc, xc = yc, yc = t, y.s = -y.s;\n\n b = ( j = yc.length ) - ( i = xc.length );\n\n // Append zeros to xc if shorter.\n // No need to add zeros to yc if shorter as subtract only needs to start at yc.length.\n if ( b > 0 ) for ( ; b--; xc[i++] = 0 );\n b = BASE - 1;\n\n // Subtract yc from xc.\n for ( ; j > a; ) {\n\n if ( xc[--j] < yc[j] ) {\n for ( i = j; i && !xc[--i]; xc[i] = b );\n --xc[i];\n xc[j] += BASE;\n }\n\n xc[j] -= yc[j];\n }\n\n // Remove leading zeros and adjust exponent accordingly.\n for ( ; xc[0] == 0; xc.shift(), --ye );\n\n // Zero?\n if ( !xc[0] ) {\n\n // Following IEEE 754 (2008) 6.3,\n // n - n = +0 but n - n = -0 when rounding towards -Infinity.\n y.s = ROUNDING_MODE == 3 ? -1 : 1;\n y.c = [ y.e = 0 ];\n return y;\n }\n\n // No need to check for Infinity as +x - +y != Infinity && -x - -y != Infinity\n // for finite x and y.\n return normalise( y, xc, ye );\n };\n\n\n /*\n * n % 0 = N\n * n % N = N\n * n % I = n\n * 0 % n = 0\n * -0 % n = -0\n * 0 % 0 = N\n * 0 % N = N\n * 0 % I = 0\n * N % n = N\n * N % 0 = N\n * N % N = N\n * N % I = N\n * I % n = N\n * I % 0 = N\n * I % N = N\n * I % I = N\n *\n * Return a new BigNumber whose value is the value of this BigNumber modulo the value of\n * BigNumber(y, b). The result depends on the value of MODULO_MODE.\n */\n P.modulo = P.mod = function ( y, b ) {\n var q, s,\n x = this;\n\n id = 11;\n y = new BigNumber( y, b );\n\n // Return NaN if x is Infinity or NaN, or y is NaN or zero.\n if ( !x.c || !y.s || y.c && !y.c[0] ) {\n return new BigNumber(NaN);\n\n // Return x if y is Infinity or x is zero.\n } else if ( !y.c || x.c && !x.c[0] ) {\n return new BigNumber(x);\n }\n\n if ( MODULO_MODE == 9 ) {\n\n // Euclidian division: q = sign(y) * floor(x / abs(y))\n // r = x - qy where 0 <= r < abs(y)\n s = y.s;\n y.s = 1;\n q = div( x, y, 0, 3 );\n y.s = s;\n q.s *= s;\n } else {\n q = div( x, y, 0, MODULO_MODE );\n }\n\n return x.minus( q.times(y) );\n };\n\n\n /*\n * Return a new BigNumber whose value is the value of this BigNumber negated,\n * i.e. multiplied by -1.\n */\n P.negated = P.neg = function () {\n var x = new BigNumber(this);\n x.s = -x.s || null;\n return x;\n };\n\n\n /*\n * n + 0 = n\n * n + N = N\n * n + I = I\n * 0 + n = n\n * 0 + 0 = 0\n * 0 + N = N\n * 0 + I = I\n * N + n = N\n * N + 0 = N\n * N + N = N\n * N + I = N\n * I + n = I\n * I + 0 = I\n * I + N = N\n * I + I = I\n *\n * Return a new BigNumber whose value is the value of this BigNumber plus the value of\n * BigNumber(y, b).\n */\n P.plus = P.add = function ( y, b ) {\n var t,\n x = this,\n a = x.s;\n\n id = 12;\n y = new BigNumber( y, b );\n b = y.s;\n\n // Either NaN?\n if ( !a || !b ) return new BigNumber(NaN);\n\n // Signs differ?\n if ( a != b ) {\n y.s = -b;\n return x.minus(y);\n }\n\n var xe = x.e / LOG_BASE,\n ye = y.e / LOG_BASE,\n xc = x.c,\n yc = y.c;\n\n if ( !xe || !ye ) {\n\n // Return ±Infinity if either ±Infinity.\n if ( !xc || !yc ) return new BigNumber( a / 0 );\n\n // Either zero?\n // Return y if y is non-zero, x if x is non-zero, or zero if both are zero.\n if ( !xc[0] || !yc[0] ) return yc[0] ? y : new BigNumber( xc[0] ? x : a * 0 );\n }\n\n xe = bitFloor(xe);\n ye = bitFloor(ye);\n xc = xc.slice();\n\n // Prepend zeros to equalise exponents. Faster to use reverse then do unshifts.\n if ( a = xe - ye ) {\n if ( a > 0 ) {\n ye = xe;\n t = yc;\n } else {\n a = -a;\n t = xc;\n }\n\n t.reverse();\n for ( ; a--; t.push(0) );\n t.reverse();\n }\n\n a = xc.length;\n b = yc.length;\n\n // Point xc to the longer array, and b to the shorter length.\n if ( a - b < 0 ) t = yc, yc = xc, xc = t, b = a;\n\n // Only start adding at yc.length - 1 as the further digits of xc can be ignored.\n for ( a = 0; b; ) {\n a = ( xc[--b] = xc[b] + yc[b] + a ) / BASE | 0;\n xc[b] %= BASE;\n }\n\n if (a) {\n xc.unshift(a);\n ++ye;\n }\n\n // No need to check for zero, as +x + +y != 0 && -x + -y != 0\n // ye = MAX_EXP + 1 possible\n return normalise( y, xc, ye );\n };\n\n\n /*\n * Return the number of significant digits of the value of this BigNumber.\n *\n * [z] {boolean|number} Whether to count integer-part trailing zeros: true, false, 1 or 0.\n */\n P.precision = P.sd = function (z) {\n var n, v,\n x = this,\n c = x.c;\n\n // 'precision() argument not a boolean or binary digit: {z}'\n if ( z != null && z !== !!z && z !== 1 && z !== 0 ) {\n if (ERRORS) raise( 13, 'argument' + notBool, z );\n if ( z != !!z ) z = null;\n }\n\n if ( !c ) return null;\n v = c.length - 1;\n n = v * LOG_BASE + 1;\n\n if ( v = c[v] ) {\n\n // Subtract the number of trailing zeros of the last element.\n for ( ; v % 10 == 0; v /= 10, n-- );\n\n // Add the number of digits of the first element.\n for ( v = c[0]; v >= 10; v /= 10, n++ );\n }\n\n if ( z && x.e + 1 > n ) n = x.e + 1;\n\n return n;\n };\n\n\n /*\n * Return a new BigNumber whose value is the value of this BigNumber rounded to a maximum of\n * dp decimal places using rounding mode rm, or to 0 and ROUNDING_MODE respectively if\n * omitted.\n *\n * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\n *\n * 'round() decimal places out of range: {dp}'\n * 'round() decimal places not an integer: {dp}'\n * 'round() rounding mode not an integer: {rm}'\n * 'round() rounding mode out of range: {rm}'\n */\n P.round = function ( dp, rm ) {\n var n = new BigNumber(this);\n\n if ( dp == null || isValidInt( dp, 0, MAX, 15 ) ) {\n round( n, ~~dp + this.e + 1, rm == null ||\n !isValidInt( rm, 0, 8, 15, roundingMode ) ? ROUNDING_MODE : rm | 0 );\n }\n\n return n;\n };\n\n\n /*\n * Return a new BigNumber whose value is the value of this BigNumber shifted by k places\n * (powers of 10). Shift to the right if n > 0, and to the left if n < 0.\n *\n * k {number} Integer, -MAX_SAFE_INTEGER to MAX_SAFE_INTEGER inclusive.\n *\n * If k is out of range and ERRORS is false, the result will be ±0 if k < 0, or ±Infinity\n * otherwise.\n *\n * 'shift() argument not an integer: {k}'\n * 'shift() argument out of range: {k}'\n */\n P.shift = function (k) {\n var n = this;\n return isValidInt( k, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER, 16, 'argument' )\n\n // k < 1e+21, or truncate(k) will produce exponential notation.\n ? n.times( '1e' + truncate(k) )\n : new BigNumber( n.c && n.c[0] && ( k < -MAX_SAFE_INTEGER || k > MAX_SAFE_INTEGER )\n ? n.s * ( k < 0 ? 0 : 1 / 0 )\n : n );\n };\n\n\n /*\n * sqrt(-n) = N\n * sqrt( N) = N\n * sqrt(-I) = N\n * sqrt( I) = I\n * sqrt( 0) = 0\n * sqrt(-0) = -0\n *\n * Return a new BigNumber whose value is the square root of the value of this BigNumber,\n * rounded according to DECIMAL_PLACES and ROUNDING_MODE.\n */\n P.squareRoot = P.sqrt = function () {\n var m, n, r, rep, t,\n x = this,\n c = x.c,\n s = x.s,\n e = x.e,\n dp = DECIMAL_PLACES + 4,\n half = new BigNumber('0.5');\n\n // Negative/NaN/Infinity/zero?\n if ( s !== 1 || !c || !c[0] ) {\n return new BigNumber( !s || s < 0 && ( !c || c[0] ) ? NaN : c ? x : 1 / 0 );\n }\n\n // Initial estimate.\n s = Math.sqrt( +x );\n\n // Math.sqrt underflow/overflow?\n // Pass x to Math.sqrt as integer, then adjust the exponent of the result.\n if ( s == 0 || s == 1 / 0 ) {\n n = coeffToString(c);\n if ( ( n.length + e ) % 2 == 0 ) n += '0';\n s = Math.sqrt(n);\n e = bitFloor( ( e + 1 ) / 2 ) - ( e < 0 || e % 2 );\n\n if ( s == 1 / 0 ) {\n n = '1e' + e;\n } else {\n n = s.toExponential();\n n = n.slice( 0, n.indexOf('e') + 1 ) + e;\n }\n\n r = new BigNumber(n);\n } else {\n r = new BigNumber( s + '' );\n }\n\n // Check for zero.\n // r could be zero if MIN_EXP is changed after the this value was created.\n // This would cause a division by zero (x/t) and hence Infinity below, which would cause\n // coeffToString to throw.\n if ( r.c[0] ) {\n e = r.e;\n s = e + dp;\n if ( s < 3 ) s = 0;\n\n // Newton-Raphson iteration.\n for ( ; ; ) {\n t = r;\n r = half.times( t.plus( div( x, t, dp, 1 ) ) );\n\n if ( coeffToString( t.c ).slice( 0, s ) === ( n =\n coeffToString( r.c ) ).slice( 0, s ) ) {\n\n // The exponent of r may here be one less than the final result exponent,\n // e.g 0.0009999 (e-4) --> 0.001 (e-3), so adjust s so the rounding digits\n // are indexed correctly.\n if ( r.e < e ) --s;\n n = n.slice( s - 3, s + 1 );\n\n // The 4th rounding digit may be in error by -1 so if the 4 rounding digits\n // are 9999 or 4999 (i.e. approaching a rounding boundary) continue the\n // iteration.\n if ( n == '9999' || !rep && n == '4999' ) {\n\n // On the first iteration only, check to see if rounding up gives the\n // exact result as the nines may infinitely repeat.\n if ( !rep ) {\n round( t, t.e + DECIMAL_PLACES + 2, 0 );\n\n if ( t.times(t).eq(x) ) {\n r = t;\n break;\n }\n }\n\n dp += 4;\n s += 4;\n rep = 1;\n } else {\n\n // If rounding digits are null, 0{0,4} or 50{0,3}, check for exact\n // result. If not, then there are further digits and m will be truthy.\n if ( !+n || !+n.slice(1) && n.charAt(0) == '5' ) {\n\n // Truncate to the first rounding digit.\n round( r, r.e + DECIMAL_PLACES + 2, 1 );\n m = !r.times(r).eq(x);\n }\n\n break;\n }\n }\n }\n }\n\n return round( r, r.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m );\n };\n\n\n /*\n * n * 0 = 0\n * n * N = N\n * n * I = I\n * 0 * n = 0\n * 0 * 0 = 0\n * 0 * N = N\n * 0 * I = N\n * N * n = N\n * N * 0 = N\n * N * N = N\n * N * I = N\n * I * n = I\n * I * 0 = N\n * I * N = N\n * I * I = I\n *\n * Return a new BigNumber whose value is the value of this BigNumber times the value of\n * BigNumber(y, b).\n */\n P.times = P.mul = function ( y, b ) {\n var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc,\n base, sqrtBase,\n x = this,\n xc = x.c,\n yc = ( id = 17, y = new BigNumber( y, b ) ).c;\n\n // Either NaN, ±Infinity or ±0?\n if ( !xc || !yc || !xc[0] || !yc[0] ) {\n\n // Return NaN if either is NaN, or one is 0 and the other is Infinity.\n if ( !x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc ) {\n y.c = y.e = y.s = null;\n } else {\n y.s *= x.s;\n\n // Return ±Infinity if either is ±Infinity.\n if ( !xc || !yc ) {\n y.c = y.e = null;\n\n // Return ±0 if either is ±0.\n } else {\n y.c = [0];\n y.e = 0;\n }\n }\n\n return y;\n }\n\n e = bitFloor( x.e / LOG_BASE ) + bitFloor( y.e / LOG_BASE );\n y.s *= x.s;\n xcL = xc.length;\n ycL = yc.length;\n\n // Ensure xc points to longer array and xcL to its length.\n if ( xcL < ycL ) zc = xc, xc = yc, yc = zc, i = xcL, xcL = ycL, ycL = i;\n\n // Initialise the result array with zeros.\n for ( i = xcL + ycL, zc = []; i--; zc.push(0) );\n\n base = BASE;\n sqrtBase = SQRT_BASE;\n\n for ( i = ycL; --i >= 0; ) {\n c = 0;\n ylo = yc[i] % sqrtBase;\n yhi = yc[i] / sqrtBase | 0;\n\n for ( k = xcL, j = i + k; j > i; ) {\n xlo = xc[--k] % sqrtBase;\n xhi = xc[k] / sqrtBase | 0;\n m = yhi * xlo + xhi * ylo;\n xlo = ylo * xlo + ( ( m % sqrtBase ) * sqrtBase ) + zc[j] + c;\n c = ( xlo / base | 0 ) + ( m / sqrtBase | 0 ) + yhi * xhi;\n zc[j--] = xlo % base;\n }\n\n zc[j] = c;\n }\n\n if (c) {\n ++e;\n } else {\n zc.shift();\n }\n\n return normalise( y, zc, e );\n };\n\n\n /*\n * Return a new BigNumber whose value is the value of this BigNumber rounded to a maximum of\n * sd significant digits using rounding mode rm, or ROUNDING_MODE if rm is omitted.\n *\n * [sd] {number} Significant digits. Integer, 1 to MAX inclusive.\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\n *\n * 'toDigits() precision out of range: {sd}'\n * 'toDigits() precision not an integer: {sd}'\n * 'toDigits() rounding mode not an integer: {rm}'\n * 'toDigits() rounding mode out of range: {rm}'\n */\n P.toDigits = function ( sd, rm ) {\n var n = new BigNumber(this);\n sd = sd == null || !isValidInt( sd, 1, MAX, 18, 'precision' ) ? null : sd | 0;\n rm = rm == null || !isValidInt( rm, 0, 8, 18, roundingMode ) ? ROUNDING_MODE : rm | 0;\n return sd ? round( n, sd, rm ) : n;\n };\n\n\n /*\n * Return a string representing the value of this BigNumber in exponential notation and\n * rounded using ROUNDING_MODE to dp fixed decimal places.\n *\n * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\n *\n * 'toExponential() decimal places not an integer: {dp}'\n * 'toExponential() decimal places out of range: {dp}'\n * 'toExponential() rounding mode not an integer: {rm}'\n * 'toExponential() rounding mode out of range: {rm}'\n */\n P.toExponential = function ( dp, rm ) {\n return format( this,\n dp != null && isValidInt( dp, 0, MAX, 19 ) ? ~~dp + 1 : null, rm, 19 );\n };\n\n\n /*\n * Return a string representing the value of this BigNumber in fixed-point notation rounding\n * to dp fixed decimal places using rounding mode rm, or ROUNDING_MODE if rm is omitted.\n *\n * Note: as with JavaScript's number type, (-0).toFixed(0) is '0',\n * but e.g. (-0.00001).toFixed(0) is '-0'.\n *\n * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\n *\n * 'toFixed() decimal places not an integer: {dp}'\n * 'toFixed() decimal places out of range: {dp}'\n * 'toFixed() rounding mode not an integer: {rm}'\n * 'toFixed() rounding mode out of range: {rm}'\n */\n P.toFixed = function ( dp, rm ) {\n return format( this, dp != null && isValidInt( dp, 0, MAX, 20 )\n ? ~~dp + this.e + 1 : null, rm, 20 );\n };\n\n\n /*\n * Return a string representing the value of this BigNumber in fixed-point notation rounded\n * using rm or ROUNDING_MODE to dp decimal places, and formatted according to the properties\n * of the FORMAT object (see BigNumber.config).\n *\n * FORMAT = {\n * decimalSeparator : '.',\n * groupSeparator : ',',\n * groupSize : 3,\n * secondaryGroupSize : 0,\n * fractionGroupSeparator : '\\xA0', // non-breaking space\n * fractionGroupSize : 0\n * };\n *\n * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\n *\n * 'toFormat() decimal places not an integer: {dp}'\n * 'toFormat() decimal places out of range: {dp}'\n * 'toFormat() rounding mode not an integer: {rm}'\n * 'toFormat() rounding mode out of range: {rm}'\n */\n P.toFormat = function ( dp, rm ) {\n var str = format( this, dp != null && isValidInt( dp, 0, MAX, 21 )\n ? ~~dp + this.e + 1 : null, rm, 21 );\n\n if ( this.c ) {\n var i,\n arr = str.split('.'),\n g1 = +FORMAT.groupSize,\n g2 = +FORMAT.secondaryGroupSize,\n groupSeparator = FORMAT.groupSeparator,\n intPart = arr[0],\n fractionPart = arr[1],\n isNeg = this.s < 0,\n intDigits = isNeg ? intPart.slice(1) : intPart,\n len = intDigits.length;\n\n if (g2) i = g1, g1 = g2, g2 = i, len -= i;\n\n if ( g1 > 0 && len > 0 ) {\n i = len % g1 || g1;\n intPart = intDigits.substr( 0, i );\n\n for ( ; i < len; i += g1 ) {\n intPart += groupSeparator + intDigits.substr( i, g1 );\n }\n\n if ( g2 > 0 ) intPart += groupSeparator + intDigits.slice(i);\n if (isNeg) intPart = '-' + intPart;\n }\n\n str = fractionPart\n ? intPart + FORMAT.decimalSeparator + ( ( g2 = +FORMAT.fractionGroupSize )\n ? fractionPart.replace( new RegExp( '\\\\d{' + g2 + '}\\\\B', 'g' ),\n '$&' + FORMAT.fractionGroupSeparator )\n : fractionPart )\n : intPart;\n }\n\n return str;\n };\n\n\n /*\n * Return a string array representing the value of this BigNumber as a simple fraction with\n * an integer numerator and an integer denominator. The denominator will be a positive\n * non-zero value less than or equal to the specified maximum denominator. If a maximum\n * denominator is not specified, the denominator will be the lowest value necessary to\n * represent the number exactly.\n *\n * [md] {number|string|BigNumber} Integer >= 1 and < Infinity. The maximum denominator.\n *\n * 'toFraction() max denominator not an integer: {md}'\n * 'toFraction() max denominator out of range: {md}'\n */\n P.toFraction = function (md) {\n var arr, d0, d2, e, exp, n, n0, q, s,\n k = ERRORS,\n x = this,\n xc = x.c,\n d = new BigNumber(ONE),\n n1 = d0 = new BigNumber(ONE),\n d1 = n0 = new BigNumber(ONE);\n\n if ( md != null ) {\n ERRORS = false;\n n = new BigNumber(md);\n ERRORS = k;\n\n if ( !( k = n.isInt() ) || n.lt(ONE) ) {\n\n if (ERRORS) {\n raise( 22,\n 'max denominator ' + ( k ? 'out of range' : 'not an integer' ), md );\n }\n\n // ERRORS is false:\n // If md is a finite non-integer >= 1, round it to an integer and use it.\n md = !k && n.c && round( n, n.e + 1, 1 ).gte(ONE) ? n : null;\n }\n }\n\n if ( !xc ) return x.toString();\n s = coeffToString(xc);\n\n // Determine initial denominator.\n // d is a power of 10 and the minimum max denominator that specifies the value exactly.\n e = d.e = s.length - x.e - 1;\n d.c[0] = POWS_TEN[ ( exp = e % LOG_BASE ) < 0 ? LOG_BASE + exp : exp ];\n md = !md || n.cmp(d) > 0 ? ( e > 0 ? d : n1 ) : n;\n\n exp = MAX_EXP;\n MAX_EXP = 1 / 0;\n n = new BigNumber(s);\n\n // n0 = d1 = 0\n n0.c[0] = 0;\n\n for ( ; ; ) {\n q = div( n, d, 0, 1 );\n d2 = d0.plus( q.times(d1) );\n if ( d2.cmp(md) == 1 ) break;\n d0 = d1;\n d1 = d2;\n n1 = n0.plus( q.times( d2 = n1 ) );\n n0 = d2;\n d = n.minus( q.times( d2 = d ) );\n n = d2;\n }\n\n d2 = div( md.minus(d0), d1, 0, 1 );\n n0 = n0.plus( d2.times(n1) );\n d0 = d0.plus( d2.times(d1) );\n n0.s = n1.s = x.s;\n e *= 2;\n\n // Determine which fraction is closer to x, n0/d0 or n1/d1\n arr = div( n1, d1, e, ROUNDING_MODE ).minus(x).abs().cmp(\n div( n0, d0, e, ROUNDING_MODE ).minus(x).abs() ) < 1\n ? [ n1.toString(), d1.toString() ]\n : [ n0.toString(), d0.toString() ];\n\n MAX_EXP = exp;\n return arr;\n };\n\n\n /*\n * Return the value of this BigNumber converted to a number primitive.\n */\n P.toNumber = function () {\n var x = this;\n\n // Ensure zero has correct sign.\n return +x || ( x.s ? x.s * 0 : NaN );\n };\n\n\n /*\n * Return a BigNumber whose value is the value of this BigNumber raised to the power n.\n * If n is negative round according to DECIMAL_PLACES and ROUNDING_MODE.\n * If POW_PRECISION is not 0, round to POW_PRECISION using ROUNDING_MODE.\n *\n * n {number} Integer, -9007199254740992 to 9007199254740992 inclusive.\n * (Performs 54 loop iterations for n of 9007199254740992.)\n *\n * 'pow() exponent not an integer: {n}'\n * 'pow() exponent out of range: {n}'\n */\n P.toPower = P.pow = function (n) {\n var k, y,\n i = mathfloor( n < 0 ? -n : +n ),\n x = this;\n\n // Pass ±Infinity to Math.pow if exponent is out of range.\n if ( !isValidInt( n, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER, 23, 'exponent' ) &&\n ( !isFinite(n) || i > MAX_SAFE_INTEGER && ( n /= 0 ) ||\n parseFloat(n) != n && !( n = NaN ) ) ) {\n return new BigNumber( Math.pow( +x, n ) );\n }\n\n // Truncating each coefficient array to a length of k after each multiplication equates\n // to truncating significant digits to POW_PRECISION + [28, 41], i.e. there will be a\n // minimum of 28 guard digits retained. (Using + 1.5 would give [9, 21] guard digits.)\n k = POW_PRECISION ? mathceil( POW_PRECISION / LOG_BASE + 2 ) : 0;\n y = new BigNumber(ONE);\n\n for ( ; ; ) {\n\n if ( i % 2 ) {\n y = y.times(x);\n if ( !y.c ) break;\n if ( k && y.c.length > k ) y.c.length = k;\n }\n\n i = mathfloor( i / 2 );\n if ( !i ) break;\n\n x = x.times(x);\n if ( k && x.c && x.c.length > k ) x.c.length = k;\n }\n\n if ( n < 0 ) y = ONE.div(y);\n return k ? round( y, POW_PRECISION, ROUNDING_MODE ) : y;\n };\n\n\n /*\n * Return a string representing the value of this BigNumber rounded to sd significant digits\n * using rounding mode rm or ROUNDING_MODE. If sd is less than the number of digits\n * necessary to represent the integer part of the value in fixed-point notation, then use\n * exponential notation.\n *\n * [sd] {number} Significant digits. Integer, 1 to MAX inclusive.\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\n *\n * 'toPrecision() precision not an integer: {sd}'\n * 'toPrecision() precision out of range: {sd}'\n * 'toPrecision() rounding mode not an integer: {rm}'\n * 'toPrecision() rounding mode out of range: {rm}'\n */\n P.toPrecision = function ( sd, rm ) {\n return format( this, sd != null && isValidInt( sd, 1, MAX, 24, 'precision' )\n ? sd | 0 : null, rm, 24 );\n };\n\n\n /*\n * Return a string representing the value of this BigNumber in base b, or base 10 if b is\n * omitted. If a base is specified, including base 10, round according to DECIMAL_PLACES and\n * ROUNDING_MODE. If a base is not specified, and this BigNumber has a positive exponent\n * that is equal to or greater than TO_EXP_POS, or a negative exponent equal to or less than\n * TO_EXP_NEG, return exponential notation.\n *\n * [b] {number} Integer, 2 to 64 inclusive.\n *\n * 'toString() base not an integer: {b}'\n * 'toString() base out of range: {b}'\n */\n P.toString = function (b) {\n var str,\n n = this,\n s = n.s,\n e = n.e;\n\n // Infinity or NaN?\n if ( e === null ) {\n\n if (s) {\n str = 'Infinity';\n if ( s < 0 ) str = '-' + str;\n } else {\n str = 'NaN';\n }\n } else {\n str = coeffToString( n.c );\n\n if ( b == null || !isValidInt( b, 2, 64, 25, 'base' ) ) {\n str = e <= TO_EXP_NEG || e >= TO_EXP_POS\n ? toExponential( str, e )\n : toFixedPoint( str, e );\n } else {\n str = convertBase( toFixedPoint( str, e ), b | 0, 10, s );\n }\n\n if ( s < 0 && n.c[0] ) str = '-' + str;\n }\n\n return str;\n };\n\n\n /*\n * Return a new BigNumber whose value is the value of this BigNumber truncated to a whole\n * number.\n */\n P.truncated = P.trunc = function () {\n return round( new BigNumber(this), this.e + 1, 1 );\n };\n\n\n\n /*\n * Return as toString, but do not accept a base argument.\n */\n P.valueOf = P.toJSON = function () {\n return this.toString();\n };\n\n\n // Aliases for BigDecimal methods.\n //P.add = P.plus; // P.add included above\n //P.subtract = P.minus; // P.sub included above\n //P.multiply = P.times; // P.mul included above\n //P.divide = P.div;\n //P.remainder = P.mod;\n //P.compareTo = P.cmp;\n //P.negate = P.neg;\n\n\n if ( configObj != null ) BigNumber.config(configObj);\n\n return BigNumber;\n }\n\n\n // PRIVATE HELPER FUNCTIONS\n\n\n function bitFloor(n) {\n var i = n | 0;\n return n > 0 || n === i ? i : i - 1;\n }\n\n\n // Return a coefficient array as a string of base 10 digits.\n function coeffToString(a) {\n var s, z,\n i = 1,\n j = a.length,\n r = a[0] + '';\n\n for ( ; i < j; ) {\n s = a[i++] + '';\n z = LOG_BASE - s.length;\n for ( ; z--; s = '0' + s );\n r += s;\n }\n\n // Determine trailing zeros.\n for ( j = r.length; r.charCodeAt(--j) === 48; );\n return r.slice( 0, j + 1 || 1 );\n }\n\n\n // Compare the value of BigNumbers x and y.\n function compare( x, y ) {\n var a, b,\n xc = x.c,\n yc = y.c,\n i = x.s,\n j = y.s,\n k = x.e,\n l = y.e;\n\n // Either NaN?\n if ( !i || !j ) return null;\n\n a = xc && !xc[0];\n b = yc && !yc[0];\n\n // Either zero?\n if ( a || b ) return a ? b ? 0 : -j : i;\n\n // Signs differ?\n if ( i != j ) return i;\n\n a = i < 0;\n b = k == l;\n\n // Either Infinity?\n if ( !xc || !yc ) return b ? 0 : !xc ^ a ? 1 : -1;\n\n // Compare exponents.\n if ( !b ) return k > l ^ a ? 1 : -1;\n\n j = ( k = xc.length ) < ( l = yc.length ) ? k : l;\n\n // Compare digit by digit.\n for ( i = 0; i < j; i++ ) if ( xc[i] != yc[i] ) return xc[i] > yc[i] ^ a ? 1 : -1;\n\n // Compare lengths.\n return k == l ? 0 : k > l ^ a ? 1 : -1;\n }\n\n\n /*\n * Return true if n is a valid number in range, otherwise false.\n * Use for argument validation when ERRORS is false.\n * Note: parseInt('1e+1') == 1 but parseFloat('1e+1') == 10.\n */\n function intValidatorNoErrors( n, min, max ) {\n return ( n = truncate(n) ) >= min && n <= max;\n }\n\n\n function isArray(obj) {\n return Object.prototype.toString.call(obj) == '[object Array]';\n }\n\n\n /*\n * Convert string of baseIn to an array of numbers of baseOut.\n * Eg. convertBase('255', 10, 16) returns [15, 15].\n * Eg. convertBase('ff', 16, 10) returns [2, 5, 5].\n */\n function toBaseOut( str, baseIn, baseOut ) {\n var j,\n arr = [0],\n arrL,\n i = 0,\n len = str.length;\n\n for ( ; i < len; ) {\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\n\n for ( ; j < arr.length; j++ ) {\n\n if ( arr[j] > baseOut - 1 ) {\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\n arr[j + 1] += arr[j] / baseOut | 0;\n arr[j] %= baseOut;\n }\n }\n }\n\n return arr.reverse();\n }\n\n\n function toExponential( str, e ) {\n return ( str.length > 1 ? str.charAt(0) + '.' + str.slice(1) : str ) +\n ( e < 0 ? 'e' : 'e+' ) + e;\n }\n\n\n function toFixedPoint( str, e ) {\n var len, z;\n\n // Negative exponent?\n if ( e < 0 ) {\n\n // Prepend zeros.\n for ( z = '0.'; ++e; z += '0' );\n str = z + str;\n\n // Positive exponent\n } else {\n len = str.length;\n\n // Append zeros.\n if ( ++e > len ) {\n for ( z = '0', e -= len; --e; z += '0' );\n str += z;\n } else if ( e < len ) {\n str = str.slice( 0, e ) + '.' + str.slice(e);\n }\n }\n\n return str;\n }\n\n\n function truncate(n) {\n n = parseFloat(n);\n return n < 0 ? mathceil(n) : mathfloor(n);\n }\n\n\n // EXPORT\n\n\n BigNumber = another();\n\n // AMD.\n if ( typeof define == 'function' && define.amd ) {\n define( function () { return BigNumber; } );\n\n // Node and other environments that support module.exports.\n } else if ( typeof module != 'undefined' && module.exports ) {\n module.exports = BigNumber;\n if ( !crypto ) try { crypto = require('crypto'); } catch (e) {}\n\n // Browser.\n } else {\n global.BigNumber = BigNumber;\n }\n})(this);\n","(function (module, exports) {\n 'use strict';\n\n // Utils\n function assert (val, msg) {\n if (!val) throw new Error(msg || 'Assertion failed');\n }\n\n // Could use `inherits` module, but don't want to move from single file\n // architecture yet.\n function inherits (ctor, superCtor) {\n ctor.super_ = superCtor;\n var TempCtor = function () {};\n TempCtor.prototype = superCtor.prototype;\n ctor.prototype = new TempCtor();\n ctor.prototype.constructor = ctor;\n }\n\n // BN\n\n function BN (number, base, endian) {\n if (BN.isBN(number)) {\n return number;\n }\n\n this.negative = 0;\n this.words = null;\n this.length = 0;\n\n // Reduction context\n this.red = null;\n\n if (number !== null) {\n if (base === 'le' || base === 'be') {\n endian = base;\n base = 10;\n }\n\n this._init(number || 0, base || 10, endian || 'be');\n }\n }\n if (typeof module === 'object') {\n module.exports = BN;\n } else {\n exports.BN = BN;\n }\n\n BN.BN = BN;\n BN.wordSize = 26;\n\n var Buffer;\n try {\n Buffer = require('buffer').Buffer;\n } catch (e) {\n }\n\n BN.isBN = function isBN (num) {\n if (num instanceof BN) {\n return true;\n }\n\n return num !== null && typeof num === 'object' &&\n num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);\n };\n\n BN.max = function max (left, right) {\n if (left.cmp(right) > 0) return left;\n return right;\n };\n\n BN.min = function min (left, right) {\n if (left.cmp(right) < 0) return left;\n return right;\n };\n\n BN.prototype._init = function init (number, base, endian) {\n if (typeof number === 'number') {\n return this._initNumber(number, base, endian);\n }\n\n if (typeof number === 'object') {\n return this._initArray(number, base, endian);\n }\n\n if (base === 'hex') {\n base = 16;\n }\n assert(base === (base | 0) && base >= 2 && base <= 36);\n\n number = number.toString().replace(/\\s+/g, '');\n var start = 0;\n if (number[0] === '-') {\n start++;\n }\n\n if (base === 16) {\n this._parseHex(number, start);\n } else {\n this._parseBase(number, base, start);\n }\n\n if (number[0] === '-') {\n this.negative = 1;\n }\n\n this.strip();\n\n if (endian !== 'le') return;\n\n this._initArray(this.toArray(), base, endian);\n };\n\n BN.prototype._initNumber = function _initNumber (number, base, endian) {\n if (number < 0) {\n this.negative = 1;\n number = -number;\n }\n if (number < 0x4000000) {\n this.words = [ number & 0x3ffffff ];\n this.length = 1;\n } else if (number < 0x10000000000000) {\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff\n ];\n this.length = 2;\n } else {\n assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff,\n 1\n ];\n this.length = 3;\n }\n\n if (endian !== 'le') return;\n\n // Reverse the bytes\n this._initArray(this.toArray(), base, endian);\n };\n\n BN.prototype._initArray = function _initArray (number, base, endian) {\n // Perhaps a Uint8Array\n assert(typeof number.length === 'number');\n if (number.length <= 0) {\n this.words = [ 0 ];\n this.length = 1;\n return this;\n }\n\n this.length = Math.ceil(number.length / 3);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n var j, w;\n var off = 0;\n if (endian === 'be') {\n for (i = number.length - 1, j = 0; i >= 0; i -= 3) {\n w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n } else if (endian === 'le') {\n for (i = 0, j = 0; i < number.length; i += 3) {\n w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n }\n return this.strip();\n };\n\n function parseHex (str, start, end) {\n var r = 0;\n var len = Math.min(str.length, end);\n for (var i = start; i < len; i++) {\n var c = str.charCodeAt(i) - 48;\n\n r <<= 4;\n\n // 'a' - 'f'\n if (c >= 49 && c <= 54) {\n r |= c - 49 + 0xa;\n\n // 'A' - 'F'\n } else if (c >= 17 && c <= 22) {\n r |= c - 17 + 0xa;\n\n // '0' - '9'\n } else {\n r |= c & 0xf;\n }\n }\n return r;\n }\n\n BN.prototype._parseHex = function _parseHex (number, start) {\n // Create possibly bigger array to ensure that it fits the number\n this.length = Math.ceil((number.length - start) / 6);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n var j, w;\n // Scan 24-bit chunks and add them to the number\n var off = 0;\n for (i = number.length - 6, j = 0; i >= start; i -= 6) {\n w = parseHex(number, i, i + 6);\n this.words[j] |= (w << off) & 0x3ffffff;\n // NOTE: `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb\n this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n if (i + 6 !== start) {\n w = parseHex(number, start, i + 6);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;\n }\n this.strip();\n };\n\n function parseBase (str, start, end, mul) {\n var r = 0;\n var len = Math.min(str.length, end);\n for (var i = start; i < len; i++) {\n var c = str.charCodeAt(i) - 48;\n\n r *= mul;\n\n // 'a'\n if (c >= 49) {\n r += c - 49 + 0xa;\n\n // 'A'\n } else if (c >= 17) {\n r += c - 17 + 0xa;\n\n // '0' - '9'\n } else {\n r += c;\n }\n }\n return r;\n }\n\n BN.prototype._parseBase = function _parseBase (number, base, start) {\n // Initialize as zero\n this.words = [ 0 ];\n this.length = 1;\n\n // Find length of limb in base\n for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {\n limbLen++;\n }\n limbLen--;\n limbPow = (limbPow / base) | 0;\n\n var total = number.length - start;\n var mod = total % limbLen;\n var end = Math.min(total, total - mod) + start;\n\n var word = 0;\n for (var i = start; i < end; i += limbLen) {\n word = parseBase(number, i, i + limbLen, base);\n\n this.imuln(limbPow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n if (mod !== 0) {\n var pow = 1;\n word = parseBase(number, i, number.length, base);\n\n for (i = 0; i < mod; i++) {\n pow *= base;\n }\n\n this.imuln(pow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n };\n\n BN.prototype.copy = function copy (dest) {\n dest.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n dest.words[i] = this.words[i];\n }\n dest.length = this.length;\n dest.negative = this.negative;\n dest.red = this.red;\n };\n\n BN.prototype.clone = function clone () {\n var r = new BN(null);\n this.copy(r);\n return r;\n };\n\n BN.prototype._expand = function _expand (size) {\n while (this.length < size) {\n this.words[this.length++] = 0;\n }\n return this;\n };\n\n // Remove leading `0` from `this`\n BN.prototype.strip = function strip () {\n while (this.length > 1 && this.words[this.length - 1] === 0) {\n this.length--;\n }\n return this._normSign();\n };\n\n BN.prototype._normSign = function _normSign () {\n // -0 = 0\n if (this.length === 1 && this.words[0] === 0) {\n this.negative = 0;\n }\n return this;\n };\n\n BN.prototype.inspect = function inspect () {\n return (this.red ? '';\n };\n\n /*\n\n var zeros = [];\n var groupSizes = [];\n var groupBases = [];\n\n var s = '';\n var i = -1;\n while (++i < BN.wordSize) {\n zeros[i] = s;\n s += '0';\n }\n groupSizes[0] = 0;\n groupSizes[1] = 0;\n groupBases[0] = 0;\n groupBases[1] = 0;\n var base = 2 - 1;\n while (++base < 36 + 1) {\n var groupSize = 0;\n var groupBase = 1;\n while (groupBase < (1 << BN.wordSize) / base) {\n groupBase *= base;\n groupSize += 1;\n }\n groupSizes[base] = groupSize;\n groupBases[base] = groupBase;\n }\n\n */\n\n var zeros = [\n '',\n '0',\n '00',\n '000',\n '0000',\n '00000',\n '000000',\n '0000000',\n '00000000',\n '000000000',\n '0000000000',\n '00000000000',\n '000000000000',\n '0000000000000',\n '00000000000000',\n '000000000000000',\n '0000000000000000',\n '00000000000000000',\n '000000000000000000',\n '0000000000000000000',\n '00000000000000000000',\n '000000000000000000000',\n '0000000000000000000000',\n '00000000000000000000000',\n '000000000000000000000000',\n '0000000000000000000000000'\n ];\n\n var groupSizes = [\n 0, 0,\n 25, 16, 12, 11, 10, 9, 8,\n 8, 7, 7, 7, 7, 6, 6,\n 6, 6, 6, 6, 6, 5, 5,\n 5, 5, 5, 5, 5, 5, 5,\n 5, 5, 5, 5, 5, 5, 5\n ];\n\n var groupBases = [\n 0, 0,\n 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,\n 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,\n 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,\n 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,\n 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176\n ];\n\n BN.prototype.toString = function toString (base, padding) {\n base = base || 10;\n padding = padding | 0 || 1;\n\n var out;\n if (base === 16 || base === 'hex') {\n out = '';\n var off = 0;\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = this.words[i];\n var word = (((w << off) | carry) & 0xffffff).toString(16);\n carry = (w >>> (24 - off)) & 0xffffff;\n if (carry !== 0 || i !== this.length - 1) {\n out = zeros[6 - word.length] + word + out;\n } else {\n out = word + out;\n }\n off += 2;\n if (off >= 26) {\n off -= 26;\n i--;\n }\n }\n if (carry !== 0) {\n out = carry.toString(16) + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n if (base === (base | 0) && base >= 2 && base <= 36) {\n // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));\n var groupSize = groupSizes[base];\n // var groupBase = Math.pow(base, groupSize);\n var groupBase = groupBases[base];\n out = '';\n var c = this.clone();\n c.negative = 0;\n while (!c.isZero()) {\n var r = c.modn(groupBase).toString(base);\n c = c.idivn(groupBase);\n\n if (!c.isZero()) {\n out = zeros[groupSize - r.length] + r + out;\n } else {\n out = r + out;\n }\n }\n if (this.isZero()) {\n out = '0' + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n assert(false, 'Base should be between 2 and 36');\n };\n\n BN.prototype.toNumber = function toNumber () {\n var ret = this.words[0];\n if (this.length === 2) {\n ret += this.words[1] * 0x4000000;\n } else if (this.length === 3 && this.words[2] === 0x01) {\n // NOTE: at this stage it is known that the top bit is set\n ret += 0x10000000000000 + (this.words[1] * 0x4000000);\n } else if (this.length > 2) {\n assert(false, 'Number can only safely store up to 53 bits');\n }\n return (this.negative !== 0) ? -ret : ret;\n };\n\n BN.prototype.toJSON = function toJSON () {\n return this.toString(16);\n };\n\n BN.prototype.toBuffer = function toBuffer (endian, length) {\n assert(typeof Buffer !== 'undefined');\n return this.toArrayLike(Buffer, endian, length);\n };\n\n BN.prototype.toArray = function toArray (endian, length) {\n return this.toArrayLike(Array, endian, length);\n };\n\n BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {\n var byteLength = this.byteLength();\n var reqLength = length || Math.max(1, byteLength);\n assert(byteLength <= reqLength, 'byte array longer than desired length');\n assert(reqLength > 0, 'Requested array length <= 0');\n\n this.strip();\n var littleEndian = endian === 'le';\n var res = new ArrayType(reqLength);\n\n var b, i;\n var q = this.clone();\n if (!littleEndian) {\n // Assume big-endian\n for (i = 0; i < reqLength - byteLength; i++) {\n res[i] = 0;\n }\n\n for (i = 0; !q.isZero(); i++) {\n b = q.andln(0xff);\n q.iushrn(8);\n\n res[reqLength - i - 1] = b;\n }\n } else {\n for (i = 0; !q.isZero(); i++) {\n b = q.andln(0xff);\n q.iushrn(8);\n\n res[i] = b;\n }\n\n for (; i < reqLength; i++) {\n res[i] = 0;\n }\n }\n\n return res;\n };\n\n if (Math.clz32) {\n BN.prototype._countBits = function _countBits (w) {\n return 32 - Math.clz32(w);\n };\n } else {\n BN.prototype._countBits = function _countBits (w) {\n var t = w;\n var r = 0;\n if (t >= 0x1000) {\n r += 13;\n t >>>= 13;\n }\n if (t >= 0x40) {\n r += 7;\n t >>>= 7;\n }\n if (t >= 0x8) {\n r += 4;\n t >>>= 4;\n }\n if (t >= 0x02) {\n r += 2;\n t >>>= 2;\n }\n return r + t;\n };\n }\n\n BN.prototype._zeroBits = function _zeroBits (w) {\n // Short-cut\n if (w === 0) return 26;\n\n var t = w;\n var r = 0;\n if ((t & 0x1fff) === 0) {\n r += 13;\n t >>>= 13;\n }\n if ((t & 0x7f) === 0) {\n r += 7;\n t >>>= 7;\n }\n if ((t & 0xf) === 0) {\n r += 4;\n t >>>= 4;\n }\n if ((t & 0x3) === 0) {\n r += 2;\n t >>>= 2;\n }\n if ((t & 0x1) === 0) {\n r++;\n }\n return r;\n };\n\n // Return number of used bits in a BN\n BN.prototype.bitLength = function bitLength () {\n var w = this.words[this.length - 1];\n var hi = this._countBits(w);\n return (this.length - 1) * 26 + hi;\n };\n\n function toBitArray (num) {\n var w = new Array(num.bitLength());\n\n for (var bit = 0; bit < w.length; bit++) {\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n w[bit] = (num.words[off] & (1 << wbit)) >>> wbit;\n }\n\n return w;\n }\n\n // Number of trailing zero bits\n BN.prototype.zeroBits = function zeroBits () {\n if (this.isZero()) return 0;\n\n var r = 0;\n for (var i = 0; i < this.length; i++) {\n var b = this._zeroBits(this.words[i]);\n r += b;\n if (b !== 26) break;\n }\n return r;\n };\n\n BN.prototype.byteLength = function byteLength () {\n return Math.ceil(this.bitLength() / 8);\n };\n\n BN.prototype.toTwos = function toTwos (width) {\n if (this.negative !== 0) {\n return this.abs().inotn(width).iaddn(1);\n }\n return this.clone();\n };\n\n BN.prototype.fromTwos = function fromTwos (width) {\n if (this.testn(width - 1)) {\n return this.notn(width).iaddn(1).ineg();\n }\n return this.clone();\n };\n\n BN.prototype.isNeg = function isNeg () {\n return this.negative !== 0;\n };\n\n // Return negative clone of `this`\n BN.prototype.neg = function neg () {\n return this.clone().ineg();\n };\n\n BN.prototype.ineg = function ineg () {\n if (!this.isZero()) {\n this.negative ^= 1;\n }\n\n return this;\n };\n\n // Or `num` with `this` in-place\n BN.prototype.iuor = function iuor (num) {\n while (this.length < num.length) {\n this.words[this.length++] = 0;\n }\n\n for (var i = 0; i < num.length; i++) {\n this.words[i] = this.words[i] | num.words[i];\n }\n\n return this.strip();\n };\n\n BN.prototype.ior = function ior (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuor(num);\n };\n\n // Or `num` with `this`\n BN.prototype.or = function or (num) {\n if (this.length > num.length) return this.clone().ior(num);\n return num.clone().ior(this);\n };\n\n BN.prototype.uor = function uor (num) {\n if (this.length > num.length) return this.clone().iuor(num);\n return num.clone().iuor(this);\n };\n\n // And `num` with `this` in-place\n BN.prototype.iuand = function iuand (num) {\n // b = min-length(num, this)\n var b;\n if (this.length > num.length) {\n b = num;\n } else {\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = this.words[i] & num.words[i];\n }\n\n this.length = b.length;\n\n return this.strip();\n };\n\n BN.prototype.iand = function iand (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuand(num);\n };\n\n // And `num` with `this`\n BN.prototype.and = function and (num) {\n if (this.length > num.length) return this.clone().iand(num);\n return num.clone().iand(this);\n };\n\n BN.prototype.uand = function uand (num) {\n if (this.length > num.length) return this.clone().iuand(num);\n return num.clone().iuand(this);\n };\n\n // Xor `num` with `this` in-place\n BN.prototype.iuxor = function iuxor (num) {\n // a.length > b.length\n var a;\n var b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = a.words[i] ^ b.words[i];\n }\n\n if (this !== a) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = a.length;\n\n return this.strip();\n };\n\n BN.prototype.ixor = function ixor (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuxor(num);\n };\n\n // Xor `num` with `this`\n BN.prototype.xor = function xor (num) {\n if (this.length > num.length) return this.clone().ixor(num);\n return num.clone().ixor(this);\n };\n\n BN.prototype.uxor = function uxor (num) {\n if (this.length > num.length) return this.clone().iuxor(num);\n return num.clone().iuxor(this);\n };\n\n // Not ``this`` with ``width`` bitwidth\n BN.prototype.inotn = function inotn (width) {\n assert(typeof width === 'number' && width >= 0);\n\n var bytesNeeded = Math.ceil(width / 26) | 0;\n var bitsLeft = width % 26;\n\n // Extend the buffer with leading zeroes\n this._expand(bytesNeeded);\n\n if (bitsLeft > 0) {\n bytesNeeded--;\n }\n\n // Handle complete words\n for (var i = 0; i < bytesNeeded; i++) {\n this.words[i] = ~this.words[i] & 0x3ffffff;\n }\n\n // Handle the residue\n if (bitsLeft > 0) {\n this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));\n }\n\n // And remove leading zeroes\n return this.strip();\n };\n\n BN.prototype.notn = function notn (width) {\n return this.clone().inotn(width);\n };\n\n // Set `bit` of `this`\n BN.prototype.setn = function setn (bit, val) {\n assert(typeof bit === 'number' && bit >= 0);\n\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n this._expand(off + 1);\n\n if (val) {\n this.words[off] = this.words[off] | (1 << wbit);\n } else {\n this.words[off] = this.words[off] & ~(1 << wbit);\n }\n\n return this.strip();\n };\n\n // Add `num` to `this` in-place\n BN.prototype.iadd = function iadd (num) {\n var r;\n\n // negative + positive\n if (this.negative !== 0 && num.negative === 0) {\n this.negative = 0;\n r = this.isub(num);\n this.negative ^= 1;\n return this._normSign();\n\n // positive + negative\n } else if (this.negative === 0 && num.negative !== 0) {\n num.negative = 0;\n r = this.isub(num);\n num.negative = 1;\n return r._normSign();\n }\n\n // a.length > b.length\n var a, b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n\n this.length = a.length;\n if (carry !== 0) {\n this.words[this.length] = carry;\n this.length++;\n // Copy the rest of the words\n } else if (a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n return this;\n };\n\n // Add `num` to `this`\n BN.prototype.add = function add (num) {\n var res;\n if (num.negative !== 0 && this.negative === 0) {\n num.negative = 0;\n res = this.sub(num);\n num.negative ^= 1;\n return res;\n } else if (num.negative === 0 && this.negative !== 0) {\n this.negative = 0;\n res = num.sub(this);\n this.negative = 1;\n return res;\n }\n\n if (this.length > num.length) return this.clone().iadd(num);\n\n return num.clone().iadd(this);\n };\n\n // Subtract `num` from `this` in-place\n BN.prototype.isub = function isub (num) {\n // this - (-num) = this + num\n if (num.negative !== 0) {\n num.negative = 0;\n var r = this.iadd(num);\n num.negative = 1;\n return r._normSign();\n\n // -this - num = -(this + num)\n } else if (this.negative !== 0) {\n this.negative = 0;\n this.iadd(num);\n this.negative = 1;\n return this._normSign();\n }\n\n // At this point both numbers are positive\n var cmp = this.cmp(num);\n\n // Optimization - zeroify\n if (cmp === 0) {\n this.negative = 0;\n this.length = 1;\n this.words[0] = 0;\n return this;\n }\n\n // a > b\n var a, b;\n if (cmp > 0) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n\n // Copy rest of the words\n if (carry === 0 && i < a.length && a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = Math.max(this.length, i);\n\n if (a !== this) {\n this.negative = 1;\n }\n\n return this.strip();\n };\n\n // Subtract `num` from `this`\n BN.prototype.sub = function sub (num) {\n return this.clone().isub(num);\n };\n\n function smallMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n var len = (self.length + num.length) | 0;\n out.length = len;\n len = (len - 1) | 0;\n\n // Peel one iteration (compiler can't do it, because of code complexity)\n var a = self.words[0] | 0;\n var b = num.words[0] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n var carry = (r / 0x4000000) | 0;\n out.words[0] = lo;\n\n for (var k = 1; k < len; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = carry >>> 26;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = (k - j) | 0;\n a = self.words[i] | 0;\n b = num.words[j] | 0;\n r = a * b + rword;\n ncarry += (r / 0x4000000) | 0;\n rword = r & 0x3ffffff;\n }\n out.words[k] = rword | 0;\n carry = ncarry | 0;\n }\n if (carry !== 0) {\n out.words[k] = carry | 0;\n } else {\n out.length--;\n }\n\n return out.strip();\n }\n\n // TODO(indutny): it may be reasonable to omit it for users who don't need\n // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit\n // multiplication (like elliptic secp256k1).\n var comb10MulTo = function comb10MulTo (self, num, out) {\n var a = self.words;\n var b = num.words;\n var o = out.words;\n var c = 0;\n var lo;\n var mid;\n var hi;\n var a0 = a[0] | 0;\n var al0 = a0 & 0x1fff;\n var ah0 = a0 >>> 13;\n var a1 = a[1] | 0;\n var al1 = a1 & 0x1fff;\n var ah1 = a1 >>> 13;\n var a2 = a[2] | 0;\n var al2 = a2 & 0x1fff;\n var ah2 = a2 >>> 13;\n var a3 = a[3] | 0;\n var al3 = a3 & 0x1fff;\n var ah3 = a3 >>> 13;\n var a4 = a[4] | 0;\n var al4 = a4 & 0x1fff;\n var ah4 = a4 >>> 13;\n var a5 = a[5] | 0;\n var al5 = a5 & 0x1fff;\n var ah5 = a5 >>> 13;\n var a6 = a[6] | 0;\n var al6 = a6 & 0x1fff;\n var ah6 = a6 >>> 13;\n var a7 = a[7] | 0;\n var al7 = a7 & 0x1fff;\n var ah7 = a7 >>> 13;\n var a8 = a[8] | 0;\n var al8 = a8 & 0x1fff;\n var ah8 = a8 >>> 13;\n var a9 = a[9] | 0;\n var al9 = a9 & 0x1fff;\n var ah9 = a9 >>> 13;\n var b0 = b[0] | 0;\n var bl0 = b0 & 0x1fff;\n var bh0 = b0 >>> 13;\n var b1 = b[1] | 0;\n var bl1 = b1 & 0x1fff;\n var bh1 = b1 >>> 13;\n var b2 = b[2] | 0;\n var bl2 = b2 & 0x1fff;\n var bh2 = b2 >>> 13;\n var b3 = b[3] | 0;\n var bl3 = b3 & 0x1fff;\n var bh3 = b3 >>> 13;\n var b4 = b[4] | 0;\n var bl4 = b4 & 0x1fff;\n var bh4 = b4 >>> 13;\n var b5 = b[5] | 0;\n var bl5 = b5 & 0x1fff;\n var bh5 = b5 >>> 13;\n var b6 = b[6] | 0;\n var bl6 = b6 & 0x1fff;\n var bh6 = b6 >>> 13;\n var b7 = b[7] | 0;\n var bl7 = b7 & 0x1fff;\n var bh7 = b7 >>> 13;\n var b8 = b[8] | 0;\n var bl8 = b8 & 0x1fff;\n var bh8 = b8 >>> 13;\n var b9 = b[9] | 0;\n var bl9 = b9 & 0x1fff;\n var bh9 = b9 >>> 13;\n\n out.negative = self.negative ^ num.negative;\n out.length = 19;\n /* k = 0 */\n lo = Math.imul(al0, bl0);\n mid = Math.imul(al0, bh0);\n mid = (mid + Math.imul(ah0, bl0)) | 0;\n hi = Math.imul(ah0, bh0);\n var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\n w0 &= 0x3ffffff;\n /* k = 1 */\n lo = Math.imul(al1, bl0);\n mid = Math.imul(al1, bh0);\n mid = (mid + Math.imul(ah1, bl0)) | 0;\n hi = Math.imul(ah1, bh0);\n lo = (lo + Math.imul(al0, bl1)) | 0;\n mid = (mid + Math.imul(al0, bh1)) | 0;\n mid = (mid + Math.imul(ah0, bl1)) | 0;\n hi = (hi + Math.imul(ah0, bh1)) | 0;\n var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\n w1 &= 0x3ffffff;\n /* k = 2 */\n lo = Math.imul(al2, bl0);\n mid = Math.imul(al2, bh0);\n mid = (mid + Math.imul(ah2, bl0)) | 0;\n hi = Math.imul(ah2, bh0);\n lo = (lo + Math.imul(al1, bl1)) | 0;\n mid = (mid + Math.imul(al1, bh1)) | 0;\n mid = (mid + Math.imul(ah1, bl1)) | 0;\n hi = (hi + Math.imul(ah1, bh1)) | 0;\n lo = (lo + Math.imul(al0, bl2)) | 0;\n mid = (mid + Math.imul(al0, bh2)) | 0;\n mid = (mid + Math.imul(ah0, bl2)) | 0;\n hi = (hi + Math.imul(ah0, bh2)) | 0;\n var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\n w2 &= 0x3ffffff;\n /* k = 3 */\n lo = Math.imul(al3, bl0);\n mid = Math.imul(al3, bh0);\n mid = (mid + Math.imul(ah3, bl0)) | 0;\n hi = Math.imul(ah3, bh0);\n lo = (lo + Math.imul(al2, bl1)) | 0;\n mid = (mid + Math.imul(al2, bh1)) | 0;\n mid = (mid + Math.imul(ah2, bl1)) | 0;\n hi = (hi + Math.imul(ah2, bh1)) | 0;\n lo = (lo + Math.imul(al1, bl2)) | 0;\n mid = (mid + Math.imul(al1, bh2)) | 0;\n mid = (mid + Math.imul(ah1, bl2)) | 0;\n hi = (hi + Math.imul(ah1, bh2)) | 0;\n lo = (lo + Math.imul(al0, bl3)) | 0;\n mid = (mid + Math.imul(al0, bh3)) | 0;\n mid = (mid + Math.imul(ah0, bl3)) | 0;\n hi = (hi + Math.imul(ah0, bh3)) | 0;\n var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\n w3 &= 0x3ffffff;\n /* k = 4 */\n lo = Math.imul(al4, bl0);\n mid = Math.imul(al4, bh0);\n mid = (mid + Math.imul(ah4, bl0)) | 0;\n hi = Math.imul(ah4, bh0);\n lo = (lo + Math.imul(al3, bl1)) | 0;\n mid = (mid + Math.imul(al3, bh1)) | 0;\n mid = (mid + Math.imul(ah3, bl1)) | 0;\n hi = (hi + Math.imul(ah3, bh1)) | 0;\n lo = (lo + Math.imul(al2, bl2)) | 0;\n mid = (mid + Math.imul(al2, bh2)) | 0;\n mid = (mid + Math.imul(ah2, bl2)) | 0;\n hi = (hi + Math.imul(ah2, bh2)) | 0;\n lo = (lo + Math.imul(al1, bl3)) | 0;\n mid = (mid + Math.imul(al1, bh3)) | 0;\n mid = (mid + Math.imul(ah1, bl3)) | 0;\n hi = (hi + Math.imul(ah1, bh3)) | 0;\n lo = (lo + Math.imul(al0, bl4)) | 0;\n mid = (mid + Math.imul(al0, bh4)) | 0;\n mid = (mid + Math.imul(ah0, bl4)) | 0;\n hi = (hi + Math.imul(ah0, bh4)) | 0;\n var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\n w4 &= 0x3ffffff;\n /* k = 5 */\n lo = Math.imul(al5, bl0);\n mid = Math.imul(al5, bh0);\n mid = (mid + Math.imul(ah5, bl0)) | 0;\n hi = Math.imul(ah5, bh0);\n lo = (lo + Math.imul(al4, bl1)) | 0;\n mid = (mid + Math.imul(al4, bh1)) | 0;\n mid = (mid + Math.imul(ah4, bl1)) | 0;\n hi = (hi + Math.imul(ah4, bh1)) | 0;\n lo = (lo + Math.imul(al3, bl2)) | 0;\n mid = (mid + Math.imul(al3, bh2)) | 0;\n mid = (mid + Math.imul(ah3, bl2)) | 0;\n hi = (hi + Math.imul(ah3, bh2)) | 0;\n lo = (lo + Math.imul(al2, bl3)) | 0;\n mid = (mid + Math.imul(al2, bh3)) | 0;\n mid = (mid + Math.imul(ah2, bl3)) | 0;\n hi = (hi + Math.imul(ah2, bh3)) | 0;\n lo = (lo + Math.imul(al1, bl4)) | 0;\n mid = (mid + Math.imul(al1, bh4)) | 0;\n mid = (mid + Math.imul(ah1, bl4)) | 0;\n hi = (hi + Math.imul(ah1, bh4)) | 0;\n lo = (lo + Math.imul(al0, bl5)) | 0;\n mid = (mid + Math.imul(al0, bh5)) | 0;\n mid = (mid + Math.imul(ah0, bl5)) | 0;\n hi = (hi + Math.imul(ah0, bh5)) | 0;\n var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\n w5 &= 0x3ffffff;\n /* k = 6 */\n lo = Math.imul(al6, bl0);\n mid = Math.imul(al6, bh0);\n mid = (mid + Math.imul(ah6, bl0)) | 0;\n hi = Math.imul(ah6, bh0);\n lo = (lo + Math.imul(al5, bl1)) | 0;\n mid = (mid + Math.imul(al5, bh1)) | 0;\n mid = (mid + Math.imul(ah5, bl1)) | 0;\n hi = (hi + Math.imul(ah5, bh1)) | 0;\n lo = (lo + Math.imul(al4, bl2)) | 0;\n mid = (mid + Math.imul(al4, bh2)) | 0;\n mid = (mid + Math.imul(ah4, bl2)) | 0;\n hi = (hi + Math.imul(ah4, bh2)) | 0;\n lo = (lo + Math.imul(al3, bl3)) | 0;\n mid = (mid + Math.imul(al3, bh3)) | 0;\n mid = (mid + Math.imul(ah3, bl3)) | 0;\n hi = (hi + Math.imul(ah3, bh3)) | 0;\n lo = (lo + Math.imul(al2, bl4)) | 0;\n mid = (mid + Math.imul(al2, bh4)) | 0;\n mid = (mid + Math.imul(ah2, bl4)) | 0;\n hi = (hi + Math.imul(ah2, bh4)) | 0;\n lo = (lo + Math.imul(al1, bl5)) | 0;\n mid = (mid + Math.imul(al1, bh5)) | 0;\n mid = (mid + Math.imul(ah1, bl5)) | 0;\n hi = (hi + Math.imul(ah1, bh5)) | 0;\n lo = (lo + Math.imul(al0, bl6)) | 0;\n mid = (mid + Math.imul(al0, bh6)) | 0;\n mid = (mid + Math.imul(ah0, bl6)) | 0;\n hi = (hi + Math.imul(ah0, bh6)) | 0;\n var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\n w6 &= 0x3ffffff;\n /* k = 7 */\n lo = Math.imul(al7, bl0);\n mid = Math.imul(al7, bh0);\n mid = (mid + Math.imul(ah7, bl0)) | 0;\n hi = Math.imul(ah7, bh0);\n lo = (lo + Math.imul(al6, bl1)) | 0;\n mid = (mid + Math.imul(al6, bh1)) | 0;\n mid = (mid + Math.imul(ah6, bl1)) | 0;\n hi = (hi + Math.imul(ah6, bh1)) | 0;\n lo = (lo + Math.imul(al5, bl2)) | 0;\n mid = (mid + Math.imul(al5, bh2)) | 0;\n mid = (mid + Math.imul(ah5, bl2)) | 0;\n hi = (hi + Math.imul(ah5, bh2)) | 0;\n lo = (lo + Math.imul(al4, bl3)) | 0;\n mid = (mid + Math.imul(al4, bh3)) | 0;\n mid = (mid + Math.imul(ah4, bl3)) | 0;\n hi = (hi + Math.imul(ah4, bh3)) | 0;\n lo = (lo + Math.imul(al3, bl4)) | 0;\n mid = (mid + Math.imul(al3, bh4)) | 0;\n mid = (mid + Math.imul(ah3, bl4)) | 0;\n hi = (hi + Math.imul(ah3, bh4)) | 0;\n lo = (lo + Math.imul(al2, bl5)) | 0;\n mid = (mid + Math.imul(al2, bh5)) | 0;\n mid = (mid + Math.imul(ah2, bl5)) | 0;\n hi = (hi + Math.imul(ah2, bh5)) | 0;\n lo = (lo + Math.imul(al1, bl6)) | 0;\n mid = (mid + Math.imul(al1, bh6)) | 0;\n mid = (mid + Math.imul(ah1, bl6)) | 0;\n hi = (hi + Math.imul(ah1, bh6)) | 0;\n lo = (lo + Math.imul(al0, bl7)) | 0;\n mid = (mid + Math.imul(al0, bh7)) | 0;\n mid = (mid + Math.imul(ah0, bl7)) | 0;\n hi = (hi + Math.imul(ah0, bh7)) | 0;\n var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\n w7 &= 0x3ffffff;\n /* k = 8 */\n lo = Math.imul(al8, bl0);\n mid = Math.imul(al8, bh0);\n mid = (mid + Math.imul(ah8, bl0)) | 0;\n hi = Math.imul(ah8, bh0);\n lo = (lo + Math.imul(al7, bl1)) | 0;\n mid = (mid + Math.imul(al7, bh1)) | 0;\n mid = (mid + Math.imul(ah7, bl1)) | 0;\n hi = (hi + Math.imul(ah7, bh1)) | 0;\n lo = (lo + Math.imul(al6, bl2)) | 0;\n mid = (mid + Math.imul(al6, bh2)) | 0;\n mid = (mid + Math.imul(ah6, bl2)) | 0;\n hi = (hi + Math.imul(ah6, bh2)) | 0;\n lo = (lo + Math.imul(al5, bl3)) | 0;\n mid = (mid + Math.imul(al5, bh3)) | 0;\n mid = (mid + Math.imul(ah5, bl3)) | 0;\n hi = (hi + Math.imul(ah5, bh3)) | 0;\n lo = (lo + Math.imul(al4, bl4)) | 0;\n mid = (mid + Math.imul(al4, bh4)) | 0;\n mid = (mid + Math.imul(ah4, bl4)) | 0;\n hi = (hi + Math.imul(ah4, bh4)) | 0;\n lo = (lo + Math.imul(al3, bl5)) | 0;\n mid = (mid + Math.imul(al3, bh5)) | 0;\n mid = (mid + Math.imul(ah3, bl5)) | 0;\n hi = (hi + Math.imul(ah3, bh5)) | 0;\n lo = (lo + Math.imul(al2, bl6)) | 0;\n mid = (mid + Math.imul(al2, bh6)) | 0;\n mid = (mid + Math.imul(ah2, bl6)) | 0;\n hi = (hi + Math.imul(ah2, bh6)) | 0;\n lo = (lo + Math.imul(al1, bl7)) | 0;\n mid = (mid + Math.imul(al1, bh7)) | 0;\n mid = (mid + Math.imul(ah1, bl7)) | 0;\n hi = (hi + Math.imul(ah1, bh7)) | 0;\n lo = (lo + Math.imul(al0, bl8)) | 0;\n mid = (mid + Math.imul(al0, bh8)) | 0;\n mid = (mid + Math.imul(ah0, bl8)) | 0;\n hi = (hi + Math.imul(ah0, bh8)) | 0;\n var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\n w8 &= 0x3ffffff;\n /* k = 9 */\n lo = Math.imul(al9, bl0);\n mid = Math.imul(al9, bh0);\n mid = (mid + Math.imul(ah9, bl0)) | 0;\n hi = Math.imul(ah9, bh0);\n lo = (lo + Math.imul(al8, bl1)) | 0;\n mid = (mid + Math.imul(al8, bh1)) | 0;\n mid = (mid + Math.imul(ah8, bl1)) | 0;\n hi = (hi + Math.imul(ah8, bh1)) | 0;\n lo = (lo + Math.imul(al7, bl2)) | 0;\n mid = (mid + Math.imul(al7, bh2)) | 0;\n mid = (mid + Math.imul(ah7, bl2)) | 0;\n hi = (hi + Math.imul(ah7, bh2)) | 0;\n lo = (lo + Math.imul(al6, bl3)) | 0;\n mid = (mid + Math.imul(al6, bh3)) | 0;\n mid = (mid + Math.imul(ah6, bl3)) | 0;\n hi = (hi + Math.imul(ah6, bh3)) | 0;\n lo = (lo + Math.imul(al5, bl4)) | 0;\n mid = (mid + Math.imul(al5, bh4)) | 0;\n mid = (mid + Math.imul(ah5, bl4)) | 0;\n hi = (hi + Math.imul(ah5, bh4)) | 0;\n lo = (lo + Math.imul(al4, bl5)) | 0;\n mid = (mid + Math.imul(al4, bh5)) | 0;\n mid = (mid + Math.imul(ah4, bl5)) | 0;\n hi = (hi + Math.imul(ah4, bh5)) | 0;\n lo = (lo + Math.imul(al3, bl6)) | 0;\n mid = (mid + Math.imul(al3, bh6)) | 0;\n mid = (mid + Math.imul(ah3, bl6)) | 0;\n hi = (hi + Math.imul(ah3, bh6)) | 0;\n lo = (lo + Math.imul(al2, bl7)) | 0;\n mid = (mid + Math.imul(al2, bh7)) | 0;\n mid = (mid + Math.imul(ah2, bl7)) | 0;\n hi = (hi + Math.imul(ah2, bh7)) | 0;\n lo = (lo + Math.imul(al1, bl8)) | 0;\n mid = (mid + Math.imul(al1, bh8)) | 0;\n mid = (mid + Math.imul(ah1, bl8)) | 0;\n hi = (hi + Math.imul(ah1, bh8)) | 0;\n lo = (lo + Math.imul(al0, bl9)) | 0;\n mid = (mid + Math.imul(al0, bh9)) | 0;\n mid = (mid + Math.imul(ah0, bl9)) | 0;\n hi = (hi + Math.imul(ah0, bh9)) | 0;\n var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\n w9 &= 0x3ffffff;\n /* k = 10 */\n lo = Math.imul(al9, bl1);\n mid = Math.imul(al9, bh1);\n mid = (mid + Math.imul(ah9, bl1)) | 0;\n hi = Math.imul(ah9, bh1);\n lo = (lo + Math.imul(al8, bl2)) | 0;\n mid = (mid + Math.imul(al8, bh2)) | 0;\n mid = (mid + Math.imul(ah8, bl2)) | 0;\n hi = (hi + Math.imul(ah8, bh2)) | 0;\n lo = (lo + Math.imul(al7, bl3)) | 0;\n mid = (mid + Math.imul(al7, bh3)) | 0;\n mid = (mid + Math.imul(ah7, bl3)) | 0;\n hi = (hi + Math.imul(ah7, bh3)) | 0;\n lo = (lo + Math.imul(al6, bl4)) | 0;\n mid = (mid + Math.imul(al6, bh4)) | 0;\n mid = (mid + Math.imul(ah6, bl4)) | 0;\n hi = (hi + Math.imul(ah6, bh4)) | 0;\n lo = (lo + Math.imul(al5, bl5)) | 0;\n mid = (mid + Math.imul(al5, bh5)) | 0;\n mid = (mid + Math.imul(ah5, bl5)) | 0;\n hi = (hi + Math.imul(ah5, bh5)) | 0;\n lo = (lo + Math.imul(al4, bl6)) | 0;\n mid = (mid + Math.imul(al4, bh6)) | 0;\n mid = (mid + Math.imul(ah4, bl6)) | 0;\n hi = (hi + Math.imul(ah4, bh6)) | 0;\n lo = (lo + Math.imul(al3, bl7)) | 0;\n mid = (mid + Math.imul(al3, bh7)) | 0;\n mid = (mid + Math.imul(ah3, bl7)) | 0;\n hi = (hi + Math.imul(ah3, bh7)) | 0;\n lo = (lo + Math.imul(al2, bl8)) | 0;\n mid = (mid + Math.imul(al2, bh8)) | 0;\n mid = (mid + Math.imul(ah2, bl8)) | 0;\n hi = (hi + Math.imul(ah2, bh8)) | 0;\n lo = (lo + Math.imul(al1, bl9)) | 0;\n mid = (mid + Math.imul(al1, bh9)) | 0;\n mid = (mid + Math.imul(ah1, bl9)) | 0;\n hi = (hi + Math.imul(ah1, bh9)) | 0;\n var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\n w10 &= 0x3ffffff;\n /* k = 11 */\n lo = Math.imul(al9, bl2);\n mid = Math.imul(al9, bh2);\n mid = (mid + Math.imul(ah9, bl2)) | 0;\n hi = Math.imul(ah9, bh2);\n lo = (lo + Math.imul(al8, bl3)) | 0;\n mid = (mid + Math.imul(al8, bh3)) | 0;\n mid = (mid + Math.imul(ah8, bl3)) | 0;\n hi = (hi + Math.imul(ah8, bh3)) | 0;\n lo = (lo + Math.imul(al7, bl4)) | 0;\n mid = (mid + Math.imul(al7, bh4)) | 0;\n mid = (mid + Math.imul(ah7, bl4)) | 0;\n hi = (hi + Math.imul(ah7, bh4)) | 0;\n lo = (lo + Math.imul(al6, bl5)) | 0;\n mid = (mid + Math.imul(al6, bh5)) | 0;\n mid = (mid + Math.imul(ah6, bl5)) | 0;\n hi = (hi + Math.imul(ah6, bh5)) | 0;\n lo = (lo + Math.imul(al5, bl6)) | 0;\n mid = (mid + Math.imul(al5, bh6)) | 0;\n mid = (mid + Math.imul(ah5, bl6)) | 0;\n hi = (hi + Math.imul(ah5, bh6)) | 0;\n lo = (lo + Math.imul(al4, bl7)) | 0;\n mid = (mid + Math.imul(al4, bh7)) | 0;\n mid = (mid + Math.imul(ah4, bl7)) | 0;\n hi = (hi + Math.imul(ah4, bh7)) | 0;\n lo = (lo + Math.imul(al3, bl8)) | 0;\n mid = (mid + Math.imul(al3, bh8)) | 0;\n mid = (mid + Math.imul(ah3, bl8)) | 0;\n hi = (hi + Math.imul(ah3, bh8)) | 0;\n lo = (lo + Math.imul(al2, bl9)) | 0;\n mid = (mid + Math.imul(al2, bh9)) | 0;\n mid = (mid + Math.imul(ah2, bl9)) | 0;\n hi = (hi + Math.imul(ah2, bh9)) | 0;\n var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\n w11 &= 0x3ffffff;\n /* k = 12 */\n lo = Math.imul(al9, bl3);\n mid = Math.imul(al9, bh3);\n mid = (mid + Math.imul(ah9, bl3)) | 0;\n hi = Math.imul(ah9, bh3);\n lo = (lo + Math.imul(al8, bl4)) | 0;\n mid = (mid + Math.imul(al8, bh4)) | 0;\n mid = (mid + Math.imul(ah8, bl4)) | 0;\n hi = (hi + Math.imul(ah8, bh4)) | 0;\n lo = (lo + Math.imul(al7, bl5)) | 0;\n mid = (mid + Math.imul(al7, bh5)) | 0;\n mid = (mid + Math.imul(ah7, bl5)) | 0;\n hi = (hi + Math.imul(ah7, bh5)) | 0;\n lo = (lo + Math.imul(al6, bl6)) | 0;\n mid = (mid + Math.imul(al6, bh6)) | 0;\n mid = (mid + Math.imul(ah6, bl6)) | 0;\n hi = (hi + Math.imul(ah6, bh6)) | 0;\n lo = (lo + Math.imul(al5, bl7)) | 0;\n mid = (mid + Math.imul(al5, bh7)) | 0;\n mid = (mid + Math.imul(ah5, bl7)) | 0;\n hi = (hi + Math.imul(ah5, bh7)) | 0;\n lo = (lo + Math.imul(al4, bl8)) | 0;\n mid = (mid + Math.imul(al4, bh8)) | 0;\n mid = (mid + Math.imul(ah4, bl8)) | 0;\n hi = (hi + Math.imul(ah4, bh8)) | 0;\n lo = (lo + Math.imul(al3, bl9)) | 0;\n mid = (mid + Math.imul(al3, bh9)) | 0;\n mid = (mid + Math.imul(ah3, bl9)) | 0;\n hi = (hi + Math.imul(ah3, bh9)) | 0;\n var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\n w12 &= 0x3ffffff;\n /* k = 13 */\n lo = Math.imul(al9, bl4);\n mid = Math.imul(al9, bh4);\n mid = (mid + Math.imul(ah9, bl4)) | 0;\n hi = Math.imul(ah9, bh4);\n lo = (lo + Math.imul(al8, bl5)) | 0;\n mid = (mid + Math.imul(al8, bh5)) | 0;\n mid = (mid + Math.imul(ah8, bl5)) | 0;\n hi = (hi + Math.imul(ah8, bh5)) | 0;\n lo = (lo + Math.imul(al7, bl6)) | 0;\n mid = (mid + Math.imul(al7, bh6)) | 0;\n mid = (mid + Math.imul(ah7, bl6)) | 0;\n hi = (hi + Math.imul(ah7, bh6)) | 0;\n lo = (lo + Math.imul(al6, bl7)) | 0;\n mid = (mid + Math.imul(al6, bh7)) | 0;\n mid = (mid + Math.imul(ah6, bl7)) | 0;\n hi = (hi + Math.imul(ah6, bh7)) | 0;\n lo = (lo + Math.imul(al5, bl8)) | 0;\n mid = (mid + Math.imul(al5, bh8)) | 0;\n mid = (mid + Math.imul(ah5, bl8)) | 0;\n hi = (hi + Math.imul(ah5, bh8)) | 0;\n lo = (lo + Math.imul(al4, bl9)) | 0;\n mid = (mid + Math.imul(al4, bh9)) | 0;\n mid = (mid + Math.imul(ah4, bl9)) | 0;\n hi = (hi + Math.imul(ah4, bh9)) | 0;\n var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\n w13 &= 0x3ffffff;\n /* k = 14 */\n lo = Math.imul(al9, bl5);\n mid = Math.imul(al9, bh5);\n mid = (mid + Math.imul(ah9, bl5)) | 0;\n hi = Math.imul(ah9, bh5);\n lo = (lo + Math.imul(al8, bl6)) | 0;\n mid = (mid + Math.imul(al8, bh6)) | 0;\n mid = (mid + Math.imul(ah8, bl6)) | 0;\n hi = (hi + Math.imul(ah8, bh6)) | 0;\n lo = (lo + Math.imul(al7, bl7)) | 0;\n mid = (mid + Math.imul(al7, bh7)) | 0;\n mid = (mid + Math.imul(ah7, bl7)) | 0;\n hi = (hi + Math.imul(ah7, bh7)) | 0;\n lo = (lo + Math.imul(al6, bl8)) | 0;\n mid = (mid + Math.imul(al6, bh8)) | 0;\n mid = (mid + Math.imul(ah6, bl8)) | 0;\n hi = (hi + Math.imul(ah6, bh8)) | 0;\n lo = (lo + Math.imul(al5, bl9)) | 0;\n mid = (mid + Math.imul(al5, bh9)) | 0;\n mid = (mid + Math.imul(ah5, bl9)) | 0;\n hi = (hi + Math.imul(ah5, bh9)) | 0;\n var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\n w14 &= 0x3ffffff;\n /* k = 15 */\n lo = Math.imul(al9, bl6);\n mid = Math.imul(al9, bh6);\n mid = (mid + Math.imul(ah9, bl6)) | 0;\n hi = Math.imul(ah9, bh6);\n lo = (lo + Math.imul(al8, bl7)) | 0;\n mid = (mid + Math.imul(al8, bh7)) | 0;\n mid = (mid + Math.imul(ah8, bl7)) | 0;\n hi = (hi + Math.imul(ah8, bh7)) | 0;\n lo = (lo + Math.imul(al7, bl8)) | 0;\n mid = (mid + Math.imul(al7, bh8)) | 0;\n mid = (mid + Math.imul(ah7, bl8)) | 0;\n hi = (hi + Math.imul(ah7, bh8)) | 0;\n lo = (lo + Math.imul(al6, bl9)) | 0;\n mid = (mid + Math.imul(al6, bh9)) | 0;\n mid = (mid + Math.imul(ah6, bl9)) | 0;\n hi = (hi + Math.imul(ah6, bh9)) | 0;\n var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\n w15 &= 0x3ffffff;\n /* k = 16 */\n lo = Math.imul(al9, bl7);\n mid = Math.imul(al9, bh7);\n mid = (mid + Math.imul(ah9, bl7)) | 0;\n hi = Math.imul(ah9, bh7);\n lo = (lo + Math.imul(al8, bl8)) | 0;\n mid = (mid + Math.imul(al8, bh8)) | 0;\n mid = (mid + Math.imul(ah8, bl8)) | 0;\n hi = (hi + Math.imul(ah8, bh8)) | 0;\n lo = (lo + Math.imul(al7, bl9)) | 0;\n mid = (mid + Math.imul(al7, bh9)) | 0;\n mid = (mid + Math.imul(ah7, bl9)) | 0;\n hi = (hi + Math.imul(ah7, bh9)) | 0;\n var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\n w16 &= 0x3ffffff;\n /* k = 17 */\n lo = Math.imul(al9, bl8);\n mid = Math.imul(al9, bh8);\n mid = (mid + Math.imul(ah9, bl8)) | 0;\n hi = Math.imul(ah9, bh8);\n lo = (lo + Math.imul(al8, bl9)) | 0;\n mid = (mid + Math.imul(al8, bh9)) | 0;\n mid = (mid + Math.imul(ah8, bl9)) | 0;\n hi = (hi + Math.imul(ah8, bh9)) | 0;\n var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\n w17 &= 0x3ffffff;\n /* k = 18 */\n lo = Math.imul(al9, bl9);\n mid = Math.imul(al9, bh9);\n mid = (mid + Math.imul(ah9, bl9)) | 0;\n hi = Math.imul(ah9, bh9);\n var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\n w18 &= 0x3ffffff;\n o[0] = w0;\n o[1] = w1;\n o[2] = w2;\n o[3] = w3;\n o[4] = w4;\n o[5] = w5;\n o[6] = w6;\n o[7] = w7;\n o[8] = w8;\n o[9] = w9;\n o[10] = w10;\n o[11] = w11;\n o[12] = w12;\n o[13] = w13;\n o[14] = w14;\n o[15] = w15;\n o[16] = w16;\n o[17] = w17;\n o[18] = w18;\n if (c !== 0) {\n o[19] = c;\n out.length++;\n }\n return out;\n };\n\n // Polyfill comb\n if (!Math.imul) {\n comb10MulTo = smallMulTo;\n }\n\n function bigMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n out.length = self.length + num.length;\n\n var carry = 0;\n var hncarry = 0;\n for (var k = 0; k < out.length - 1; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = hncarry;\n hncarry = 0;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = k - j;\n var a = self.words[i] | 0;\n var b = num.words[j] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\n lo = (lo + rword) | 0;\n rword = lo & 0x3ffffff;\n ncarry = (ncarry + (lo >>> 26)) | 0;\n\n hncarry += ncarry >>> 26;\n ncarry &= 0x3ffffff;\n }\n out.words[k] = rword;\n carry = ncarry;\n ncarry = hncarry;\n }\n if (carry !== 0) {\n out.words[k] = carry;\n } else {\n out.length--;\n }\n\n return out.strip();\n }\n\n function jumboMulTo (self, num, out) {\n var fftm = new FFTM();\n return fftm.mulp(self, num, out);\n }\n\n BN.prototype.mulTo = function mulTo (num, out) {\n var res;\n var len = this.length + num.length;\n if (this.length === 10 && num.length === 10) {\n res = comb10MulTo(this, num, out);\n } else if (len < 63) {\n res = smallMulTo(this, num, out);\n } else if (len < 1024) {\n res = bigMulTo(this, num, out);\n } else {\n res = jumboMulTo(this, num, out);\n }\n\n return res;\n };\n\n // Cooley-Tukey algorithm for FFT\n // slightly revisited to rely on looping instead of recursion\n\n function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }\n\n FFTM.prototype.makeRBT = function makeRBT (N) {\n var t = new Array(N);\n var l = BN.prototype._countBits(N) - 1;\n for (var i = 0; i < N; i++) {\n t[i] = this.revBin(i, l, N);\n }\n\n return t;\n };\n\n // Returns binary-reversed representation of `x`\n FFTM.prototype.revBin = function revBin (x, l, N) {\n if (x === 0 || x === N - 1) return x;\n\n var rb = 0;\n for (var i = 0; i < l; i++) {\n rb |= (x & 1) << (l - i - 1);\n x >>= 1;\n }\n\n return rb;\n };\n\n // Performs \"tweedling\" phase, therefore 'emulating'\n // behaviour of the recursive algorithm\n FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {\n for (var i = 0; i < N; i++) {\n rtws[i] = rws[rbt[i]];\n itws[i] = iws[rbt[i]];\n }\n };\n\n FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {\n this.permute(rbt, rws, iws, rtws, itws, N);\n\n for (var s = 1; s < N; s <<= 1) {\n var l = s << 1;\n\n var rtwdf = Math.cos(2 * Math.PI / l);\n var itwdf = Math.sin(2 * Math.PI / l);\n\n for (var p = 0; p < N; p += l) {\n var rtwdf_ = rtwdf;\n var itwdf_ = itwdf;\n\n for (var j = 0; j < s; j++) {\n var re = rtws[p + j];\n var ie = itws[p + j];\n\n var ro = rtws[p + j + s];\n var io = itws[p + j + s];\n\n var rx = rtwdf_ * ro - itwdf_ * io;\n\n io = rtwdf_ * io + itwdf_ * ro;\n ro = rx;\n\n rtws[p + j] = re + ro;\n itws[p + j] = ie + io;\n\n rtws[p + j + s] = re - ro;\n itws[p + j + s] = ie - io;\n\n /* jshint maxdepth : false */\n if (j !== l) {\n rx = rtwdf * rtwdf_ - itwdf * itwdf_;\n\n itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;\n rtwdf_ = rx;\n }\n }\n }\n }\n };\n\n FFTM.prototype.guessLen13b = function guessLen13b (n, m) {\n var N = Math.max(m, n) | 1;\n var odd = N & 1;\n var i = 0;\n for (N = N / 2 | 0; N; N = N >>> 1) {\n i++;\n }\n\n return 1 << i + 1 + odd;\n };\n\n FFTM.prototype.conjugate = function conjugate (rws, iws, N) {\n if (N <= 1) return;\n\n for (var i = 0; i < N / 2; i++) {\n var t = rws[i];\n\n rws[i] = rws[N - i - 1];\n rws[N - i - 1] = t;\n\n t = iws[i];\n\n iws[i] = -iws[N - i - 1];\n iws[N - i - 1] = -t;\n }\n };\n\n FFTM.prototype.normalize13b = function normalize13b (ws, N) {\n var carry = 0;\n for (var i = 0; i < N / 2; i++) {\n var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +\n Math.round(ws[2 * i] / N) +\n carry;\n\n ws[i] = w & 0x3ffffff;\n\n if (w < 0x4000000) {\n carry = 0;\n } else {\n carry = w / 0x4000000 | 0;\n }\n }\n\n return ws;\n };\n\n FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {\n var carry = 0;\n for (var i = 0; i < len; i++) {\n carry = carry + (ws[i] | 0);\n\n rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;\n rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;\n }\n\n // Pad with zeroes\n for (i = 2 * len; i < N; ++i) {\n rws[i] = 0;\n }\n\n assert(carry === 0);\n assert((carry & ~0x1fff) === 0);\n };\n\n FFTM.prototype.stub = function stub (N) {\n var ph = new Array(N);\n for (var i = 0; i < N; i++) {\n ph[i] = 0;\n }\n\n return ph;\n };\n\n FFTM.prototype.mulp = function mulp (x, y, out) {\n var N = 2 * this.guessLen13b(x.length, y.length);\n\n var rbt = this.makeRBT(N);\n\n var _ = this.stub(N);\n\n var rws = new Array(N);\n var rwst = new Array(N);\n var iwst = new Array(N);\n\n var nrws = new Array(N);\n var nrwst = new Array(N);\n var niwst = new Array(N);\n\n var rmws = out.words;\n rmws.length = N;\n\n this.convert13b(x.words, x.length, rws, N);\n this.convert13b(y.words, y.length, nrws, N);\n\n this.transform(rws, _, rwst, iwst, N, rbt);\n this.transform(nrws, _, nrwst, niwst, N, rbt);\n\n for (var i = 0; i < N; i++) {\n var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\n iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];\n rwst[i] = rx;\n }\n\n this.conjugate(rwst, iwst, N);\n this.transform(rwst, iwst, rmws, _, N, rbt);\n this.conjugate(rmws, _, N);\n this.normalize13b(rmws, N);\n\n out.negative = x.negative ^ y.negative;\n out.length = x.length + y.length;\n return out.strip();\n };\n\n // Multiply `this` by `num`\n BN.prototype.mul = function mul (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return this.mulTo(num, out);\n };\n\n // Multiply employing FFT\n BN.prototype.mulf = function mulf (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return jumboMulTo(this, num, out);\n };\n\n // In-place Multiplication\n BN.prototype.imul = function imul (num) {\n return this.clone().mulTo(num, this);\n };\n\n BN.prototype.imuln = function imuln (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n\n // Carry\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = (this.words[i] | 0) * num;\n var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\n carry >>= 26;\n carry += (w / 0x4000000) | 0;\n // NOTE: lo is 27bit maximum\n carry += lo >>> 26;\n this.words[i] = lo & 0x3ffffff;\n }\n\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n\n return this;\n };\n\n BN.prototype.muln = function muln (num) {\n return this.clone().imuln(num);\n };\n\n // `this` * `this`\n BN.prototype.sqr = function sqr () {\n return this.mul(this);\n };\n\n // `this` * `this` in-place\n BN.prototype.isqr = function isqr () {\n return this.imul(this.clone());\n };\n\n // Math.pow(`this`, `num`)\n BN.prototype.pow = function pow (num) {\n var w = toBitArray(num);\n if (w.length === 0) return new BN(1);\n\n // Skip leading zeroes\n var res = this;\n for (var i = 0; i < w.length; i++, res = res.sqr()) {\n if (w[i] !== 0) break;\n }\n\n if (++i < w.length) {\n for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {\n if (w[i] === 0) continue;\n\n res = res.mul(q);\n }\n }\n\n return res;\n };\n\n // Shift-left in-place\n BN.prototype.iushln = function iushln (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);\n var i;\n\n if (r !== 0) {\n var carry = 0;\n\n for (i = 0; i < this.length; i++) {\n var newCarry = this.words[i] & carryMask;\n var c = ((this.words[i] | 0) - newCarry) << r;\n this.words[i] = c | carry;\n carry = newCarry >>> (26 - r);\n }\n\n if (carry) {\n this.words[i] = carry;\n this.length++;\n }\n }\n\n if (s !== 0) {\n for (i = this.length - 1; i >= 0; i--) {\n this.words[i + s] = this.words[i];\n }\n\n for (i = 0; i < s; i++) {\n this.words[i] = 0;\n }\n\n this.length += s;\n }\n\n return this.strip();\n };\n\n BN.prototype.ishln = function ishln (bits) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushln(bits);\n };\n\n // Shift-right in-place\n // NOTE: `hint` is a lowest bit before trailing zeroes\n // NOTE: if `extended` is present - it will be filled with destroyed bits\n BN.prototype.iushrn = function iushrn (bits, hint, extended) {\n assert(typeof bits === 'number' && bits >= 0);\n var h;\n if (hint) {\n h = (hint - (hint % 26)) / 26;\n } else {\n h = 0;\n }\n\n var r = bits % 26;\n var s = Math.min((bits - r) / 26, this.length);\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n var maskedWords = extended;\n\n h -= s;\n h = Math.max(0, h);\n\n // Extended mode, copy masked part\n if (maskedWords) {\n for (var i = 0; i < s; i++) {\n maskedWords.words[i] = this.words[i];\n }\n maskedWords.length = s;\n }\n\n if (s === 0) {\n // No-op, we should not move anything at all\n } else if (this.length > s) {\n this.length -= s;\n for (i = 0; i < this.length; i++) {\n this.words[i] = this.words[i + s];\n }\n } else {\n this.words[0] = 0;\n this.length = 1;\n }\n\n var carry = 0;\n for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {\n var word = this.words[i] | 0;\n this.words[i] = (carry << (26 - r)) | (word >>> r);\n carry = word & mask;\n }\n\n // Push carried bits as a mask\n if (maskedWords && carry !== 0) {\n maskedWords.words[maskedWords.length++] = carry;\n }\n\n if (this.length === 0) {\n this.words[0] = 0;\n this.length = 1;\n }\n\n return this.strip();\n };\n\n BN.prototype.ishrn = function ishrn (bits, hint, extended) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushrn(bits, hint, extended);\n };\n\n // Shift-left\n BN.prototype.shln = function shln (bits) {\n return this.clone().ishln(bits);\n };\n\n BN.prototype.ushln = function ushln (bits) {\n return this.clone().iushln(bits);\n };\n\n // Shift-right\n BN.prototype.shrn = function shrn (bits) {\n return this.clone().ishrn(bits);\n };\n\n BN.prototype.ushrn = function ushrn (bits) {\n return this.clone().iushrn(bits);\n };\n\n // Test if n bit is set\n BN.prototype.testn = function testn (bit) {\n assert(typeof bit === 'number' && bit >= 0);\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) return false;\n\n // Check bit and return\n var w = this.words[s];\n\n return !!(w & q);\n };\n\n // Return only lowers bits of number (in-place)\n BN.prototype.imaskn = function imaskn (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n\n assert(this.negative === 0, 'imaskn works only with positive numbers');\n\n if (this.length <= s) {\n return this;\n }\n\n if (r !== 0) {\n s++;\n }\n this.length = Math.min(s, this.length);\n\n if (r !== 0) {\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n this.words[this.length - 1] &= mask;\n }\n\n return this.strip();\n };\n\n // Return only lowers bits of number\n BN.prototype.maskn = function maskn (bits) {\n return this.clone().imaskn(bits);\n };\n\n // Add plain number `num` to `this`\n BN.prototype.iaddn = function iaddn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.isubn(-num);\n\n // Possible sign change\n if (this.negative !== 0) {\n if (this.length === 1 && (this.words[0] | 0) < num) {\n this.words[0] = num - (this.words[0] | 0);\n this.negative = 0;\n return this;\n }\n\n this.negative = 0;\n this.isubn(num);\n this.negative = 1;\n return this;\n }\n\n // Add without checks\n return this._iaddn(num);\n };\n\n BN.prototype._iaddn = function _iaddn (num) {\n this.words[0] += num;\n\n // Carry\n for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {\n this.words[i] -= 0x4000000;\n if (i === this.length - 1) {\n this.words[i + 1] = 1;\n } else {\n this.words[i + 1]++;\n }\n }\n this.length = Math.max(this.length, i + 1);\n\n return this;\n };\n\n // Subtract plain number `num` from `this`\n BN.prototype.isubn = function isubn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.iaddn(-num);\n\n if (this.negative !== 0) {\n this.negative = 0;\n this.iaddn(num);\n this.negative = 1;\n return this;\n }\n\n this.words[0] -= num;\n\n if (this.length === 1 && this.words[0] < 0) {\n this.words[0] = -this.words[0];\n this.negative = 1;\n } else {\n // Carry\n for (var i = 0; i < this.length && this.words[i] < 0; i++) {\n this.words[i] += 0x4000000;\n this.words[i + 1] -= 1;\n }\n }\n\n return this.strip();\n };\n\n BN.prototype.addn = function addn (num) {\n return this.clone().iaddn(num);\n };\n\n BN.prototype.subn = function subn (num) {\n return this.clone().isubn(num);\n };\n\n BN.prototype.iabs = function iabs () {\n this.negative = 0;\n\n return this;\n };\n\n BN.prototype.abs = function abs () {\n return this.clone().iabs();\n };\n\n BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {\n var len = num.length + shift;\n var i;\n\n this._expand(len);\n\n var w;\n var carry = 0;\n for (i = 0; i < num.length; i++) {\n w = (this.words[i + shift] | 0) + carry;\n var right = (num.words[i] | 0) * mul;\n w -= right & 0x3ffffff;\n carry = (w >> 26) - ((right / 0x4000000) | 0);\n this.words[i + shift] = w & 0x3ffffff;\n }\n for (; i < this.length - shift; i++) {\n w = (this.words[i + shift] | 0) + carry;\n carry = w >> 26;\n this.words[i + shift] = w & 0x3ffffff;\n }\n\n if (carry === 0) return this.strip();\n\n // Subtraction overflow\n assert(carry === -1);\n carry = 0;\n for (i = 0; i < this.length; i++) {\n w = -(this.words[i] | 0) + carry;\n carry = w >> 26;\n this.words[i] = w & 0x3ffffff;\n }\n this.negative = 1;\n\n return this.strip();\n };\n\n BN.prototype._wordDiv = function _wordDiv (num, mode) {\n var shift = this.length - num.length;\n\n var a = this.clone();\n var b = num;\n\n // Normalize\n var bhi = b.words[b.length - 1] | 0;\n var bhiBits = this._countBits(bhi);\n shift = 26 - bhiBits;\n if (shift !== 0) {\n b = b.ushln(shift);\n a.iushln(shift);\n bhi = b.words[b.length - 1] | 0;\n }\n\n // Initialize quotient\n var m = a.length - b.length;\n var q;\n\n if (mode !== 'mod') {\n q = new BN(null);\n q.length = m + 1;\n q.words = new Array(q.length);\n for (var i = 0; i < q.length; i++) {\n q.words[i] = 0;\n }\n }\n\n var diff = a.clone()._ishlnsubmul(b, 1, m);\n if (diff.negative === 0) {\n a = diff;\n if (q) {\n q.words[m] = 1;\n }\n }\n\n for (var j = m - 1; j >= 0; j--) {\n var qj = (a.words[b.length + j] | 0) * 0x4000000 +\n (a.words[b.length + j - 1] | 0);\n\n // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max\n // (0x7ffffff)\n qj = Math.min((qj / bhi) | 0, 0x3ffffff);\n\n a._ishlnsubmul(b, qj, j);\n while (a.negative !== 0) {\n qj--;\n a.negative = 0;\n a._ishlnsubmul(b, 1, j);\n if (!a.isZero()) {\n a.negative ^= 1;\n }\n }\n if (q) {\n q.words[j] = qj;\n }\n }\n if (q) {\n q.strip();\n }\n a.strip();\n\n // Denormalize\n if (mode !== 'div' && shift !== 0) {\n a.iushrn(shift);\n }\n\n return {\n div: q || null,\n mod: a\n };\n };\n\n // NOTE: 1) `mode` can be set to `mod` to request mod only,\n // to `div` to request div only, or be absent to\n // request both div & mod\n // 2) `positive` is true if unsigned mod is requested\n BN.prototype.divmod = function divmod (num, mode, positive) {\n assert(!num.isZero());\n\n if (this.isZero()) {\n return {\n div: new BN(0),\n mod: new BN(0)\n };\n }\n\n var div, mod, res;\n if (this.negative !== 0 && num.negative === 0) {\n res = this.neg().divmod(num, mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.iadd(num);\n }\n }\n\n return {\n div: div,\n mod: mod\n };\n }\n\n if (this.negative === 0 && num.negative !== 0) {\n res = this.divmod(num.neg(), mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n return {\n div: div,\n mod: res.mod\n };\n }\n\n if ((this.negative & num.negative) !== 0) {\n res = this.neg().divmod(num.neg(), mode);\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.isub(num);\n }\n }\n\n return {\n div: res.div,\n mod: mod\n };\n }\n\n // Both numbers are positive at this point\n\n // Strip both numbers to approximate shift value\n if (num.length > this.length || this.cmp(num) < 0) {\n return {\n div: new BN(0),\n mod: this\n };\n }\n\n // Very short reduction\n if (num.length === 1) {\n if (mode === 'div') {\n return {\n div: this.divn(num.words[0]),\n mod: null\n };\n }\n\n if (mode === 'mod') {\n return {\n div: null,\n mod: new BN(this.modn(num.words[0]))\n };\n }\n\n return {\n div: this.divn(num.words[0]),\n mod: new BN(this.modn(num.words[0]))\n };\n }\n\n return this._wordDiv(num, mode);\n };\n\n // Find `this` / `num`\n BN.prototype.div = function div (num) {\n return this.divmod(num, 'div', false).div;\n };\n\n // Find `this` % `num`\n BN.prototype.mod = function mod (num) {\n return this.divmod(num, 'mod', false).mod;\n };\n\n BN.prototype.umod = function umod (num) {\n return this.divmod(num, 'mod', true).mod;\n };\n\n // Find Round(`this` / `num`)\n BN.prototype.divRound = function divRound (num) {\n var dm = this.divmod(num);\n\n // Fast case - exact division\n if (dm.mod.isZero()) return dm.div;\n\n var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;\n\n var half = num.ushrn(1);\n var r2 = num.andln(1);\n var cmp = mod.cmp(half);\n\n // Round down\n if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;\n\n // Round up\n return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);\n };\n\n BN.prototype.modn = function modn (num) {\n assert(num <= 0x3ffffff);\n var p = (1 << 26) % num;\n\n var acc = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n acc = (p * acc + (this.words[i] | 0)) % num;\n }\n\n return acc;\n };\n\n // In-place division by number\n BN.prototype.idivn = function idivn (num) {\n assert(num <= 0x3ffffff);\n\n var carry = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var w = (this.words[i] | 0) + carry * 0x4000000;\n this.words[i] = (w / num) | 0;\n carry = w % num;\n }\n\n return this.strip();\n };\n\n BN.prototype.divn = function divn (num) {\n return this.clone().idivn(num);\n };\n\n BN.prototype.egcd = function egcd (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var x = this;\n var y = p.clone();\n\n if (x.negative !== 0) {\n x = x.umod(p);\n } else {\n x = x.clone();\n }\n\n // A * x + B * y = x\n var A = new BN(1);\n var B = new BN(0);\n\n // C * x + D * y = y\n var C = new BN(0);\n var D = new BN(1);\n\n var g = 0;\n\n while (x.isEven() && y.isEven()) {\n x.iushrn(1);\n y.iushrn(1);\n ++g;\n }\n\n var yp = y.clone();\n var xp = x.clone();\n\n while (!x.isZero()) {\n for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n x.iushrn(i);\n while (i-- > 0) {\n if (A.isOdd() || B.isOdd()) {\n A.iadd(yp);\n B.isub(xp);\n }\n\n A.iushrn(1);\n B.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n y.iushrn(j);\n while (j-- > 0) {\n if (C.isOdd() || D.isOdd()) {\n C.iadd(yp);\n D.isub(xp);\n }\n\n C.iushrn(1);\n D.iushrn(1);\n }\n }\n\n if (x.cmp(y) >= 0) {\n x.isub(y);\n A.isub(C);\n B.isub(D);\n } else {\n y.isub(x);\n C.isub(A);\n D.isub(B);\n }\n }\n\n return {\n a: C,\n b: D,\n gcd: y.iushln(g)\n };\n };\n\n // This is reduced incarnation of the binary EEA\n // above, designated to invert members of the\n // _prime_ fields F(p) at a maximal speed\n BN.prototype._invmp = function _invmp (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var a = this;\n var b = p.clone();\n\n if (a.negative !== 0) {\n a = a.umod(p);\n } else {\n a = a.clone();\n }\n\n var x1 = new BN(1);\n var x2 = new BN(0);\n\n var delta = b.clone();\n\n while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {\n for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n a.iushrn(i);\n while (i-- > 0) {\n if (x1.isOdd()) {\n x1.iadd(delta);\n }\n\n x1.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n b.iushrn(j);\n while (j-- > 0) {\n if (x2.isOdd()) {\n x2.iadd(delta);\n }\n\n x2.iushrn(1);\n }\n }\n\n if (a.cmp(b) >= 0) {\n a.isub(b);\n x1.isub(x2);\n } else {\n b.isub(a);\n x2.isub(x1);\n }\n }\n\n var res;\n if (a.cmpn(1) === 0) {\n res = x1;\n } else {\n res = x2;\n }\n\n if (res.cmpn(0) < 0) {\n res.iadd(p);\n }\n\n return res;\n };\n\n BN.prototype.gcd = function gcd (num) {\n if (this.isZero()) return num.abs();\n if (num.isZero()) return this.abs();\n\n var a = this.clone();\n var b = num.clone();\n a.negative = 0;\n b.negative = 0;\n\n // Remove common factor of two\n for (var shift = 0; a.isEven() && b.isEven(); shift++) {\n a.iushrn(1);\n b.iushrn(1);\n }\n\n do {\n while (a.isEven()) {\n a.iushrn(1);\n }\n while (b.isEven()) {\n b.iushrn(1);\n }\n\n var r = a.cmp(b);\n if (r < 0) {\n // Swap `a` and `b` to make `a` always bigger than `b`\n var t = a;\n a = b;\n b = t;\n } else if (r === 0 || b.cmpn(1) === 0) {\n break;\n }\n\n a.isub(b);\n } while (true);\n\n return b.iushln(shift);\n };\n\n // Invert number in the field F(num)\n BN.prototype.invm = function invm (num) {\n return this.egcd(num).a.umod(num);\n };\n\n BN.prototype.isEven = function isEven () {\n return (this.words[0] & 1) === 0;\n };\n\n BN.prototype.isOdd = function isOdd () {\n return (this.words[0] & 1) === 1;\n };\n\n // And first word and num\n BN.prototype.andln = function andln (num) {\n return this.words[0] & num;\n };\n\n // Increment at the bit position in-line\n BN.prototype.bincn = function bincn (bit) {\n assert(typeof bit === 'number');\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) {\n this._expand(s + 1);\n this.words[s] |= q;\n return this;\n }\n\n // Add bit and propagate, if needed\n var carry = q;\n for (var i = s; carry !== 0 && i < this.length; i++) {\n var w = this.words[i] | 0;\n w += carry;\n carry = w >>> 26;\n w &= 0x3ffffff;\n this.words[i] = w;\n }\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n return this;\n };\n\n BN.prototype.isZero = function isZero () {\n return this.length === 1 && this.words[0] === 0;\n };\n\n BN.prototype.cmpn = function cmpn (num) {\n var negative = num < 0;\n\n if (this.negative !== 0 && !negative) return -1;\n if (this.negative === 0 && negative) return 1;\n\n this.strip();\n\n var res;\n if (this.length > 1) {\n res = 1;\n } else {\n if (negative) {\n num = -num;\n }\n\n assert(num <= 0x3ffffff, 'Number is too big');\n\n var w = this.words[0] | 0;\n res = w === num ? 0 : w < num ? -1 : 1;\n }\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Compare two numbers and return:\n // 1 - if `this` > `num`\n // 0 - if `this` == `num`\n // -1 - if `this` < `num`\n BN.prototype.cmp = function cmp (num) {\n if (this.negative !== 0 && num.negative === 0) return -1;\n if (this.negative === 0 && num.negative !== 0) return 1;\n\n var res = this.ucmp(num);\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Unsigned comparison\n BN.prototype.ucmp = function ucmp (num) {\n // At this point both numbers have the same sign\n if (this.length > num.length) return 1;\n if (this.length < num.length) return -1;\n\n var res = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var a = this.words[i] | 0;\n var b = num.words[i] | 0;\n\n if (a === b) continue;\n if (a < b) {\n res = -1;\n } else if (a > b) {\n res = 1;\n }\n break;\n }\n return res;\n };\n\n BN.prototype.gtn = function gtn (num) {\n return this.cmpn(num) === 1;\n };\n\n BN.prototype.gt = function gt (num) {\n return this.cmp(num) === 1;\n };\n\n BN.prototype.gten = function gten (num) {\n return this.cmpn(num) >= 0;\n };\n\n BN.prototype.gte = function gte (num) {\n return this.cmp(num) >= 0;\n };\n\n BN.prototype.ltn = function ltn (num) {\n return this.cmpn(num) === -1;\n };\n\n BN.prototype.lt = function lt (num) {\n return this.cmp(num) === -1;\n };\n\n BN.prototype.lten = function lten (num) {\n return this.cmpn(num) <= 0;\n };\n\n BN.prototype.lte = function lte (num) {\n return this.cmp(num) <= 0;\n };\n\n BN.prototype.eqn = function eqn (num) {\n return this.cmpn(num) === 0;\n };\n\n BN.prototype.eq = function eq (num) {\n return this.cmp(num) === 0;\n };\n\n //\n // A reduce context, could be using montgomery or something better, depending\n // on the `m` itself.\n //\n BN.red = function red (num) {\n return new Red(num);\n };\n\n BN.prototype.toRed = function toRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n assert(this.negative === 0, 'red works only with positives');\n return ctx.convertTo(this)._forceRed(ctx);\n };\n\n BN.prototype.fromRed = function fromRed () {\n assert(this.red, 'fromRed works only with numbers in reduction context');\n return this.red.convertFrom(this);\n };\n\n BN.prototype._forceRed = function _forceRed (ctx) {\n this.red = ctx;\n return this;\n };\n\n BN.prototype.forceRed = function forceRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n return this._forceRed(ctx);\n };\n\n BN.prototype.redAdd = function redAdd (num) {\n assert(this.red, 'redAdd works only with red numbers');\n return this.red.add(this, num);\n };\n\n BN.prototype.redIAdd = function redIAdd (num) {\n assert(this.red, 'redIAdd works only with red numbers');\n return this.red.iadd(this, num);\n };\n\n BN.prototype.redSub = function redSub (num) {\n assert(this.red, 'redSub works only with red numbers');\n return this.red.sub(this, num);\n };\n\n BN.prototype.redISub = function redISub (num) {\n assert(this.red, 'redISub works only with red numbers');\n return this.red.isub(this, num);\n };\n\n BN.prototype.redShl = function redShl (num) {\n assert(this.red, 'redShl works only with red numbers');\n return this.red.shl(this, num);\n };\n\n BN.prototype.redMul = function redMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.mul(this, num);\n };\n\n BN.prototype.redIMul = function redIMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.imul(this, num);\n };\n\n BN.prototype.redSqr = function redSqr () {\n assert(this.red, 'redSqr works only with red numbers');\n this.red._verify1(this);\n return this.red.sqr(this);\n };\n\n BN.prototype.redISqr = function redISqr () {\n assert(this.red, 'redISqr works only with red numbers');\n this.red._verify1(this);\n return this.red.isqr(this);\n };\n\n // Square root over p\n BN.prototype.redSqrt = function redSqrt () {\n assert(this.red, 'redSqrt works only with red numbers');\n this.red._verify1(this);\n return this.red.sqrt(this);\n };\n\n BN.prototype.redInvm = function redInvm () {\n assert(this.red, 'redInvm works only with red numbers');\n this.red._verify1(this);\n return this.red.invm(this);\n };\n\n // Return negative clone of `this` % `red modulo`\n BN.prototype.redNeg = function redNeg () {\n assert(this.red, 'redNeg works only with red numbers');\n this.red._verify1(this);\n return this.red.neg(this);\n };\n\n BN.prototype.redPow = function redPow (num) {\n assert(this.red && !num.red, 'redPow(normalNum)');\n this.red._verify1(this);\n return this.red.pow(this, num);\n };\n\n // Prime numbers with efficient reduction\n var primes = {\n k256: null,\n p224: null,\n p192: null,\n p25519: null\n };\n\n // Pseudo-Mersenne prime\n function MPrime (name, p) {\n // P = 2 ^ N - K\n this.name = name;\n this.p = new BN(p, 16);\n this.n = this.p.bitLength();\n this.k = new BN(1).iushln(this.n).isub(this.p);\n\n this.tmp = this._tmp();\n }\n\n MPrime.prototype._tmp = function _tmp () {\n var tmp = new BN(null);\n tmp.words = new Array(Math.ceil(this.n / 13));\n return tmp;\n };\n\n MPrime.prototype.ireduce = function ireduce (num) {\n // Assumes that `num` is less than `P^2`\n // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)\n var r = num;\n var rlen;\n\n do {\n this.split(r, this.tmp);\n r = this.imulK(r);\n r = r.iadd(this.tmp);\n rlen = r.bitLength();\n } while (rlen > this.n);\n\n var cmp = rlen < this.n ? -1 : r.ucmp(this.p);\n if (cmp === 0) {\n r.words[0] = 0;\n r.length = 1;\n } else if (cmp > 0) {\n r.isub(this.p);\n } else {\n r.strip();\n }\n\n return r;\n };\n\n MPrime.prototype.split = function split (input, out) {\n input.iushrn(this.n, 0, out);\n };\n\n MPrime.prototype.imulK = function imulK (num) {\n return num.imul(this.k);\n };\n\n function K256 () {\n MPrime.call(\n this,\n 'k256',\n 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');\n }\n inherits(K256, MPrime);\n\n K256.prototype.split = function split (input, output) {\n // 256 = 9 * 26 + 22\n var mask = 0x3fffff;\n\n var outLen = Math.min(input.length, 9);\n for (var i = 0; i < outLen; i++) {\n output.words[i] = input.words[i];\n }\n output.length = outLen;\n\n if (input.length <= 9) {\n input.words[0] = 0;\n input.length = 1;\n return;\n }\n\n // Shift by 9 limbs\n var prev = input.words[9];\n output.words[output.length++] = prev & mask;\n\n for (i = 10; i < input.length; i++) {\n var next = input.words[i] | 0;\n input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\n prev = next;\n }\n prev >>>= 22;\n input.words[i - 10] = prev;\n if (prev === 0 && input.length > 10) {\n input.length -= 10;\n } else {\n input.length -= 9;\n }\n };\n\n K256.prototype.imulK = function imulK (num) {\n // K = 0x1000003d1 = [ 0x40, 0x3d1 ]\n num.words[num.length] = 0;\n num.words[num.length + 1] = 0;\n num.length += 2;\n\n // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\n var lo = 0;\n for (var i = 0; i < num.length; i++) {\n var w = num.words[i] | 0;\n lo += w * 0x3d1;\n num.words[i] = lo & 0x3ffffff;\n lo = w * 0x40 + ((lo / 0x4000000) | 0);\n }\n\n // Fast length reduction\n if (num.words[num.length - 1] === 0) {\n num.length--;\n if (num.words[num.length - 1] === 0) {\n num.length--;\n }\n }\n return num;\n };\n\n function P224 () {\n MPrime.call(\n this,\n 'p224',\n 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');\n }\n inherits(P224, MPrime);\n\n function P192 () {\n MPrime.call(\n this,\n 'p192',\n 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');\n }\n inherits(P192, MPrime);\n\n function P25519 () {\n // 2 ^ 255 - 19\n MPrime.call(\n this,\n '25519',\n '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');\n }\n inherits(P25519, MPrime);\n\n P25519.prototype.imulK = function imulK (num) {\n // K = 0x13\n var carry = 0;\n for (var i = 0; i < num.length; i++) {\n var hi = (num.words[i] | 0) * 0x13 + carry;\n var lo = hi & 0x3ffffff;\n hi >>>= 26;\n\n num.words[i] = lo;\n carry = hi;\n }\n if (carry !== 0) {\n num.words[num.length++] = carry;\n }\n return num;\n };\n\n // Exported mostly for testing purposes, use plain name instead\n BN._prime = function prime (name) {\n // Cached version of prime\n if (primes[name]) return primes[name];\n\n var prime;\n if (name === 'k256') {\n prime = new K256();\n } else if (name === 'p224') {\n prime = new P224();\n } else if (name === 'p192') {\n prime = new P192();\n } else if (name === 'p25519') {\n prime = new P25519();\n } else {\n throw new Error('Unknown prime ' + name);\n }\n primes[name] = prime;\n\n return prime;\n };\n\n //\n // Base reduction engine\n //\n function Red (m) {\n if (typeof m === 'string') {\n var prime = BN._prime(m);\n this.m = prime.p;\n this.prime = prime;\n } else {\n assert(m.gtn(1), 'modulus must be greater than 1');\n this.m = m;\n this.prime = null;\n }\n }\n\n Red.prototype._verify1 = function _verify1 (a) {\n assert(a.negative === 0, 'red works only with positives');\n assert(a.red, 'red works only with red numbers');\n };\n\n Red.prototype._verify2 = function _verify2 (a, b) {\n assert((a.negative | b.negative) === 0, 'red works only with positives');\n assert(a.red && a.red === b.red,\n 'red works only with red numbers');\n };\n\n Red.prototype.imod = function imod (a) {\n if (this.prime) return this.prime.ireduce(a)._forceRed(this);\n return a.umod(this.m)._forceRed(this);\n };\n\n Red.prototype.neg = function neg (a) {\n if (a.isZero()) {\n return a.clone();\n }\n\n return this.m.sub(a)._forceRed(this);\n };\n\n Red.prototype.add = function add (a, b) {\n this._verify2(a, b);\n\n var res = a.add(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.iadd = function iadd (a, b) {\n this._verify2(a, b);\n\n var res = a.iadd(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res;\n };\n\n Red.prototype.sub = function sub (a, b) {\n this._verify2(a, b);\n\n var res = a.sub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.isub = function isub (a, b) {\n this._verify2(a, b);\n\n var res = a.isub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res;\n };\n\n Red.prototype.shl = function shl (a, num) {\n this._verify1(a);\n return this.imod(a.ushln(num));\n };\n\n Red.prototype.imul = function imul (a, b) {\n this._verify2(a, b);\n return this.imod(a.imul(b));\n };\n\n Red.prototype.mul = function mul (a, b) {\n this._verify2(a, b);\n return this.imod(a.mul(b));\n };\n\n Red.prototype.isqr = function isqr (a) {\n return this.imul(a, a.clone());\n };\n\n Red.prototype.sqr = function sqr (a) {\n return this.mul(a, a);\n };\n\n Red.prototype.sqrt = function sqrt (a) {\n if (a.isZero()) return a.clone();\n\n var mod3 = this.m.andln(3);\n assert(mod3 % 2 === 1);\n\n // Fast case\n if (mod3 === 3) {\n var pow = this.m.add(new BN(1)).iushrn(2);\n return this.pow(a, pow);\n }\n\n // Tonelli-Shanks algorithm (Totally unoptimized and slow)\n //\n // Find Q and S, that Q * 2 ^ S = (P - 1)\n var q = this.m.subn(1);\n var s = 0;\n while (!q.isZero() && q.andln(1) === 0) {\n s++;\n q.iushrn(1);\n }\n assert(!q.isZero());\n\n var one = new BN(1).toRed(this);\n var nOne = one.redNeg();\n\n // Find quadratic non-residue\n // NOTE: Max is such because of generalized Riemann hypothesis.\n var lpow = this.m.subn(1).iushrn(1);\n var z = this.m.bitLength();\n z = new BN(2 * z * z).toRed(this);\n\n while (this.pow(z, lpow).cmp(nOne) !== 0) {\n z.redIAdd(nOne);\n }\n\n var c = this.pow(z, q);\n var r = this.pow(a, q.addn(1).iushrn(1));\n var t = this.pow(a, q);\n var m = s;\n while (t.cmp(one) !== 0) {\n var tmp = t;\n for (var i = 0; tmp.cmp(one) !== 0; i++) {\n tmp = tmp.redSqr();\n }\n assert(i < m);\n var b = this.pow(c, new BN(1).iushln(m - i - 1));\n\n r = r.redMul(b);\n c = b.redSqr();\n t = t.redMul(c);\n m = i;\n }\n\n return r;\n };\n\n Red.prototype.invm = function invm (a) {\n var inv = a._invmp(this.m);\n if (inv.negative !== 0) {\n inv.negative = 0;\n return this.imod(inv).redNeg();\n } else {\n return this.imod(inv);\n }\n };\n\n Red.prototype.pow = function pow (a, num) {\n if (num.isZero()) return new BN(1).toRed(this);\n if (num.cmpn(1) === 0) return a.clone();\n\n var windowSize = 4;\n var wnd = new Array(1 << windowSize);\n wnd[0] = new BN(1).toRed(this);\n wnd[1] = a;\n for (var i = 2; i < wnd.length; i++) {\n wnd[i] = this.mul(wnd[i - 1], a);\n }\n\n var res = wnd[0];\n var current = 0;\n var currentLen = 0;\n var start = num.bitLength() % 26;\n if (start === 0) {\n start = 26;\n }\n\n for (i = num.length - 1; i >= 0; i--) {\n var word = num.words[i];\n for (var j = start - 1; j >= 0; j--) {\n var bit = (word >> j) & 1;\n if (res !== wnd[0]) {\n res = this.sqr(res);\n }\n\n if (bit === 0 && current === 0) {\n currentLen = 0;\n continue;\n }\n\n current <<= 1;\n current |= bit;\n currentLen++;\n if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;\n\n res = this.mul(res, wnd[current]);\n currentLen = 0;\n current = 0;\n }\n start = 26;\n }\n\n return res;\n };\n\n Red.prototype.convertTo = function convertTo (num) {\n var r = num.umod(this.m);\n\n return r === num ? r.clone() : r;\n };\n\n Red.prototype.convertFrom = function convertFrom (num) {\n var res = num.clone();\n res.red = null;\n return res;\n };\n\n //\n // Montgomery method engine\n //\n\n BN.mont = function mont (num) {\n return new Mont(num);\n };\n\n function Mont (m) {\n Red.call(this, m);\n\n this.shift = this.m.bitLength();\n if (this.shift % 26 !== 0) {\n this.shift += 26 - (this.shift % 26);\n }\n\n this.r = new BN(1).iushln(this.shift);\n this.r2 = this.imod(this.r.sqr());\n this.rinv = this.r._invmp(this.m);\n\n this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);\n this.minv = this.minv.umod(this.r);\n this.minv = this.r.sub(this.minv);\n }\n inherits(Mont, Red);\n\n Mont.prototype.convertTo = function convertTo (num) {\n return this.imod(num.ushln(this.shift));\n };\n\n Mont.prototype.convertFrom = function convertFrom (num) {\n var r = this.imod(num.mul(this.rinv));\n r.red = null;\n return r;\n };\n\n Mont.prototype.imul = function imul (a, b) {\n if (a.isZero() || b.isZero()) {\n a.words[0] = 0;\n a.length = 1;\n return a;\n }\n\n var t = a.imul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.mul = function mul (a, b) {\n if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);\n\n var t = a.mul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.invm = function invm (a) {\n // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\n var res = this.imod(a._invmp(this.m).mul(this.r2));\n return res._forceRed(this);\n };\n})(typeof module === 'undefined' || module, this);\n","function createBroadcast (initialState) {\n var listeners = {};\n var id = 1;\n var _state = initialState;\n\n function getState () {\n return _state\n }\n\n function setState (state) {\n _state = state;\n var keys = Object.keys(listeners);\n var i = 0;\n var len = keys.length;\n for (; i < len; i++) {\n // if a listener gets unsubscribed during setState we just skip it\n if (listeners[keys[i]]) { listeners[keys[i]](state); }\n }\n }\n\n // subscribe to changes and return the subscriptionId\n function subscribe (listener) {\n if (typeof listener !== 'function') {\n throw new Error('listener must be a function.')\n }\n var currentId = id;\n listeners[currentId] = listener;\n id += 1;\n return currentId\n }\n\n // remove subscription by removing the listener function\n function unsubscribe (id) {\n listeners[id] = undefined;\n }\n\n return { getState: getState, setState: setState, subscribe: subscribe, unsubscribe: unsubscribe }\n}\n\nexport default createBroadcast;\n","var r;\n\nmodule.exports = function rand(len) {\n if (!r)\n r = new Rand(null);\n\n return r.generate(len);\n};\n\nfunction Rand(rand) {\n this.rand = rand;\n}\nmodule.exports.Rand = Rand;\n\nRand.prototype.generate = function generate(len) {\n return this._rand(len);\n};\n\n// Emulate crypto API using randy\nRand.prototype._rand = function _rand(n) {\n if (this.rand.getBytes)\n return this.rand.getBytes(n);\n\n var res = new Uint8Array(n);\n for (var i = 0; i < res.length; i++)\n res[i] = this.rand.getByte();\n return res;\n};\n\nif (typeof self === 'object') {\n if (self.crypto && self.crypto.getRandomValues) {\n // Modern browsers\n Rand.prototype._rand = function _rand(n) {\n var arr = new Uint8Array(n);\n self.crypto.getRandomValues(arr);\n return arr;\n };\n } else if (self.msCrypto && self.msCrypto.getRandomValues) {\n // IE\n Rand.prototype._rand = function _rand(n) {\n var arr = new Uint8Array(n);\n self.msCrypto.getRandomValues(arr);\n return arr;\n };\n\n // Safari's WebWorkers do not have `crypto`\n } else if (typeof window === 'object') {\n // Old junk\n Rand.prototype._rand = function() {\n throw new Error('Not implemented yet');\n };\n }\n} else {\n // Node.js or Web worker with no crypto support\n try {\n var crypto = require('crypto');\n if (typeof crypto.randomBytes !== 'function')\n throw new Error('Not supported');\n\n Rand.prototype._rand = function _rand(n) {\n return crypto.randomBytes(n);\n };\n } catch (e) {\n }\n}\n","// based on the aes implimentation in triple sec\n// https://github.com/keybase/triplesec\n// which is in turn based on the one from crypto-js\n// https://code.google.com/p/crypto-js/\n\nvar Buffer = require('safe-buffer').Buffer\n\nfunction asUInt32Array (buf) {\n if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf)\n\n var len = (buf.length / 4) | 0\n var out = new Array(len)\n\n for (var i = 0; i < len; i++) {\n out[i] = buf.readUInt32BE(i * 4)\n }\n\n return out\n}\n\nfunction scrubVec (v) {\n for (var i = 0; i < v.length; v++) {\n v[i] = 0\n }\n}\n\nfunction cryptBlock (M, keySchedule, SUB_MIX, SBOX, nRounds) {\n var SUB_MIX0 = SUB_MIX[0]\n var SUB_MIX1 = SUB_MIX[1]\n var SUB_MIX2 = SUB_MIX[2]\n var SUB_MIX3 = SUB_MIX[3]\n\n var s0 = M[0] ^ keySchedule[0]\n var s1 = M[1] ^ keySchedule[1]\n var s2 = M[2] ^ keySchedule[2]\n var s3 = M[3] ^ keySchedule[3]\n var t0, t1, t2, t3\n var ksRow = 4\n\n for (var round = 1; round < nRounds; round++) {\n t0 = SUB_MIX0[s0 >>> 24] ^ SUB_MIX1[(s1 >>> 16) & 0xff] ^ SUB_MIX2[(s2 >>> 8) & 0xff] ^ SUB_MIX3[s3 & 0xff] ^ keySchedule[ksRow++]\n t1 = SUB_MIX0[s1 >>> 24] ^ SUB_MIX1[(s2 >>> 16) & 0xff] ^ SUB_MIX2[(s3 >>> 8) & 0xff] ^ SUB_MIX3[s0 & 0xff] ^ keySchedule[ksRow++]\n t2 = SUB_MIX0[s2 >>> 24] ^ SUB_MIX1[(s3 >>> 16) & 0xff] ^ SUB_MIX2[(s0 >>> 8) & 0xff] ^ SUB_MIX3[s1 & 0xff] ^ keySchedule[ksRow++]\n t3 = SUB_MIX0[s3 >>> 24] ^ SUB_MIX1[(s0 >>> 16) & 0xff] ^ SUB_MIX2[(s1 >>> 8) & 0xff] ^ SUB_MIX3[s2 & 0xff] ^ keySchedule[ksRow++]\n s0 = t0\n s1 = t1\n s2 = t2\n s3 = t3\n }\n\n t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++]\n t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++]\n t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++]\n t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++]\n t0 = t0 >>> 0\n t1 = t1 >>> 0\n t2 = t2 >>> 0\n t3 = t3 >>> 0\n\n return [t0, t1, t2, t3]\n}\n\n// AES constants\nvar RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36]\nvar G = (function () {\n // Compute double table\n var d = new Array(256)\n for (var j = 0; j < 256; j++) {\n if (j < 128) {\n d[j] = j << 1\n } else {\n d[j] = (j << 1) ^ 0x11b\n }\n }\n\n var SBOX = []\n var INV_SBOX = []\n var SUB_MIX = [[], [], [], []]\n var INV_SUB_MIX = [[], [], [], []]\n\n // Walk GF(2^8)\n var x = 0\n var xi = 0\n for (var i = 0; i < 256; ++i) {\n // Compute sbox\n var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4)\n sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63\n SBOX[x] = sx\n INV_SBOX[sx] = x\n\n // Compute multiplication\n var x2 = d[x]\n var x4 = d[x2]\n var x8 = d[x4]\n\n // Compute sub bytes, mix columns tables\n var t = (d[sx] * 0x101) ^ (sx * 0x1010100)\n SUB_MIX[0][x] = (t << 24) | (t >>> 8)\n SUB_MIX[1][x] = (t << 16) | (t >>> 16)\n SUB_MIX[2][x] = (t << 8) | (t >>> 24)\n SUB_MIX[3][x] = t\n\n // Compute inv sub bytes, inv mix columns tables\n t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100)\n INV_SUB_MIX[0][sx] = (t << 24) | (t >>> 8)\n INV_SUB_MIX[1][sx] = (t << 16) | (t >>> 16)\n INV_SUB_MIX[2][sx] = (t << 8) | (t >>> 24)\n INV_SUB_MIX[3][sx] = t\n\n if (x === 0) {\n x = xi = 1\n } else {\n x = x2 ^ d[d[d[x8 ^ x2]]]\n xi ^= d[d[xi]]\n }\n }\n\n return {\n SBOX: SBOX,\n INV_SBOX: INV_SBOX,\n SUB_MIX: SUB_MIX,\n INV_SUB_MIX: INV_SUB_MIX\n }\n})()\n\nfunction AES (key) {\n this._key = asUInt32Array(key)\n this._reset()\n}\n\nAES.blockSize = 4 * 4\nAES.keySize = 256 / 8\nAES.prototype.blockSize = AES.blockSize\nAES.prototype.keySize = AES.keySize\nAES.prototype._reset = function () {\n var keyWords = this._key\n var keySize = keyWords.length\n var nRounds = keySize + 6\n var ksRows = (nRounds + 1) * 4\n\n var keySchedule = []\n for (var k = 0; k < keySize; k++) {\n keySchedule[k] = keyWords[k]\n }\n\n for (k = keySize; k < ksRows; k++) {\n var t = keySchedule[k - 1]\n\n if (k % keySize === 0) {\n t = (t << 8) | (t >>> 24)\n t =\n (G.SBOX[t >>> 24] << 24) |\n (G.SBOX[(t >>> 16) & 0xff] << 16) |\n (G.SBOX[(t >>> 8) & 0xff] << 8) |\n (G.SBOX[t & 0xff])\n\n t ^= RCON[(k / keySize) | 0] << 24\n } else if (keySize > 6 && k % keySize === 4) {\n t =\n (G.SBOX[t >>> 24] << 24) |\n (G.SBOX[(t >>> 16) & 0xff] << 16) |\n (G.SBOX[(t >>> 8) & 0xff] << 8) |\n (G.SBOX[t & 0xff])\n }\n\n keySchedule[k] = keySchedule[k - keySize] ^ t\n }\n\n var invKeySchedule = []\n for (var ik = 0; ik < ksRows; ik++) {\n var ksR = ksRows - ik\n var tt = keySchedule[ksR - (ik % 4 ? 0 : 4)]\n\n if (ik < 4 || ksR <= 4) {\n invKeySchedule[ik] = tt\n } else {\n invKeySchedule[ik] =\n G.INV_SUB_MIX[0][G.SBOX[tt >>> 24]] ^\n G.INV_SUB_MIX[1][G.SBOX[(tt >>> 16) & 0xff]] ^\n G.INV_SUB_MIX[2][G.SBOX[(tt >>> 8) & 0xff]] ^\n G.INV_SUB_MIX[3][G.SBOX[tt & 0xff]]\n }\n }\n\n this._nRounds = nRounds\n this._keySchedule = keySchedule\n this._invKeySchedule = invKeySchedule\n}\n\nAES.prototype.encryptBlockRaw = function (M) {\n M = asUInt32Array(M)\n return cryptBlock(M, this._keySchedule, G.SUB_MIX, G.SBOX, this._nRounds)\n}\n\nAES.prototype.encryptBlock = function (M) {\n var out = this.encryptBlockRaw(M)\n var buf = Buffer.allocUnsafe(16)\n buf.writeUInt32BE(out[0], 0)\n buf.writeUInt32BE(out[1], 4)\n buf.writeUInt32BE(out[2], 8)\n buf.writeUInt32BE(out[3], 12)\n return buf\n}\n\nAES.prototype.decryptBlock = function (M) {\n M = asUInt32Array(M)\n\n // swap\n var m1 = M[1]\n M[1] = M[3]\n M[3] = m1\n\n var out = cryptBlock(M, this._invKeySchedule, G.INV_SUB_MIX, G.INV_SBOX, this._nRounds)\n var buf = Buffer.allocUnsafe(16)\n buf.writeUInt32BE(out[0], 0)\n buf.writeUInt32BE(out[3], 4)\n buf.writeUInt32BE(out[2], 8)\n buf.writeUInt32BE(out[1], 12)\n return buf\n}\n\nAES.prototype.scrub = function () {\n scrubVec(this._keySchedule)\n scrubVec(this._invKeySchedule)\n scrubVec(this._key)\n}\n\nmodule.exports.AES = AES\n","var aes = require('./aes')\nvar Buffer = require('safe-buffer').Buffer\nvar Transform = require('cipher-base')\nvar inherits = require('inherits')\nvar GHASH = require('./ghash')\nvar xor = require('buffer-xor')\nvar incr32 = require('./incr32')\n\nfunction xorTest (a, b) {\n var out = 0\n if (a.length !== b.length) out++\n\n var len = Math.min(a.length, b.length)\n for (var i = 0; i < len; ++i) {\n out += (a[i] ^ b[i])\n }\n\n return out\n}\n\nfunction calcIv (self, iv, ck) {\n if (iv.length === 12) {\n self._finID = Buffer.concat([iv, Buffer.from([0, 0, 0, 1])])\n return Buffer.concat([iv, Buffer.from([0, 0, 0, 2])])\n }\n var ghash = new GHASH(ck)\n var len = iv.length\n var toPad = len % 16\n ghash.update(iv)\n if (toPad) {\n toPad = 16 - toPad\n ghash.update(Buffer.alloc(toPad, 0))\n }\n ghash.update(Buffer.alloc(8, 0))\n var ivBits = len * 8\n var tail = Buffer.alloc(8)\n tail.writeUIntBE(ivBits, 0, 8)\n ghash.update(tail)\n self._finID = ghash.state\n var out = Buffer.from(self._finID)\n incr32(out)\n return out\n}\nfunction StreamCipher (mode, key, iv, decrypt) {\n Transform.call(this)\n\n var h = Buffer.alloc(4, 0)\n\n this._cipher = new aes.AES(key)\n var ck = this._cipher.encryptBlock(h)\n this._ghash = new GHASH(ck)\n iv = calcIv(this, iv, ck)\n\n this._prev = Buffer.from(iv)\n this._cache = Buffer.allocUnsafe(0)\n this._secCache = Buffer.allocUnsafe(0)\n this._decrypt = decrypt\n this._alen = 0\n this._len = 0\n this._mode = mode\n\n this._authTag = null\n this._called = false\n}\n\ninherits(StreamCipher, Transform)\n\nStreamCipher.prototype._update = function (chunk) {\n if (!this._called && this._alen) {\n var rump = 16 - (this._alen % 16)\n if (rump < 16) {\n rump = Buffer.alloc(rump, 0)\n this._ghash.update(rump)\n }\n }\n\n this._called = true\n var out = this._mode.encrypt(this, chunk)\n if (this._decrypt) {\n this._ghash.update(chunk)\n } else {\n this._ghash.update(out)\n }\n this._len += chunk.length\n return out\n}\n\nStreamCipher.prototype._final = function () {\n if (this._decrypt && !this._authTag) throw new Error('Unsupported state or unable to authenticate data')\n\n var tag = xor(this._ghash.final(this._alen * 8, this._len * 8), this._cipher.encryptBlock(this._finID))\n if (this._decrypt && xorTest(tag, this._authTag)) throw new Error('Unsupported state or unable to authenticate data')\n\n this._authTag = tag\n this._cipher.scrub()\n}\n\nStreamCipher.prototype.getAuthTag = function getAuthTag () {\n if (this._decrypt || !Buffer.isBuffer(this._authTag)) throw new Error('Attempting to get auth tag in unsupported state')\n\n return this._authTag\n}\n\nStreamCipher.prototype.setAuthTag = function setAuthTag (tag) {\n if (!this._decrypt) throw new Error('Attempting to set auth tag in unsupported state')\n\n this._authTag = tag\n}\n\nStreamCipher.prototype.setAAD = function setAAD (buf) {\n if (this._called) throw new Error('Attempting to set AAD in unsupported state')\n\n this._ghash.update(buf)\n this._alen += buf.length\n}\n\nmodule.exports = StreamCipher\n","var ciphers = require('./encrypter')\nvar deciphers = require('./decrypter')\nvar modes = require('./modes/list.json')\n\nfunction getCiphers () {\n return Object.keys(modes)\n}\n\nexports.createCipher = exports.Cipher = ciphers.createCipher\nexports.createCipheriv = exports.Cipheriv = ciphers.createCipheriv\nexports.createDecipher = exports.Decipher = deciphers.createDecipher\nexports.createDecipheriv = exports.Decipheriv = deciphers.createDecipheriv\nexports.listCiphers = exports.getCiphers = getCiphers\n","var AuthCipher = require('./authCipher')\nvar Buffer = require('safe-buffer').Buffer\nvar MODES = require('./modes')\nvar StreamCipher = require('./streamCipher')\nvar Transform = require('cipher-base')\nvar aes = require('./aes')\nvar ebtk = require('evp_bytestokey')\nvar inherits = require('inherits')\n\nfunction Decipher (mode, key, iv) {\n Transform.call(this)\n\n this._cache = new Splitter()\n this._last = void 0\n this._cipher = new aes.AES(key)\n this._prev = Buffer.from(iv)\n this._mode = mode\n this._autopadding = true\n}\n\ninherits(Decipher, Transform)\n\nDecipher.prototype._update = function (data) {\n this._cache.add(data)\n var chunk\n var thing\n var out = []\n while ((chunk = this._cache.get(this._autopadding))) {\n thing = this._mode.decrypt(this, chunk)\n out.push(thing)\n }\n return Buffer.concat(out)\n}\n\nDecipher.prototype._final = function () {\n var chunk = this._cache.flush()\n if (this._autopadding) {\n return unpad(this._mode.decrypt(this, chunk))\n } else if (chunk) {\n throw new Error('data not multiple of block length')\n }\n}\n\nDecipher.prototype.setAutoPadding = function (setTo) {\n this._autopadding = !!setTo\n return this\n}\n\nfunction Splitter () {\n this.cache = Buffer.allocUnsafe(0)\n}\n\nSplitter.prototype.add = function (data) {\n this.cache = Buffer.concat([this.cache, data])\n}\n\nSplitter.prototype.get = function (autoPadding) {\n var out\n if (autoPadding) {\n if (this.cache.length > 16) {\n out = this.cache.slice(0, 16)\n this.cache = this.cache.slice(16)\n return out\n }\n } else {\n if (this.cache.length >= 16) {\n out = this.cache.slice(0, 16)\n this.cache = this.cache.slice(16)\n return out\n }\n }\n\n return null\n}\n\nSplitter.prototype.flush = function () {\n if (this.cache.length) return this.cache\n}\n\nfunction unpad (last) {\n var padded = last[15]\n var i = -1\n while (++i < padded) {\n if (last[(i + (16 - padded))] !== padded) {\n throw new Error('unable to decrypt data')\n }\n }\n if (padded === 16) return\n\n return last.slice(0, 16 - padded)\n}\n\nfunction createDecipheriv (suite, password, iv) {\n var config = MODES[suite.toLowerCase()]\n if (!config) throw new TypeError('invalid suite type')\n\n if (typeof iv === 'string') iv = Buffer.from(iv)\n if (config.mode !== 'GCM' && iv.length !== config.iv) throw new TypeError('invalid iv length ' + iv.length)\n\n if (typeof password === 'string') password = Buffer.from(password)\n if (password.length !== config.key / 8) throw new TypeError('invalid key length ' + password.length)\n\n if (config.type === 'stream') {\n return new StreamCipher(config.module, password, iv, true)\n } else if (config.type === 'auth') {\n return new AuthCipher(config.module, password, iv, true)\n }\n\n return new Decipher(config.module, password, iv)\n}\n\nfunction createDecipher (suite, password) {\n var config = MODES[suite.toLowerCase()]\n if (!config) throw new TypeError('invalid suite type')\n\n var keys = ebtk(password, false, config.key, config.iv)\n return createDecipheriv(suite, keys.key, keys.iv)\n}\n\nexports.createDecipher = createDecipher\nexports.createDecipheriv = createDecipheriv\n","var MODES = require('./modes')\nvar AuthCipher = require('./authCipher')\nvar Buffer = require('safe-buffer').Buffer\nvar StreamCipher = require('./streamCipher')\nvar Transform = require('cipher-base')\nvar aes = require('./aes')\nvar ebtk = require('evp_bytestokey')\nvar inherits = require('inherits')\n\nfunction Cipher (mode, key, iv) {\n Transform.call(this)\n\n this._cache = new Splitter()\n this._cipher = new aes.AES(key)\n this._prev = Buffer.from(iv)\n this._mode = mode\n this._autopadding = true\n}\n\ninherits(Cipher, Transform)\n\nCipher.prototype._update = function (data) {\n this._cache.add(data)\n var chunk\n var thing\n var out = []\n\n while ((chunk = this._cache.get())) {\n thing = this._mode.encrypt(this, chunk)\n out.push(thing)\n }\n\n return Buffer.concat(out)\n}\n\nvar PADDING = Buffer.alloc(16, 0x10)\n\nCipher.prototype._final = function () {\n var chunk = this._cache.flush()\n if (this._autopadding) {\n chunk = this._mode.encrypt(this, chunk)\n this._cipher.scrub()\n return chunk\n }\n\n if (!chunk.equals(PADDING)) {\n this._cipher.scrub()\n throw new Error('data not multiple of block length')\n }\n}\n\nCipher.prototype.setAutoPadding = function (setTo) {\n this._autopadding = !!setTo\n return this\n}\n\nfunction Splitter () {\n this.cache = Buffer.allocUnsafe(0)\n}\n\nSplitter.prototype.add = function (data) {\n this.cache = Buffer.concat([this.cache, data])\n}\n\nSplitter.prototype.get = function () {\n if (this.cache.length > 15) {\n var out = this.cache.slice(0, 16)\n this.cache = this.cache.slice(16)\n return out\n }\n return null\n}\n\nSplitter.prototype.flush = function () {\n var len = 16 - this.cache.length\n var padBuff = Buffer.allocUnsafe(len)\n\n var i = -1\n while (++i < len) {\n padBuff.writeUInt8(len, i)\n }\n\n return Buffer.concat([this.cache, padBuff])\n}\n\nfunction createCipheriv (suite, password, iv) {\n var config = MODES[suite.toLowerCase()]\n if (!config) throw new TypeError('invalid suite type')\n\n if (typeof password === 'string') password = Buffer.from(password)\n if (password.length !== config.key / 8) throw new TypeError('invalid key length ' + password.length)\n\n if (typeof iv === 'string') iv = Buffer.from(iv)\n if (config.mode !== 'GCM' && iv.length !== config.iv) throw new TypeError('invalid iv length ' + iv.length)\n\n if (config.type === 'stream') {\n return new StreamCipher(config.module, password, iv)\n } else if (config.type === 'auth') {\n return new AuthCipher(config.module, password, iv)\n }\n\n return new Cipher(config.module, password, iv)\n}\n\nfunction createCipher (suite, password) {\n var config = MODES[suite.toLowerCase()]\n if (!config) throw new TypeError('invalid suite type')\n\n var keys = ebtk(password, false, config.key, config.iv)\n return createCipheriv(suite, keys.key, keys.iv)\n}\n\nexports.createCipheriv = createCipheriv\nexports.createCipher = createCipher\n","var Buffer = require('safe-buffer').Buffer\nvar ZEROES = Buffer.alloc(16, 0)\n\nfunction toArray (buf) {\n return [\n buf.readUInt32BE(0),\n buf.readUInt32BE(4),\n buf.readUInt32BE(8),\n buf.readUInt32BE(12)\n ]\n}\n\nfunction fromArray (out) {\n var buf = Buffer.allocUnsafe(16)\n buf.writeUInt32BE(out[0] >>> 0, 0)\n buf.writeUInt32BE(out[1] >>> 0, 4)\n buf.writeUInt32BE(out[2] >>> 0, 8)\n buf.writeUInt32BE(out[3] >>> 0, 12)\n return buf\n}\n\nfunction GHASH (key) {\n this.h = key\n this.state = Buffer.alloc(16, 0)\n this.cache = Buffer.allocUnsafe(0)\n}\n\n// from http://bitwiseshiftleft.github.io/sjcl/doc/symbols/src/core_gcm.js.html\n// by Juho Vähä-Herttua\nGHASH.prototype.ghash = function (block) {\n var i = -1\n while (++i < block.length) {\n this.state[i] ^= block[i]\n }\n this._multiply()\n}\n\nGHASH.prototype._multiply = function () {\n var Vi = toArray(this.h)\n var Zi = [0, 0, 0, 0]\n var j, xi, lsbVi\n var i = -1\n while (++i < 128) {\n xi = (this.state[~~(i / 8)] & (1 << (7 - (i % 8)))) !== 0\n if (xi) {\n // Z_i+1 = Z_i ^ V_i\n Zi[0] ^= Vi[0]\n Zi[1] ^= Vi[1]\n Zi[2] ^= Vi[2]\n Zi[3] ^= Vi[3]\n }\n\n // Store the value of LSB(V_i)\n lsbVi = (Vi[3] & 1) !== 0\n\n // V_i+1 = V_i >> 1\n for (j = 3; j > 0; j--) {\n Vi[j] = (Vi[j] >>> 1) | ((Vi[j - 1] & 1) << 31)\n }\n Vi[0] = Vi[0] >>> 1\n\n // If LSB(V_i) is 1, V_i+1 = (V_i >> 1) ^ R\n if (lsbVi) {\n Vi[0] = Vi[0] ^ (0xe1 << 24)\n }\n }\n this.state = fromArray(Zi)\n}\n\nGHASH.prototype.update = function (buf) {\n this.cache = Buffer.concat([this.cache, buf])\n var chunk\n while (this.cache.length >= 16) {\n chunk = this.cache.slice(0, 16)\n this.cache = this.cache.slice(16)\n this.ghash(chunk)\n }\n}\n\nGHASH.prototype.final = function (abl, bl) {\n if (this.cache.length) {\n this.ghash(Buffer.concat([this.cache, ZEROES], 16))\n }\n\n this.ghash(fromArray([0, abl, 0, bl]))\n return this.state\n}\n\nmodule.exports = GHASH\n","function incr32 (iv) {\n var len = iv.length\n var item\n while (len--) {\n item = iv.readUInt8(len)\n if (item === 255) {\n iv.writeUInt8(0, len)\n } else {\n item++\n iv.writeUInt8(item, len)\n break\n }\n }\n}\nmodule.exports = incr32\n","var xor = require('buffer-xor')\n\nexports.encrypt = function (self, block) {\n var data = xor(block, self._prev)\n\n self._prev = self._cipher.encryptBlock(data)\n return self._prev\n}\n\nexports.decrypt = function (self, block) {\n var pad = self._prev\n\n self._prev = block\n var out = self._cipher.decryptBlock(block)\n\n return xor(out, pad)\n}\n","var Buffer = require('safe-buffer').Buffer\nvar xor = require('buffer-xor')\n\nfunction encryptStart (self, data, decrypt) {\n var len = data.length\n var out = xor(data, self._cache)\n self._cache = self._cache.slice(len)\n self._prev = Buffer.concat([self._prev, decrypt ? data : out])\n return out\n}\n\nexports.encrypt = function (self, data, decrypt) {\n var out = Buffer.allocUnsafe(0)\n var len\n\n while (data.length) {\n if (self._cache.length === 0) {\n self._cache = self._cipher.encryptBlock(self._prev)\n self._prev = Buffer.allocUnsafe(0)\n }\n\n if (self._cache.length <= data.length) {\n len = self._cache.length\n out = Buffer.concat([out, encryptStart(self, data.slice(0, len), decrypt)])\n data = data.slice(len)\n } else {\n out = Buffer.concat([out, encryptStart(self, data, decrypt)])\n break\n }\n }\n\n return out\n}\n","var Buffer = require('safe-buffer').Buffer\n\nfunction encryptByte (self, byteParam, decrypt) {\n var pad\n var i = -1\n var len = 8\n var out = 0\n var bit, value\n while (++i < len) {\n pad = self._cipher.encryptBlock(self._prev)\n bit = (byteParam & (1 << (7 - i))) ? 0x80 : 0\n value = pad[0] ^ bit\n out += ((value & 0x80) >> (i % 8))\n self._prev = shiftIn(self._prev, decrypt ? bit : value)\n }\n return out\n}\n\nfunction shiftIn (buffer, value) {\n var len = buffer.length\n var i = -1\n var out = Buffer.allocUnsafe(buffer.length)\n buffer = Buffer.concat([buffer, Buffer.from([value])])\n\n while (++i < len) {\n out[i] = buffer[i] << 1 | buffer[i + 1] >> (7)\n }\n\n return out\n}\n\nexports.encrypt = function (self, chunk, decrypt) {\n var len = chunk.length\n var out = Buffer.allocUnsafe(len)\n var i = -1\n\n while (++i < len) {\n out[i] = encryptByte(self, chunk[i], decrypt)\n }\n\n return out\n}\n","var Buffer = require('safe-buffer').Buffer\n\nfunction encryptByte (self, byteParam, decrypt) {\n var pad = self._cipher.encryptBlock(self._prev)\n var out = pad[0] ^ byteParam\n\n self._prev = Buffer.concat([\n self._prev.slice(1),\n Buffer.from([decrypt ? byteParam : out])\n ])\n\n return out\n}\n\nexports.encrypt = function (self, chunk, decrypt) {\n var len = chunk.length\n var out = Buffer.allocUnsafe(len)\n var i = -1\n\n while (++i < len) {\n out[i] = encryptByte(self, chunk[i], decrypt)\n }\n\n return out\n}\n","var xor = require('buffer-xor')\nvar Buffer = require('safe-buffer').Buffer\nvar incr32 = require('../incr32')\n\nfunction getBlock (self) {\n var out = self._cipher.encryptBlockRaw(self._prev)\n incr32(self._prev)\n return out\n}\n\nvar blockSize = 16\nexports.encrypt = function (self, chunk) {\n var chunkNum = Math.ceil(chunk.length / blockSize)\n var start = self._cache.length\n self._cache = Buffer.concat([\n self._cache,\n Buffer.allocUnsafe(chunkNum * blockSize)\n ])\n for (var i = 0; i < chunkNum; i++) {\n var out = getBlock(self)\n var offset = start + i * blockSize\n self._cache.writeUInt32BE(out[0], offset + 0)\n self._cache.writeUInt32BE(out[1], offset + 4)\n self._cache.writeUInt32BE(out[2], offset + 8)\n self._cache.writeUInt32BE(out[3], offset + 12)\n }\n var pad = self._cache.slice(0, chunk.length)\n self._cache = self._cache.slice(chunk.length)\n return xor(chunk, pad)\n}\n","exports.encrypt = function (self, block) {\n return self._cipher.encryptBlock(block)\n}\n\nexports.decrypt = function (self, block) {\n return self._cipher.decryptBlock(block)\n}\n","var modeModules = {\n ECB: require('./ecb'),\n CBC: require('./cbc'),\n CFB: require('./cfb'),\n CFB8: require('./cfb8'),\n CFB1: require('./cfb1'),\n OFB: require('./ofb'),\n CTR: require('./ctr'),\n GCM: require('./ctr')\n}\n\nvar modes = require('./list.json')\n\nfor (var key in modes) {\n modes[key].module = modeModules[modes[key].mode]\n}\n\nmodule.exports = modes\n","var xor = require('buffer-xor')\n\nfunction getBlock (self) {\n self._prev = self._cipher.encryptBlock(self._prev)\n return self._prev\n}\n\nexports.encrypt = function (self, chunk) {\n while (self._cache.length < chunk.length) {\n self._cache = Buffer.concat([self._cache, getBlock(self)])\n }\n\n var pad = self._cache.slice(0, chunk.length)\n self._cache = self._cache.slice(chunk.length)\n return xor(chunk, pad)\n}\n","var aes = require('./aes')\nvar Buffer = require('safe-buffer').Buffer\nvar Transform = require('cipher-base')\nvar inherits = require('inherits')\n\nfunction StreamCipher (mode, key, iv, decrypt) {\n Transform.call(this)\n\n this._cipher = new aes.AES(key)\n this._prev = Buffer.from(iv)\n this._cache = Buffer.allocUnsafe(0)\n this._secCache = Buffer.allocUnsafe(0)\n this._decrypt = decrypt\n this._mode = mode\n}\n\ninherits(StreamCipher, Transform)\n\nStreamCipher.prototype._update = function (chunk) {\n return this._mode.encrypt(this, chunk, this._decrypt)\n}\n\nStreamCipher.prototype._final = function () {\n this._cipher.scrub()\n}\n\nmodule.exports = StreamCipher\n","var ebtk = require('evp_bytestokey')\nvar aes = require('browserify-aes/browser')\nvar DES = require('browserify-des')\nvar desModes = require('browserify-des/modes')\nvar aesModes = require('browserify-aes/modes')\nfunction createCipher (suite, password) {\n var keyLen, ivLen\n suite = suite.toLowerCase()\n if (aesModes[suite]) {\n keyLen = aesModes[suite].key\n ivLen = aesModes[suite].iv\n } else if (desModes[suite]) {\n keyLen = desModes[suite].key * 8\n ivLen = desModes[suite].iv\n } else {\n throw new TypeError('invalid suite type')\n }\n var keys = ebtk(password, false, keyLen, ivLen)\n return createCipheriv(suite, keys.key, keys.iv)\n}\nfunction createDecipher (suite, password) {\n var keyLen, ivLen\n suite = suite.toLowerCase()\n if (aesModes[suite]) {\n keyLen = aesModes[suite].key\n ivLen = aesModes[suite].iv\n } else if (desModes[suite]) {\n keyLen = desModes[suite].key * 8\n ivLen = desModes[suite].iv\n } else {\n throw new TypeError('invalid suite type')\n }\n var keys = ebtk(password, false, keyLen, ivLen)\n return createDecipheriv(suite, keys.key, keys.iv)\n}\n\nfunction createCipheriv (suite, key, iv) {\n suite = suite.toLowerCase()\n if (aesModes[suite]) {\n return aes.createCipheriv(suite, key, iv)\n } else if (desModes[suite]) {\n return new DES({\n key: key,\n iv: iv,\n mode: suite\n })\n } else {\n throw new TypeError('invalid suite type')\n }\n}\nfunction createDecipheriv (suite, key, iv) {\n suite = suite.toLowerCase()\n if (aesModes[suite]) {\n return aes.createDecipheriv(suite, key, iv)\n } else if (desModes[suite]) {\n return new DES({\n key: key,\n iv: iv,\n mode: suite,\n decrypt: true\n })\n } else {\n throw new TypeError('invalid suite type')\n }\n}\nexports.createCipher = exports.Cipher = createCipher\nexports.createCipheriv = exports.Cipheriv = createCipheriv\nexports.createDecipher = exports.Decipher = createDecipher\nexports.createDecipheriv = exports.Decipheriv = createDecipheriv\nfunction getCiphers () {\n return Object.keys(desModes).concat(aes.getCiphers())\n}\nexports.listCiphers = exports.getCiphers = getCiphers\n","var CipherBase = require('cipher-base')\nvar des = require('des.js')\nvar inherits = require('inherits')\n\nvar modes = {\n 'des-ede3-cbc': des.CBC.instantiate(des.EDE),\n 'des-ede3': des.EDE,\n 'des-ede-cbc': des.CBC.instantiate(des.EDE),\n 'des-ede': des.EDE,\n 'des-cbc': des.CBC.instantiate(des.DES),\n 'des-ecb': des.DES\n}\nmodes.des = modes['des-cbc']\nmodes.des3 = modes['des-ede3-cbc']\nmodule.exports = DES\ninherits(DES, CipherBase)\nfunction DES (opts) {\n CipherBase.call(this)\n var modeName = opts.mode.toLowerCase()\n var mode = modes[modeName]\n var type\n if (opts.decrypt) {\n type = 'decrypt'\n } else {\n type = 'encrypt'\n }\n var key = opts.key\n if (modeName === 'des-ede' || modeName === 'des-ede-cbc') {\n key = Buffer.concat([key, key.slice(0, 8)])\n }\n var iv = opts.iv\n this._des = mode.create({\n key: key,\n iv: iv,\n type: type\n })\n}\nDES.prototype._update = function (data) {\n return new Buffer(this._des.update(data))\n}\nDES.prototype._final = function () {\n return new Buffer(this._des.final())\n}\n","exports['des-ecb'] = {\n key: 8,\n iv: 0\n}\nexports['des-cbc'] = exports.des = {\n key: 8,\n iv: 8\n}\nexports['des-ede3-cbc'] = exports.des3 = {\n key: 24,\n iv: 8\n}\nexports['des-ede3'] = {\n key: 24,\n iv: 0\n}\nexports['des-ede-cbc'] = {\n key: 16,\n iv: 8\n}\nexports['des-ede'] = {\n key: 16,\n iv: 0\n}\n","var bn = require('bn.js');\nvar randomBytes = require('randombytes');\nmodule.exports = crt;\nfunction blind(priv) {\n var r = getr(priv);\n var blinder = r.toRed(bn.mont(priv.modulus))\n .redPow(new bn(priv.publicExponent)).fromRed();\n return {\n blinder: blinder,\n unblinder:r.invm(priv.modulus)\n };\n}\nfunction crt(msg, priv) {\n var blinds = blind(priv);\n var len = priv.modulus.byteLength();\n var mod = bn.mont(priv.modulus);\n var blinded = new bn(msg).mul(blinds.blinder).umod(priv.modulus);\n var c1 = blinded.toRed(bn.mont(priv.prime1));\n var c2 = blinded.toRed(bn.mont(priv.prime2));\n var qinv = priv.coefficient;\n var p = priv.prime1;\n var q = priv.prime2;\n var m1 = c1.redPow(priv.exponent1);\n var m2 = c2.redPow(priv.exponent2);\n m1 = m1.fromRed();\n m2 = m2.fromRed();\n var h = m1.isub(m2).imul(qinv).umod(p);\n h.imul(q);\n m2.iadd(h);\n return new Buffer(m2.imul(blinds.unblinder).umod(priv.modulus).toArray(false, len));\n}\ncrt.getr = getr;\nfunction getr(priv) {\n var len = priv.modulus.byteLength();\n var r = new bn(randomBytes(len));\n while (r.cmp(priv.modulus) >= 0 || !r.umod(priv.prime1) || !r.umod(priv.prime2)) {\n r = new bn(randomBytes(len));\n }\n return r;\n}\n","module.exports = require('./browser/algorithms.json')\n","var createHash = require('create-hash')\nvar stream = require('stream')\nvar inherits = require('inherits')\nvar sign = require('./sign')\nvar verify = require('./verify')\n\nvar algorithms = require('./algorithms.json')\nObject.keys(algorithms).forEach(function (key) {\n algorithms[key].id = new Buffer(algorithms[key].id, 'hex')\n algorithms[key.toLowerCase()] = algorithms[key]\n})\n\nfunction Sign (algorithm) {\n stream.Writable.call(this)\n\n var data = algorithms[algorithm]\n if (!data) throw new Error('Unknown message digest')\n\n this._hashType = data.hash\n this._hash = createHash(data.hash)\n this._tag = data.id\n this._signType = data.sign\n}\ninherits(Sign, stream.Writable)\n\nSign.prototype._write = function _write (data, _, done) {\n this._hash.update(data)\n done()\n}\n\nSign.prototype.update = function update (data, enc) {\n if (typeof data === 'string') data = new Buffer(data, enc)\n\n this._hash.update(data)\n return this\n}\n\nSign.prototype.sign = function signMethod (key, enc) {\n this.end()\n var hash = this._hash.digest()\n var sig = sign(hash, key, this._hashType, this._signType, this._tag)\n\n return enc ? sig.toString(enc) : sig\n}\n\nfunction Verify (algorithm) {\n stream.Writable.call(this)\n\n var data = algorithms[algorithm]\n if (!data) throw new Error('Unknown message digest')\n\n this._hash = createHash(data.hash)\n this._tag = data.id\n this._signType = data.sign\n}\ninherits(Verify, stream.Writable)\n\nVerify.prototype._write = function _write (data, _, done) {\n this._hash.update(data)\n done()\n}\n\nVerify.prototype.update = function update (data, enc) {\n if (typeof data === 'string') data = new Buffer(data, enc)\n\n this._hash.update(data)\n return this\n}\n\nVerify.prototype.verify = function verifyMethod (key, sig, enc) {\n if (typeof sig === 'string') sig = new Buffer(sig, enc)\n\n this.end()\n var hash = this._hash.digest()\n return verify(sig, hash, key, this._signType, this._tag)\n}\n\nfunction createSign (algorithm) {\n return new Sign(algorithm)\n}\n\nfunction createVerify (algorithm) {\n return new Verify(algorithm)\n}\n\nmodule.exports = {\n Sign: createSign,\n Verify: createVerify,\n createSign: createSign,\n createVerify: createVerify\n}\n","// much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js\nvar createHmac = require('create-hmac')\nvar crt = require('browserify-rsa')\nvar EC = require('elliptic').ec\nvar BN = require('bn.js')\nvar parseKeys = require('parse-asn1')\nvar curves = require('./curves.json')\n\nfunction sign (hash, key, hashType, signType, tag) {\n var priv = parseKeys(key)\n if (priv.curve) {\n // rsa keys can be interpreted as ecdsa ones in openssl\n if (signType !== 'ecdsa' && signType !== 'ecdsa/rsa') throw new Error('wrong private key type')\n return ecSign(hash, priv)\n } else if (priv.type === 'dsa') {\n if (signType !== 'dsa') throw new Error('wrong private key type')\n return dsaSign(hash, priv, hashType)\n } else {\n if (signType !== 'rsa' && signType !== 'ecdsa/rsa') throw new Error('wrong private key type')\n }\n hash = Buffer.concat([tag, hash])\n var len = priv.modulus.byteLength()\n var pad = [ 0, 1 ]\n while (hash.length + pad.length + 1 < len) pad.push(0xff)\n pad.push(0x00)\n var i = -1\n while (++i < hash.length) pad.push(hash[i])\n\n var out = crt(pad, priv)\n return out\n}\n\nfunction ecSign (hash, priv) {\n var curveId = curves[priv.curve.join('.')]\n if (!curveId) throw new Error('unknown curve ' + priv.curve.join('.'))\n\n var curve = new EC(curveId)\n var key = curve.keyFromPrivate(priv.privateKey)\n var out = key.sign(hash)\n\n return new Buffer(out.toDER())\n}\n\nfunction dsaSign (hash, priv, algo) {\n var x = priv.params.priv_key\n var p = priv.params.p\n var q = priv.params.q\n var g = priv.params.g\n var r = new BN(0)\n var k\n var H = bits2int(hash, q).mod(q)\n var s = false\n var kv = getKey(x, q, hash, algo)\n while (s === false) {\n k = makeKey(q, kv, algo)\n r = makeR(g, k, p, q)\n s = k.invm(q).imul(H.add(x.mul(r))).mod(q)\n if (s.cmpn(0) === 0) {\n s = false\n r = new BN(0)\n }\n }\n return toDER(r, s)\n}\n\nfunction toDER (r, s) {\n r = r.toArray()\n s = s.toArray()\n\n // Pad values\n if (r[0] & 0x80) r = [ 0 ].concat(r)\n if (s[0] & 0x80) s = [ 0 ].concat(s)\n\n var total = r.length + s.length + 4\n var res = [ 0x30, total, 0x02, r.length ]\n res = res.concat(r, [ 0x02, s.length ], s)\n return new Buffer(res)\n}\n\nfunction getKey (x, q, hash, algo) {\n x = new Buffer(x.toArray())\n if (x.length < q.byteLength()) {\n var zeros = new Buffer(q.byteLength() - x.length)\n zeros.fill(0)\n x = Buffer.concat([ zeros, x ])\n }\n var hlen = hash.length\n var hbits = bits2octets(hash, q)\n var v = new Buffer(hlen)\n v.fill(1)\n var k = new Buffer(hlen)\n k.fill(0)\n k = createHmac(algo, k).update(v).update(new Buffer([ 0 ])).update(x).update(hbits).digest()\n v = createHmac(algo, k).update(v).digest()\n k = createHmac(algo, k).update(v).update(new Buffer([ 1 ])).update(x).update(hbits).digest()\n v = createHmac(algo, k).update(v).digest()\n return { k: k, v: v }\n}\n\nfunction bits2int (obits, q) {\n var bits = new BN(obits)\n var shift = (obits.length << 3) - q.bitLength()\n if (shift > 0) bits.ishrn(shift)\n return bits\n}\n\nfunction bits2octets (bits, q) {\n bits = bits2int(bits, q)\n bits = bits.mod(q)\n var out = new Buffer(bits.toArray())\n if (out.length < q.byteLength()) {\n var zeros = new Buffer(q.byteLength() - out.length)\n zeros.fill(0)\n out = Buffer.concat([ zeros, out ])\n }\n return out\n}\n\nfunction makeKey (q, kv, algo) {\n var t\n var k\n\n do {\n t = new Buffer(0)\n\n while (t.length * 8 < q.bitLength()) {\n kv.v = createHmac(algo, kv.k).update(kv.v).digest()\n t = Buffer.concat([ t, kv.v ])\n }\n\n k = bits2int(t, q)\n kv.k = createHmac(algo, kv.k).update(kv.v).update(new Buffer([ 0 ])).digest()\n kv.v = createHmac(algo, kv.k).update(kv.v).digest()\n } while (k.cmp(q) !== -1)\n\n return k\n}\n\nfunction makeR (g, k, p, q) {\n return g.toRed(BN.mont(p)).redPow(k).fromRed().mod(q)\n}\n\nmodule.exports = sign\nmodule.exports.getKey = getKey\nmodule.exports.makeKey = makeKey\n","// much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js\nvar BN = require('bn.js')\nvar EC = require('elliptic').ec\nvar parseKeys = require('parse-asn1')\nvar curves = require('./curves.json')\n\nfunction verify (sig, hash, key, signType, tag) {\n var pub = parseKeys(key)\n if (pub.type === 'ec') {\n // rsa keys can be interpreted as ecdsa ones in openssl\n if (signType !== 'ecdsa' && signType !== 'ecdsa/rsa') throw new Error('wrong public key type')\n return ecVerify(sig, hash, pub)\n } else if (pub.type === 'dsa') {\n if (signType !== 'dsa') throw new Error('wrong public key type')\n return dsaVerify(sig, hash, pub)\n } else {\n if (signType !== 'rsa' && signType !== 'ecdsa/rsa') throw new Error('wrong public key type')\n }\n hash = Buffer.concat([tag, hash])\n var len = pub.modulus.byteLength()\n var pad = [ 1 ]\n var padNum = 0\n while (hash.length + pad.length + 2 < len) {\n pad.push(0xff)\n padNum++\n }\n pad.push(0x00)\n var i = -1\n while (++i < hash.length) {\n pad.push(hash[i])\n }\n pad = new Buffer(pad)\n var red = BN.mont(pub.modulus)\n sig = new BN(sig).toRed(red)\n\n sig = sig.redPow(new BN(pub.publicExponent))\n sig = new Buffer(sig.fromRed().toArray())\n var out = padNum < 8 ? 1 : 0\n len = Math.min(sig.length, pad.length)\n if (sig.length !== pad.length) out = 1\n\n i = -1\n while (++i < len) out |= sig[i] ^ pad[i]\n return out === 0\n}\n\nfunction ecVerify (sig, hash, pub) {\n var curveId = curves[pub.data.algorithm.curve.join('.')]\n if (!curveId) throw new Error('unknown curve ' + pub.data.algorithm.curve.join('.'))\n\n var curve = new EC(curveId)\n var pubkey = pub.data.subjectPrivateKey.data\n\n return curve.verify(hash, sig, pubkey)\n}\n\nfunction dsaVerify (sig, hash, pub) {\n var p = pub.data.p\n var q = pub.data.q\n var g = pub.data.g\n var y = pub.data.pub_key\n var unpacked = parseKeys.signature.decode(sig, 'der')\n var s = unpacked.s\n var r = unpacked.r\n checkValue(s, q)\n checkValue(r, q)\n var montp = BN.mont(p)\n var w = s.invm(q)\n var v = g.toRed(montp)\n .redPow(new BN(hash).mul(w).mod(q))\n .fromRed()\n .mul(y.toRed(montp).redPow(r.mul(w).mod(q)).fromRed())\n .mod(p)\n .mod(q)\n return v.cmp(r) === 0\n}\n\nfunction checkValue (b, q) {\n if (b.cmpn(0) <= 0) throw new Error('invalid sig')\n if (b.cmp(q) >= q) throw new Error('invalid sig')\n}\n\nmodule.exports = verify\n","module.exports = function xor (a, b) {\n var length = Math.min(a.length, b.length)\n var buffer = new Buffer(length)\n\n for (var i = 0; i < length; ++i) {\n buffer[i] = a[i] ^ b[i]\n }\n\n return buffer\n}\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar isArray = require('isarray')\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return ''\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n","var Buffer = require('safe-buffer').Buffer\nvar Transform = require('stream').Transform\nvar StringDecoder = require('string_decoder').StringDecoder\nvar inherits = require('inherits')\n\nfunction CipherBase (hashMode) {\n Transform.call(this)\n this.hashMode = typeof hashMode === 'string'\n if (this.hashMode) {\n this[hashMode] = this._finalOrDigest\n } else {\n this.final = this._finalOrDigest\n }\n if (this._final) {\n this.__final = this._final\n this._final = null\n }\n this._decoder = null\n this._encoding = null\n}\ninherits(CipherBase, Transform)\n\nCipherBase.prototype.update = function (data, inputEnc, outputEnc) {\n if (typeof data === 'string') {\n data = Buffer.from(data, inputEnc)\n }\n\n var outData = this._update(data)\n if (this.hashMode) return this\n\n if (outputEnc) {\n outData = this._toString(outData, outputEnc)\n }\n\n return outData\n}\n\nCipherBase.prototype.setAutoPadding = function () {}\nCipherBase.prototype.getAuthTag = function () {\n throw new Error('trying to get auth tag in unsupported state')\n}\n\nCipherBase.prototype.setAuthTag = function () {\n throw new Error('trying to set auth tag in unsupported state')\n}\n\nCipherBase.prototype.setAAD = function () {\n throw new Error('trying to set aad in unsupported state')\n}\n\nCipherBase.prototype._transform = function (data, _, next) {\n var err\n try {\n if (this.hashMode) {\n this._update(data)\n } else {\n this.push(this._update(data))\n }\n } catch (e) {\n err = e\n } finally {\n next(err)\n }\n}\nCipherBase.prototype._flush = function (done) {\n var err\n try {\n this.push(this.__final())\n } catch (e) {\n err = e\n }\n\n done(err)\n}\nCipherBase.prototype._finalOrDigest = function (outputEnc) {\n var outData = this.__final() || Buffer.alloc(0)\n if (outputEnc) {\n outData = this._toString(outData, outputEnc, true)\n }\n return outData\n}\n\nCipherBase.prototype._toString = function (value, enc, fin) {\n if (!this._decoder) {\n this._decoder = new StringDecoder(enc)\n this._encoding = enc\n }\n\n if (this._encoding !== enc) throw new Error('can\\'t switch encodings')\n\n var out = this._decoder.write(value)\n if (fin) {\n out += this._decoder.end()\n }\n\n return out\n}\n\nmodule.exports = CipherBase\n","/*!\n Copyright (c) 2016 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg)) {\n\t\t\t\tclasses.push(classNames.apply(null, arg));\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","\n/**\n * slice() reference.\n */\n\nvar slice = Array.prototype.slice;\n\n/**\n * Expose `co`.\n */\n\nmodule.exports = co['default'] = co.co = co;\n\n/**\n * Wrap the given generator `fn` into a\n * function that returns a promise.\n * This is a separate function so that\n * every `co()` call doesn't create a new,\n * unnecessary closure.\n *\n * @param {GeneratorFunction} fn\n * @return {Function}\n * @api public\n */\n\nco.wrap = function (fn) {\n createPromise.__generatorFunction__ = fn;\n return createPromise;\n function createPromise() {\n return co.call(this, fn.apply(this, arguments));\n }\n};\n\n/**\n * Execute the generator function or a generator\n * and return a promise.\n *\n * @param {Function} fn\n * @return {Promise}\n * @api public\n */\n\nfunction co(gen) {\n var ctx = this;\n var args = slice.call(arguments, 1)\n\n // we wrap everything in a promise to avoid promise chaining,\n // which leads to memory leak errors.\n // see https://github.com/tj/co/issues/180\n return new Promise(function(resolve, reject) {\n if (typeof gen === 'function') gen = gen.apply(ctx, args);\n if (!gen || typeof gen.next !== 'function') return resolve(gen);\n\n onFulfilled();\n\n /**\n * @param {Mixed} res\n * @return {Promise}\n * @api private\n */\n\n function onFulfilled(res) {\n var ret;\n try {\n ret = gen.next(res);\n } catch (e) {\n return reject(e);\n }\n next(ret);\n }\n\n /**\n * @param {Error} err\n * @return {Promise}\n * @api private\n */\n\n function onRejected(err) {\n var ret;\n try {\n ret = gen.throw(err);\n } catch (e) {\n return reject(e);\n }\n next(ret);\n }\n\n /**\n * Get the next value in the generator,\n * return a promise.\n *\n * @param {Object} ret\n * @return {Promise}\n * @api private\n */\n\n function next(ret) {\n if (ret.done) return resolve(ret.value);\n var value = toPromise.call(ctx, ret.value);\n if (value && isPromise(value)) return value.then(onFulfilled, onRejected);\n return onRejected(new TypeError('You may only yield a function, promise, generator, array, or object, '\n + 'but the following object was passed: \"' + String(ret.value) + '\"'));\n }\n });\n}\n\n/**\n * Convert a `yield`ed value into a promise.\n *\n * @param {Mixed} obj\n * @return {Promise}\n * @api private\n */\n\nfunction toPromise(obj) {\n if (!obj) return obj;\n if (isPromise(obj)) return obj;\n if (isGeneratorFunction(obj) || isGenerator(obj)) return co.call(this, obj);\n if ('function' == typeof obj) return thunkToPromise.call(this, obj);\n if (Array.isArray(obj)) return arrayToPromise.call(this, obj);\n if (isObject(obj)) return objectToPromise.call(this, obj);\n return obj;\n}\n\n/**\n * Convert a thunk to a promise.\n *\n * @param {Function}\n * @return {Promise}\n * @api private\n */\n\nfunction thunkToPromise(fn) {\n var ctx = this;\n return new Promise(function (resolve, reject) {\n fn.call(ctx, function (err, res) {\n if (err) return reject(err);\n if (arguments.length > 2) res = slice.call(arguments, 1);\n resolve(res);\n });\n });\n}\n\n/**\n * Convert an array of \"yieldables\" to a promise.\n * Uses `Promise.all()` internally.\n *\n * @param {Array} obj\n * @return {Promise}\n * @api private\n */\n\nfunction arrayToPromise(obj) {\n return Promise.all(obj.map(toPromise, this));\n}\n\n/**\n * Convert an object of \"yieldables\" to a promise.\n * Uses `Promise.all()` internally.\n *\n * @param {Object} obj\n * @return {Promise}\n * @api private\n */\n\nfunction objectToPromise(obj){\n var results = new obj.constructor();\n var keys = Object.keys(obj);\n var promises = [];\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var promise = toPromise.call(this, obj[key]);\n if (promise && isPromise(promise)) defer(promise, key);\n else results[key] = obj[key];\n }\n return Promise.all(promises).then(function () {\n return results;\n });\n\n function defer(promise, key) {\n // predefine the key in the result\n results[key] = undefined;\n promises.push(promise.then(function (res) {\n results[key] = res;\n }));\n }\n}\n\n/**\n * Check if `obj` is a promise.\n *\n * @param {Object} obj\n * @return {Boolean}\n * @api private\n */\n\nfunction isPromise(obj) {\n return 'function' == typeof obj.then;\n}\n\n/**\n * Check if `obj` is a generator.\n *\n * @param {Mixed} obj\n * @return {Boolean}\n * @api private\n */\n\nfunction isGenerator(obj) {\n return 'function' == typeof obj.next && 'function' == typeof obj.throw;\n}\n\n/**\n * Check if `obj` is a generator function.\n *\n * @param {Mixed} obj\n * @return {Boolean}\n * @api private\n */\nfunction isGeneratorFunction(obj) {\n var constructor = obj.constructor;\n if (!constructor) return false;\n if ('GeneratorFunction' === constructor.name || 'GeneratorFunction' === constructor.displayName) return true;\n return isGenerator(constructor.prototype);\n}\n\n/**\n * Check for plain object.\n *\n * @param {Mixed} val\n * @return {Boolean}\n * @api private\n */\n\nfunction isObject(val) {\n return Object == val.constructor;\n}\n","require('../../modules/es6.string.iterator');\nrequire('../../modules/es6.array.from');\nmodule.exports = require('../../modules/_core').Array.from;\n","require('../modules/es6.object.to-string');\nrequire('../modules/es6.string.iterator');\nrequire('../modules/web.dom.iterable');\nrequire('../modules/es6.map');\nrequire('../modules/es7.map.to-json');\nrequire('../modules/es7.map.of');\nrequire('../modules/es7.map.from');\nmodule.exports = require('../modules/_core').Map;\n","require('../../modules/es6.number.is-nan');\nmodule.exports = require('../../modules/_core').Number.isNaN;\n","require('../../modules/es6.number.min-safe-integer');\nmodule.exports = -0x1fffffffffffff;\n","require('../../modules/es6.object.assign');\nmodule.exports = require('../../modules/_core').Object.assign;\n","require('../../modules/es6.object.create');\nvar $Object = require('../../modules/_core').Object;\nmodule.exports = function create(P, D) {\n return $Object.create(P, D);\n};\n","require('../../modules/es6.object.define-property');\nvar $Object = require('../../modules/_core').Object;\nmodule.exports = function defineProperty(it, key, desc) {\n return $Object.defineProperty(it, key, desc);\n};\n","require('../../modules/es6.object.get-prototype-of');\nmodule.exports = require('../../modules/_core').Object.getPrototypeOf;\n","require('../../modules/es6.object.keys');\nmodule.exports = require('../../modules/_core').Object.keys;\n","require('../../modules/es6.object.set-prototype-of');\nmodule.exports = require('../../modules/_core').Object.setPrototypeOf;\n","require('../../modules/es6.symbol');\nrequire('../../modules/es6.object.to-string');\nrequire('../../modules/es7.symbol.async-iterator');\nrequire('../../modules/es7.symbol.observable');\nmodule.exports = require('../../modules/_core').Symbol;\n","require('../../modules/es6.string.iterator');\nrequire('../../modules/web.dom.iterable');\nmodule.exports = require('../../modules/_wks-ext').f('iterator');\n","module.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n","module.exports = function () { /* empty */ };\n","module.exports = function (it, Constructor, name, forbiddenField) {\n if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {\n throw TypeError(name + ': incorrect invocation!');\n } return it;\n};\n","var isObject = require('./_is-object');\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n","var forOf = require('./_for-of');\n\nmodule.exports = function (iter, ITERATOR) {\n var result = [];\n forOf(iter, false, result.push, result, ITERATOR);\n return result;\n};\n","// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = require('./_to-iobject');\nvar toLength = require('./_to-length');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nmodule.exports = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) if (IS_INCLUDES || index in O) {\n if (O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n","// 0 -> Array#forEach\n// 1 -> Array#map\n// 2 -> Array#filter\n// 3 -> Array#some\n// 4 -> Array#every\n// 5 -> Array#find\n// 6 -> Array#findIndex\nvar ctx = require('./_ctx');\nvar IObject = require('./_iobject');\nvar toObject = require('./_to-object');\nvar toLength = require('./_to-length');\nvar asc = require('./_array-species-create');\nmodule.exports = function (TYPE, $create) {\n var IS_MAP = TYPE == 1;\n var IS_FILTER = TYPE == 2;\n var IS_SOME = TYPE == 3;\n var IS_EVERY = TYPE == 4;\n var IS_FIND_INDEX = TYPE == 6;\n var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;\n var create = $create || asc;\n return function ($this, callbackfn, that) {\n var O = toObject($this);\n var self = IObject(O);\n var f = ctx(callbackfn, that, 3);\n var length = toLength(self.length);\n var index = 0;\n var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;\n var val, res;\n for (;length > index; index++) if (NO_HOLES || index in self) {\n val = self[index];\n res = f(val, index, O);\n if (TYPE) {\n if (IS_MAP) result[index] = res; // map\n else if (res) switch (TYPE) {\n case 3: return true; // some\n case 5: return val; // find\n case 6: return index; // findIndex\n case 2: result.push(val); // filter\n } else if (IS_EVERY) return false; // every\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;\n };\n};\n","var isObject = require('./_is-object');\nvar isArray = require('./_is-array');\nvar SPECIES = require('./_wks')('species');\n\nmodule.exports = function (original) {\n var C;\n if (isArray(original)) {\n C = original.constructor;\n // cross-realm fallback\n if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;\n if (isObject(C)) {\n C = C[SPECIES];\n if (C === null) C = undefined;\n }\n } return C === undefined ? Array : C;\n};\n","// 9.4.2.3 ArraySpeciesCreate(originalArray, length)\nvar speciesConstructor = require('./_array-species-constructor');\n\nmodule.exports = function (original, length) {\n return new (speciesConstructor(original))(length);\n};\n","// getting tag from 19.1.3.6 Object.prototype.toString()\nvar cof = require('./_cof');\nvar TAG = require('./_wks')('toStringTag');\n// ES3 wrong here\nvar ARG = cof(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (e) { /* empty */ }\n};\n\nmodule.exports = function (it) {\n var O, T, B;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T\n // builtinTag case\n : ARG ? cof(O)\n // ES3 arguments fallback\n : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;\n};\n","var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n","'use strict';\nvar dP = require('./_object-dp').f;\nvar create = require('./_object-create');\nvar redefineAll = require('./_redefine-all');\nvar ctx = require('./_ctx');\nvar anInstance = require('./_an-instance');\nvar forOf = require('./_for-of');\nvar $iterDefine = require('./_iter-define');\nvar step = require('./_iter-step');\nvar setSpecies = require('./_set-species');\nvar DESCRIPTORS = require('./_descriptors');\nvar fastKey = require('./_meta').fastKey;\nvar validate = require('./_validate-collection');\nvar SIZE = DESCRIPTORS ? '_s' : 'size';\n\nvar getEntry = function (that, key) {\n // fast case\n var index = fastKey(key);\n var entry;\n if (index !== 'F') return that._i[index];\n // frozen object case\n for (entry = that._f; entry; entry = entry.n) {\n if (entry.k == key) return entry;\n }\n};\n\nmodule.exports = {\n getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {\n var C = wrapper(function (that, iterable) {\n anInstance(that, C, NAME, '_i');\n that._t = NAME; // collection type\n that._i = create(null); // index\n that._f = undefined; // first entry\n that._l = undefined; // last entry\n that[SIZE] = 0; // size\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n });\n redefineAll(C.prototype, {\n // 23.1.3.1 Map.prototype.clear()\n // 23.2.3.2 Set.prototype.clear()\n clear: function clear() {\n for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {\n entry.r = true;\n if (entry.p) entry.p = entry.p.n = undefined;\n delete data[entry.i];\n }\n that._f = that._l = undefined;\n that[SIZE] = 0;\n },\n // 23.1.3.3 Map.prototype.delete(key)\n // 23.2.3.4 Set.prototype.delete(value)\n 'delete': function (key) {\n var that = validate(this, NAME);\n var entry = getEntry(that, key);\n if (entry) {\n var next = entry.n;\n var prev = entry.p;\n delete that._i[entry.i];\n entry.r = true;\n if (prev) prev.n = next;\n if (next) next.p = prev;\n if (that._f == entry) that._f = next;\n if (that._l == entry) that._l = prev;\n that[SIZE]--;\n } return !!entry;\n },\n // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)\n // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)\n forEach: function forEach(callbackfn /* , that = undefined */) {\n validate(this, NAME);\n var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);\n var entry;\n while (entry = entry ? entry.n : this._f) {\n f(entry.v, entry.k, this);\n // revert to the last existing entry\n while (entry && entry.r) entry = entry.p;\n }\n },\n // 23.1.3.7 Map.prototype.has(key)\n // 23.2.3.7 Set.prototype.has(value)\n has: function has(key) {\n return !!getEntry(validate(this, NAME), key);\n }\n });\n if (DESCRIPTORS) dP(C.prototype, 'size', {\n get: function () {\n return validate(this, NAME)[SIZE];\n }\n });\n return C;\n },\n def: function (that, key, value) {\n var entry = getEntry(that, key);\n var prev, index;\n // change existing entry\n if (entry) {\n entry.v = value;\n // create new entry\n } else {\n that._l = entry = {\n i: index = fastKey(key, true), // <- index\n k: key, // <- key\n v: value, // <- value\n p: prev = that._l, // <- previous entry\n n: undefined, // <- next entry\n r: false // <- removed\n };\n if (!that._f) that._f = entry;\n if (prev) prev.n = entry;\n that[SIZE]++;\n // add to index\n if (index !== 'F') that._i[index] = entry;\n } return that;\n },\n getEntry: getEntry,\n setStrong: function (C, NAME, IS_MAP) {\n // add .keys, .values, .entries, [@@iterator]\n // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11\n $iterDefine(C, NAME, function (iterated, kind) {\n this._t = validate(iterated, NAME); // target\n this._k = kind; // kind\n this._l = undefined; // previous\n }, function () {\n var that = this;\n var kind = that._k;\n var entry = that._l;\n // revert to the last existing entry\n while (entry && entry.r) entry = entry.p;\n // get next entry\n if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {\n // or finish the iteration\n that._t = undefined;\n return step(1);\n }\n // return step by kind\n if (kind == 'keys') return step(0, entry.k);\n if (kind == 'values') return step(0, entry.v);\n return step(0, [entry.k, entry.v]);\n }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);\n\n // add [@@species], 23.1.2.2, 23.2.2.2\n setSpecies(NAME);\n }\n};\n","// https://github.com/DavidBruant/Map-Set.prototype.toJSON\nvar classof = require('./_classof');\nvar from = require('./_array-from-iterable');\nmodule.exports = function (NAME) {\n return function toJSON() {\n if (classof(this) != NAME) throw TypeError(NAME + \"#toJSON isn't generic\");\n return from(this);\n };\n};\n","'use strict';\nvar global = require('./_global');\nvar $export = require('./_export');\nvar meta = require('./_meta');\nvar fails = require('./_fails');\nvar hide = require('./_hide');\nvar redefineAll = require('./_redefine-all');\nvar forOf = require('./_for-of');\nvar anInstance = require('./_an-instance');\nvar isObject = require('./_is-object');\nvar setToStringTag = require('./_set-to-string-tag');\nvar dP = require('./_object-dp').f;\nvar each = require('./_array-methods')(0);\nvar DESCRIPTORS = require('./_descriptors');\n\nmodule.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {\n var Base = global[NAME];\n var C = Base;\n var ADDER = IS_MAP ? 'set' : 'add';\n var proto = C && C.prototype;\n var O = {};\n if (!DESCRIPTORS || typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () {\n new C().entries().next();\n }))) {\n // create collection constructor\n C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);\n redefineAll(C.prototype, methods);\n meta.NEED = true;\n } else {\n C = wrapper(function (target, iterable) {\n anInstance(target, C, NAME, '_c');\n target._c = new Base();\n if (iterable != undefined) forOf(iterable, IS_MAP, target[ADDER], target);\n });\n each('add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON'.split(','), function (KEY) {\n var IS_ADDER = KEY == 'add' || KEY == 'set';\n if (KEY in proto && !(IS_WEAK && KEY == 'clear')) hide(C.prototype, KEY, function (a, b) {\n anInstance(this, C, KEY);\n if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY == 'get' ? undefined : false;\n var result = this._c[KEY](a === 0 ? 0 : a, b);\n return IS_ADDER ? this : result;\n });\n });\n IS_WEAK || dP(C.prototype, 'size', {\n get: function () {\n return this._c.size;\n }\n });\n }\n\n setToStringTag(C, NAME);\n\n O[NAME] = C;\n $export($export.G + $export.W + $export.F, O);\n\n if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);\n\n return C;\n};\n","var core = module.exports = { version: '2.5.3' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n","'use strict';\nvar $defineProperty = require('./_object-dp');\nvar createDesc = require('./_property-desc');\n\nmodule.exports = function (object, index, value) {\n if (index in object) $defineProperty.f(object, index, createDesc(0, value));\n else object[index] = value;\n};\n","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n","// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n","var isObject = require('./_is-object');\nvar document = require('./_global').document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n","// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');\n","// all enumerable object keys, includes symbols\nvar getKeys = require('./_object-keys');\nvar gOPS = require('./_object-gops');\nvar pIE = require('./_object-pie');\nmodule.exports = function (it) {\n var result = getKeys(it);\n var getSymbols = gOPS.f;\n if (getSymbols) {\n var symbols = getSymbols(it);\n var isEnum = pIE.f;\n var i = 0;\n var key;\n while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);\n } return result;\n};\n","var global = require('./_global');\nvar core = require('./_core');\nvar ctx = require('./_ctx');\nvar hide = require('./_hide');\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var IS_WRAP = type & $export.W;\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE];\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];\n var key, own, out;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n if (own && key in exports) continue;\n // export native or passed\n out = own ? target[key] : source[key];\n // prevent global pollution for namespaces\n exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]\n // bind timers to global for call from export context\n : IS_BIND && own ? ctx(out, global)\n // wrap global constructors for prevent change them in library\n : IS_WRAP && target[key] == out ? (function (C) {\n var F = function (a, b, c) {\n if (this instanceof C) {\n switch (arguments.length) {\n case 0: return new C();\n case 1: return new C(a);\n case 2: return new C(a, b);\n } return new C(a, b, c);\n } return C.apply(this, arguments);\n };\n F[PROTOTYPE] = C[PROTOTYPE];\n return F;\n // make static versions for prototype methods\n })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%\n if (IS_PROTO) {\n (exports.virtual || (exports.virtual = {}))[key] = out;\n // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%\n if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);\n }\n }\n};\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n","var ctx = require('./_ctx');\nvar call = require('./_iter-call');\nvar isArrayIter = require('./_is-array-iter');\nvar anObject = require('./_an-object');\nvar toLength = require('./_to-length');\nvar getIterFn = require('./core.get-iterator-method');\nvar BREAK = {};\nvar RETURN = {};\nvar exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {\n var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);\n var f = ctx(fn, that, entries ? 2 : 1);\n var index = 0;\n var length, step, iterator, result;\n if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');\n // fast case for arrays with default iterator\n if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {\n result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);\n if (result === BREAK || result === RETURN) return result;\n } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {\n result = call(iterator, f, step.value, entries);\n if (result === BREAK || result === RETURN) return result;\n }\n};\nexports.BREAK = BREAK;\nexports.RETURN = RETURN;\n","// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n","var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n","var dP = require('./_object-dp');\nvar createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","var document = require('./_global').document;\nmodule.exports = document && document.documentElement;\n","module.exports = !require('./_descriptors') && !require('./_fails')(function () {\n return Object.defineProperty(require('./_dom-create')('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n","// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = require('./_cof');\n// eslint-disable-next-line no-prototype-builtins\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n return cof(it) == 'String' ? it.split('') : Object(it);\n};\n","// check on default Array iterator\nvar Iterators = require('./_iterators');\nvar ITERATOR = require('./_wks')('iterator');\nvar ArrayProto = Array.prototype;\n\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);\n};\n","// 7.2.2 IsArray(argument)\nvar cof = require('./_cof');\nmodule.exports = Array.isArray || function isArray(arg) {\n return cof(arg) == 'Array';\n};\n","module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n","// call something on iterator step with safe closing on error\nvar anObject = require('./_an-object');\nmodule.exports = function (iterator, fn, value, entries) {\n try {\n return entries ? fn(anObject(value)[0], value[1]) : fn(value);\n // 7.4.6 IteratorClose(iterator, completion)\n } catch (e) {\n var ret = iterator['return'];\n if (ret !== undefined) anObject(ret.call(iterator));\n throw e;\n }\n};\n","'use strict';\nvar create = require('./_object-create');\nvar descriptor = require('./_property-desc');\nvar setToStringTag = require('./_set-to-string-tag');\nvar IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\nrequire('./_hide')(IteratorPrototype, require('./_wks')('iterator'), function () { return this; });\n\nmodule.exports = function (Constructor, NAME, next) {\n Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });\n setToStringTag(Constructor, NAME + ' Iterator');\n};\n","'use strict';\nvar LIBRARY = require('./_library');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar hide = require('./_hide');\nvar has = require('./_has');\nvar Iterators = require('./_iterators');\nvar $iterCreate = require('./_iter-create');\nvar setToStringTag = require('./_set-to-string-tag');\nvar getPrototypeOf = require('./_object-gpo');\nvar ITERATOR = require('./_wks')('iterator');\nvar BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`\nvar FF_ITERATOR = '@@iterator';\nvar KEYS = 'keys';\nvar VALUES = 'values';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {\n $iterCreate(Constructor, NAME, next);\n var getMethod = function (kind) {\n if (!BUGGY && kind in proto) return proto[kind];\n switch (kind) {\n case KEYS: return function keys() { return new Constructor(this, kind); };\n case VALUES: return function values() { return new Constructor(this, kind); };\n } return function entries() { return new Constructor(this, kind); };\n };\n var TAG = NAME + ' Iterator';\n var DEF_VALUES = DEFAULT == VALUES;\n var VALUES_BUG = false;\n var proto = Base.prototype;\n var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];\n var $default = (!BUGGY && $native) || getMethod(DEFAULT);\n var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;\n var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;\n var methods, key, IteratorPrototype;\n // Fix native\n if ($anyNative) {\n IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));\n if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {\n // Set @@toStringTag to native iterators\n setToStringTag(IteratorPrototype, TAG, true);\n // fix for some old engines\n if (!LIBRARY && !has(IteratorPrototype, ITERATOR)) hide(IteratorPrototype, ITERATOR, returnThis);\n }\n }\n // fix Array#{values, @@iterator}.name in V8 / FF\n if (DEF_VALUES && $native && $native.name !== VALUES) {\n VALUES_BUG = true;\n $default = function values() { return $native.call(this); };\n }\n // Define iterator\n if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {\n hide(proto, ITERATOR, $default);\n }\n // Plug for library\n Iterators[NAME] = $default;\n Iterators[TAG] = returnThis;\n if (DEFAULT) {\n methods = {\n values: DEF_VALUES ? $default : getMethod(VALUES),\n keys: IS_SET ? $default : getMethod(KEYS),\n entries: $entries\n };\n if (FORCED) for (key in methods) {\n if (!(key in proto)) redefine(proto, key, methods[key]);\n } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);\n }\n return methods;\n};\n","var ITERATOR = require('./_wks')('iterator');\nvar SAFE_CLOSING = false;\n\ntry {\n var riter = [7][ITERATOR]();\n riter['return'] = function () { SAFE_CLOSING = true; };\n // eslint-disable-next-line no-throw-literal\n Array.from(riter, function () { throw 2; });\n} catch (e) { /* empty */ }\n\nmodule.exports = function (exec, skipClosing) {\n if (!skipClosing && !SAFE_CLOSING) return false;\n var safe = false;\n try {\n var arr = [7];\n var iter = arr[ITERATOR]();\n iter.next = function () { return { done: safe = true }; };\n arr[ITERATOR] = function () { return iter; };\n exec(arr);\n } catch (e) { /* empty */ }\n return safe;\n};\n","module.exports = function (done, value) {\n return { value: value, done: !!done };\n};\n","module.exports = {};\n","module.exports = true;\n","var META = require('./_uid')('meta');\nvar isObject = require('./_is-object');\nvar has = require('./_has');\nvar setDesc = require('./_object-dp').f;\nvar id = 0;\nvar isExtensible = Object.isExtensible || function () {\n return true;\n};\nvar FREEZE = !require('./_fails')(function () {\n return isExtensible(Object.preventExtensions({}));\n});\nvar setMeta = function (it) {\n setDesc(it, META, { value: {\n i: 'O' + ++id, // object ID\n w: {} // weak collections IDs\n } });\n};\nvar fastKey = function (it, create) {\n // return primitive with prefix\n if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return 'F';\n // not necessary to add metadata\n if (!create) return 'E';\n // add missing metadata\n setMeta(it);\n // return object ID\n } return it[META].i;\n};\nvar getWeak = function (it, create) {\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return true;\n // not necessary to add metadata\n if (!create) return false;\n // add missing metadata\n setMeta(it);\n // return hash weak collections IDs\n } return it[META].w;\n};\n// add metadata on freeze-family methods calling\nvar onFreeze = function (it) {\n if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);\n return it;\n};\nvar meta = module.exports = {\n KEY: META,\n NEED: false,\n fastKey: fastKey,\n getWeak: getWeak,\n onFreeze: onFreeze\n};\n","'use strict';\n// 19.1.2.1 Object.assign(target, source, ...)\nvar getKeys = require('./_object-keys');\nvar gOPS = require('./_object-gops');\nvar pIE = require('./_object-pie');\nvar toObject = require('./_to-object');\nvar IObject = require('./_iobject');\nvar $assign = Object.assign;\n\n// should work with symbols and should have deterministic property order (V8 bug)\nmodule.exports = !$assign || require('./_fails')(function () {\n var A = {};\n var B = {};\n // eslint-disable-next-line no-undef\n var S = Symbol();\n var K = 'abcdefghijklmnopqrst';\n A[S] = 7;\n K.split('').forEach(function (k) { B[k] = k; });\n return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;\n}) ? function assign(target, source) { // eslint-disable-line no-unused-vars\n var T = toObject(target);\n var aLen = arguments.length;\n var index = 1;\n var getSymbols = gOPS.f;\n var isEnum = pIE.f;\n while (aLen > index) {\n var S = IObject(arguments[index++]);\n var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);\n var length = keys.length;\n var j = 0;\n var key;\n while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];\n } return T;\n} : $assign;\n","// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\nvar anObject = require('./_an-object');\nvar dPs = require('./_object-dps');\nvar enumBugKeys = require('./_enum-bug-keys');\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\nvar Empty = function () { /* empty */ };\nvar PROTOTYPE = 'prototype';\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar createDict = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = require('./_dom-create')('iframe');\n var i = enumBugKeys.length;\n var lt = '<';\n var gt = '>';\n var iframeDocument;\n iframe.style.display = 'none';\n require('./_html').appendChild(iframe);\n iframe.src = 'javascript:'; // eslint-disable-line no-script-url\n // createDict = iframe.contentWindow.Object;\n // html.removeChild(iframe);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);\n iframeDocument.close();\n createDict = iframeDocument.F;\n while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];\n return createDict();\n};\n\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n Empty[PROTOTYPE] = anObject(O);\n result = new Empty();\n Empty[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = createDict();\n return Properties === undefined ? result : dPs(result, Properties);\n};\n","var anObject = require('./_an-object');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar toPrimitive = require('./_to-primitive');\nvar dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","var dP = require('./_object-dp');\nvar anObject = require('./_an-object');\nvar getKeys = require('./_object-keys');\n\nmodule.exports = require('./_descriptors') ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var keys = getKeys(Properties);\n var length = keys.length;\n var i = 0;\n var P;\n while (length > i) dP.f(O, P = keys[i++], Properties[P]);\n return O;\n};\n","var pIE = require('./_object-pie');\nvar createDesc = require('./_property-desc');\nvar toIObject = require('./_to-iobject');\nvar toPrimitive = require('./_to-primitive');\nvar has = require('./_has');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nexports.f = require('./_descriptors') ? gOPD : function getOwnPropertyDescriptor(O, P) {\n O = toIObject(O);\n P = toPrimitive(P, true);\n if (IE8_DOM_DEFINE) try {\n return gOPD(O, P);\n } catch (e) { /* empty */ }\n if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);\n};\n","// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\nvar toIObject = require('./_to-iobject');\nvar gOPN = require('./_object-gopn').f;\nvar toString = {}.toString;\n\nvar windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames\n ? Object.getOwnPropertyNames(window) : [];\n\nvar getWindowNames = function (it) {\n try {\n return gOPN(it);\n } catch (e) {\n return windowNames.slice();\n }\n};\n\nmodule.exports.f = function getOwnPropertyNames(it) {\n return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));\n};\n","// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)\nvar $keys = require('./_object-keys-internal');\nvar hiddenKeys = require('./_enum-bug-keys').concat('length', 'prototype');\n\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return $keys(O, hiddenKeys);\n};\n","exports.f = Object.getOwnPropertySymbols;\n","// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)\nvar has = require('./_has');\nvar toObject = require('./_to-object');\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\nvar ObjectProto = Object.prototype;\n\nmodule.exports = Object.getPrototypeOf || function (O) {\n O = toObject(O);\n if (has(O, IE_PROTO)) return O[IE_PROTO];\n if (typeof O.constructor == 'function' && O instanceof O.constructor) {\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectProto : null;\n};\n","var has = require('./_has');\nvar toIObject = require('./_to-iobject');\nvar arrayIndexOf = require('./_array-includes')(false);\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\n\nmodule.exports = function (object, names) {\n var O = toIObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};\n","// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = require('./_object-keys-internal');\nvar enumBugKeys = require('./_enum-bug-keys');\n\nmodule.exports = Object.keys || function keys(O) {\n return $keys(O, enumBugKeys);\n};\n","exports.f = {}.propertyIsEnumerable;\n","// most Object methods by ES6 should accept primitives\nvar $export = require('./_export');\nvar core = require('./_core');\nvar fails = require('./_fails');\nmodule.exports = function (KEY, exec) {\n var fn = (core.Object || {})[KEY] || Object[KEY];\n var exp = {};\n exp[KEY] = exec(fn);\n $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);\n};\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","var hide = require('./_hide');\nmodule.exports = function (target, src, safe) {\n for (var key in src) {\n if (safe && target[key]) target[key] = src[key];\n else hide(target, key, src[key]);\n } return target;\n};\n","module.exports = require('./_hide');\n","'use strict';\n// https://tc39.github.io/proposal-setmap-offrom/\nvar $export = require('./_export');\nvar aFunction = require('./_a-function');\nvar ctx = require('./_ctx');\nvar forOf = require('./_for-of');\n\nmodule.exports = function (COLLECTION) {\n $export($export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) {\n var mapFn = arguments[1];\n var mapping, A, n, cb;\n aFunction(this);\n mapping = mapFn !== undefined;\n if (mapping) aFunction(mapFn);\n if (source == undefined) return new this();\n A = [];\n if (mapping) {\n n = 0;\n cb = ctx(mapFn, arguments[2], 2);\n forOf(source, false, function (nextItem) {\n A.push(cb(nextItem, n++));\n });\n } else {\n forOf(source, false, A.push, A);\n }\n return new this(A);\n } });\n};\n","'use strict';\n// https://tc39.github.io/proposal-setmap-offrom/\nvar $export = require('./_export');\n\nmodule.exports = function (COLLECTION) {\n $export($export.S, COLLECTION, { of: function of() {\n var length = arguments.length;\n var A = new Array(length);\n while (length--) A[length] = arguments[length];\n return new this(A);\n } });\n};\n","// Works with __proto__ only. Old v8 can't work with null proto objects.\n/* eslint-disable no-proto */\nvar isObject = require('./_is-object');\nvar anObject = require('./_an-object');\nvar check = function (O, proto) {\n anObject(O);\n if (!isObject(proto) && proto !== null) throw TypeError(proto + \": can't set as prototype!\");\n};\nmodule.exports = {\n set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line\n function (test, buggy, set) {\n try {\n set = require('./_ctx')(Function.call, require('./_object-gopd').f(Object.prototype, '__proto__').set, 2);\n set(test, []);\n buggy = !(test instanceof Array);\n } catch (e) { buggy = true; }\n return function setPrototypeOf(O, proto) {\n check(O, proto);\n if (buggy) O.__proto__ = proto;\n else set(O, proto);\n return O;\n };\n }({}, false) : undefined),\n check: check\n};\n","'use strict';\nvar global = require('./_global');\nvar core = require('./_core');\nvar dP = require('./_object-dp');\nvar DESCRIPTORS = require('./_descriptors');\nvar SPECIES = require('./_wks')('species');\n\nmodule.exports = function (KEY) {\n var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY];\n if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {\n configurable: true,\n get: function () { return this; }\n });\n};\n","var def = require('./_object-dp').f;\nvar has = require('./_has');\nvar TAG = require('./_wks')('toStringTag');\n\nmodule.exports = function (it, tag, stat) {\n if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });\n};\n","var shared = require('./_shared')('keys');\nvar uid = require('./_uid');\nmodule.exports = function (key) {\n return shared[key] || (shared[key] = uid(key));\n};\n","var global = require('./_global');\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || (global[SHARED] = {});\nmodule.exports = function (key) {\n return store[key] || (store[key] = {});\n};\n","var toInteger = require('./_to-integer');\nvar defined = require('./_defined');\n// true -> String#at\n// false -> String#codePointAt\nmodule.exports = function (TO_STRING) {\n return function (that, pos) {\n var s = String(defined(that));\n var i = toInteger(pos);\n var l = s.length;\n var a, b;\n if (i < 0 || i >= l) return TO_STRING ? '' : undefined;\n a = s.charCodeAt(i);\n return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff\n ? TO_STRING ? s.charAt(i) : a\n : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;\n };\n};\n","var toInteger = require('./_to-integer');\nvar max = Math.max;\nvar min = Math.min;\nmodule.exports = function (index, length) {\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};\n","// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\nmodule.exports = function (it) {\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n","// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = require('./_iobject');\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return IObject(defined(it));\n};\n","// 7.1.15 ToLength\nvar toInteger = require('./_to-integer');\nvar min = Math.min;\nmodule.exports = function (it) {\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n","// 7.1.13 ToObject(argument)\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return Object(defined(it));\n};\n","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n","var id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n","var isObject = require('./_is-object');\nmodule.exports = function (it, TYPE) {\n if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');\n return it;\n};\n","var global = require('./_global');\nvar core = require('./_core');\nvar LIBRARY = require('./_library');\nvar wksExt = require('./_wks-ext');\nvar defineProperty = require('./_object-dp').f;\nmodule.exports = function (name) {\n var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});\n if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });\n};\n","exports.f = require('./_wks');\n","var store = require('./_shared')('wks');\nvar uid = require('./_uid');\nvar Symbol = require('./_global').Symbol;\nvar USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function (name) {\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;\n","var classof = require('./_classof');\nvar ITERATOR = require('./_wks')('iterator');\nvar Iterators = require('./_iterators');\nmodule.exports = require('./_core').getIteratorMethod = function (it) {\n if (it != undefined) return it[ITERATOR]\n || it['@@iterator']\n || Iterators[classof(it)];\n};\n","'use strict';\nvar ctx = require('./_ctx');\nvar $export = require('./_export');\nvar toObject = require('./_to-object');\nvar call = require('./_iter-call');\nvar isArrayIter = require('./_is-array-iter');\nvar toLength = require('./_to-length');\nvar createProperty = require('./_create-property');\nvar getIterFn = require('./core.get-iterator-method');\n\n$export($export.S + $export.F * !require('./_iter-detect')(function (iter) { Array.from(iter); }), 'Array', {\n // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)\n from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {\n var O = toObject(arrayLike);\n var C = typeof this == 'function' ? this : Array;\n var aLen = arguments.length;\n var mapfn = aLen > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var index = 0;\n var iterFn = getIterFn(O);\n var length, result, step, iterator;\n if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);\n // if object isn't iterable or it's array with default iterator - use simple case\n if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {\n for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {\n createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);\n }\n } else {\n length = toLength(O.length);\n for (result = new C(length); length > index; index++) {\n createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);\n }\n }\n result.length = index;\n return result;\n }\n});\n","'use strict';\nvar addToUnscopables = require('./_add-to-unscopables');\nvar step = require('./_iter-step');\nvar Iterators = require('./_iterators');\nvar toIObject = require('./_to-iobject');\n\n// 22.1.3.4 Array.prototype.entries()\n// 22.1.3.13 Array.prototype.keys()\n// 22.1.3.29 Array.prototype.values()\n// 22.1.3.30 Array.prototype[@@iterator]()\nmodule.exports = require('./_iter-define')(Array, 'Array', function (iterated, kind) {\n this._t = toIObject(iterated); // target\n this._i = 0; // next index\n this._k = kind; // kind\n// 22.1.5.2.1 %ArrayIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var kind = this._k;\n var index = this._i++;\n if (!O || index >= O.length) {\n this._t = undefined;\n return step(1);\n }\n if (kind == 'keys') return step(0, index);\n if (kind == 'values') return step(0, O[index]);\n return step(0, [index, O[index]]);\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)\nIterators.Arguments = Iterators.Array;\n\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n","'use strict';\nvar strong = require('./_collection-strong');\nvar validate = require('./_validate-collection');\nvar MAP = 'Map';\n\n// 23.1 Map Objects\nmodule.exports = require('./_collection')(MAP, function (get) {\n return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.1.3.6 Map.prototype.get(key)\n get: function get(key) {\n var entry = strong.getEntry(validate(this, MAP), key);\n return entry && entry.v;\n },\n // 23.1.3.9 Map.prototype.set(key, value)\n set: function set(key, value) {\n return strong.def(validate(this, MAP), key === 0 ? 0 : key, value);\n }\n}, strong, true);\n","// 20.1.2.4 Number.isNaN(number)\nvar $export = require('./_export');\n\n$export($export.S, 'Number', {\n isNaN: function isNaN(number) {\n // eslint-disable-next-line no-self-compare\n return number != number;\n }\n});\n","// 20.1.2.10 Number.MIN_SAFE_INTEGER\nvar $export = require('./_export');\n\n$export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff });\n","// 19.1.3.1 Object.assign(target, source)\nvar $export = require('./_export');\n\n$export($export.S + $export.F, 'Object', { assign: require('./_object-assign') });\n","var $export = require('./_export');\n// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\n$export($export.S, 'Object', { create: require('./_object-create') });\n","var $export = require('./_export');\n// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)\n$export($export.S + $export.F * !require('./_descriptors'), 'Object', { defineProperty: require('./_object-dp').f });\n","// 19.1.2.9 Object.getPrototypeOf(O)\nvar toObject = require('./_to-object');\nvar $getPrototypeOf = require('./_object-gpo');\n\nrequire('./_object-sap')('getPrototypeOf', function () {\n return function getPrototypeOf(it) {\n return $getPrototypeOf(toObject(it));\n };\n});\n","// 19.1.2.14 Object.keys(O)\nvar toObject = require('./_to-object');\nvar $keys = require('./_object-keys');\n\nrequire('./_object-sap')('keys', function () {\n return function keys(it) {\n return $keys(toObject(it));\n };\n});\n","// 19.1.3.19 Object.setPrototypeOf(O, proto)\nvar $export = require('./_export');\n$export($export.S, 'Object', { setPrototypeOf: require('./_set-proto').set });\n","'use strict';\nvar $at = require('./_string-at')(true);\n\n// 21.1.3.27 String.prototype[@@iterator]()\nrequire('./_iter-define')(String, 'String', function (iterated) {\n this._t = String(iterated); // target\n this._i = 0; // next index\n// 21.1.5.2.1 %StringIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var index = this._i;\n var point;\n if (index >= O.length) return { value: undefined, done: true };\n point = $at(O, index);\n this._i += point.length;\n return { value: point, done: false };\n});\n","'use strict';\n// ECMAScript 6 symbols shim\nvar global = require('./_global');\nvar has = require('./_has');\nvar DESCRIPTORS = require('./_descriptors');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar META = require('./_meta').KEY;\nvar $fails = require('./_fails');\nvar shared = require('./_shared');\nvar setToStringTag = require('./_set-to-string-tag');\nvar uid = require('./_uid');\nvar wks = require('./_wks');\nvar wksExt = require('./_wks-ext');\nvar wksDefine = require('./_wks-define');\nvar enumKeys = require('./_enum-keys');\nvar isArray = require('./_is-array');\nvar anObject = require('./_an-object');\nvar isObject = require('./_is-object');\nvar toIObject = require('./_to-iobject');\nvar toPrimitive = require('./_to-primitive');\nvar createDesc = require('./_property-desc');\nvar _create = require('./_object-create');\nvar gOPNExt = require('./_object-gopn-ext');\nvar $GOPD = require('./_object-gopd');\nvar $DP = require('./_object-dp');\nvar $keys = require('./_object-keys');\nvar gOPD = $GOPD.f;\nvar dP = $DP.f;\nvar gOPN = gOPNExt.f;\nvar $Symbol = global.Symbol;\nvar $JSON = global.JSON;\nvar _stringify = $JSON && $JSON.stringify;\nvar PROTOTYPE = 'prototype';\nvar HIDDEN = wks('_hidden');\nvar TO_PRIMITIVE = wks('toPrimitive');\nvar isEnum = {}.propertyIsEnumerable;\nvar SymbolRegistry = shared('symbol-registry');\nvar AllSymbols = shared('symbols');\nvar OPSymbols = shared('op-symbols');\nvar ObjectProto = Object[PROTOTYPE];\nvar USE_NATIVE = typeof $Symbol == 'function';\nvar QObject = global.QObject;\n// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\nvar setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\nvar setSymbolDesc = DESCRIPTORS && $fails(function () {\n return _create(dP({}, 'a', {\n get: function () { return dP(this, 'a', { value: 7 }).a; }\n })).a != 7;\n}) ? function (it, key, D) {\n var protoDesc = gOPD(ObjectProto, key);\n if (protoDesc) delete ObjectProto[key];\n dP(it, key, D);\n if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);\n} : dP;\n\nvar wrap = function (tag) {\n var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);\n sym._k = tag;\n return sym;\n};\n\nvar isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n return it instanceof $Symbol;\n};\n\nvar $defineProperty = function defineProperty(it, key, D) {\n if (it === ObjectProto) $defineProperty(OPSymbols, key, D);\n anObject(it);\n key = toPrimitive(key, true);\n anObject(D);\n if (has(AllSymbols, key)) {\n if (!D.enumerable) {\n if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));\n it[HIDDEN][key] = true;\n } else {\n if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;\n D = _create(D, { enumerable: createDesc(0, false) });\n } return setSymbolDesc(it, key, D);\n } return dP(it, key, D);\n};\nvar $defineProperties = function defineProperties(it, P) {\n anObject(it);\n var keys = enumKeys(P = toIObject(P));\n var i = 0;\n var l = keys.length;\n var key;\n while (l > i) $defineProperty(it, key = keys[i++], P[key]);\n return it;\n};\nvar $create = function create(it, P) {\n return P === undefined ? _create(it) : $defineProperties(_create(it), P);\n};\nvar $propertyIsEnumerable = function propertyIsEnumerable(key) {\n var E = isEnum.call(this, key = toPrimitive(key, true));\n if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;\n return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;\n};\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {\n it = toIObject(it);\n key = toPrimitive(key, true);\n if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;\n var D = gOPD(it, key);\n if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;\n return D;\n};\nvar $getOwnPropertyNames = function getOwnPropertyNames(it) {\n var names = gOPN(toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);\n } return result;\n};\nvar $getOwnPropertySymbols = function getOwnPropertySymbols(it) {\n var IS_OP = it === ObjectProto;\n var names = gOPN(IS_OP ? OPSymbols : toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);\n } return result;\n};\n\n// 19.4.1.1 Symbol([description])\nif (!USE_NATIVE) {\n $Symbol = function Symbol() {\n if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');\n var tag = uid(arguments.length > 0 ? arguments[0] : undefined);\n var $set = function (value) {\n if (this === ObjectProto) $set.call(OPSymbols, value);\n if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;\n setSymbolDesc(this, tag, createDesc(1, value));\n };\n if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });\n return wrap(tag);\n };\n redefine($Symbol[PROTOTYPE], 'toString', function toString() {\n return this._k;\n });\n\n $GOPD.f = $getOwnPropertyDescriptor;\n $DP.f = $defineProperty;\n require('./_object-gopn').f = gOPNExt.f = $getOwnPropertyNames;\n require('./_object-pie').f = $propertyIsEnumerable;\n require('./_object-gops').f = $getOwnPropertySymbols;\n\n if (DESCRIPTORS && !require('./_library')) {\n redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);\n }\n\n wksExt.f = function (name) {\n return wrap(wks(name));\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });\n\nfor (var es6Symbols = (\n // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14\n 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'\n).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);\n\nfor (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);\n\n$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {\n // 19.4.2.1 Symbol.for(key)\n 'for': function (key) {\n return has(SymbolRegistry, key += '')\n ? SymbolRegistry[key]\n : SymbolRegistry[key] = $Symbol(key);\n },\n // 19.4.2.5 Symbol.keyFor(sym)\n keyFor: function keyFor(sym) {\n if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');\n for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;\n },\n useSetter: function () { setter = true; },\n useSimple: function () { setter = false; }\n});\n\n$export($export.S + $export.F * !USE_NATIVE, 'Object', {\n // 19.1.2.2 Object.create(O [, Properties])\n create: $create,\n // 19.1.2.4 Object.defineProperty(O, P, Attributes)\n defineProperty: $defineProperty,\n // 19.1.2.3 Object.defineProperties(O, Properties)\n defineProperties: $defineProperties,\n // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\n getOwnPropertyDescriptor: $getOwnPropertyDescriptor,\n // 19.1.2.7 Object.getOwnPropertyNames(O)\n getOwnPropertyNames: $getOwnPropertyNames,\n // 19.1.2.8 Object.getOwnPropertySymbols(O)\n getOwnPropertySymbols: $getOwnPropertySymbols\n});\n\n// 24.3.2 JSON.stringify(value [, replacer [, space]])\n$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {\n var S = $Symbol();\n // MS Edge converts symbol values to JSON as {}\n // WebKit converts symbol values to JSON as null\n // V8 throws on boxed symbols\n return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';\n})), 'JSON', {\n stringify: function stringify(it) {\n var args = [it];\n var i = 1;\n var replacer, $replacer;\n while (arguments.length > i) args.push(arguments[i++]);\n $replacer = replacer = args[1];\n if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined\n if (!isArray(replacer)) replacer = function (key, value) {\n if (typeof $replacer == 'function') value = $replacer.call(this, key, value);\n if (!isSymbol(value)) return value;\n };\n args[1] = replacer;\n return _stringify.apply($JSON, args);\n }\n});\n\n// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)\n$Symbol[PROTOTYPE][TO_PRIMITIVE] || require('./_hide')($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);\n// 19.4.3.5 Symbol.prototype[@@toStringTag]\nsetToStringTag($Symbol, 'Symbol');\n// 20.2.1.9 Math[@@toStringTag]\nsetToStringTag(Math, 'Math', true);\n// 24.3.3 JSON[@@toStringTag]\nsetToStringTag(global.JSON, 'JSON', true);\n","// https://tc39.github.io/proposal-setmap-offrom/#sec-map.from\nrequire('./_set-collection-from')('Map');\n","// https://tc39.github.io/proposal-setmap-offrom/#sec-map.of\nrequire('./_set-collection-of')('Map');\n","// https://github.com/DavidBruant/Map-Set.prototype.toJSON\nvar $export = require('./_export');\n\n$export($export.P + $export.R, 'Map', { toJSON: require('./_collection-to-json')('Map') });\n","require('./_wks-define')('asyncIterator');\n","require('./_wks-define')('observable');\n","require('./es6.array.iterator');\nvar global = require('./_global');\nvar hide = require('./_hide');\nvar Iterators = require('./_iterators');\nvar TO_STRING_TAG = require('./_wks')('toStringTag');\n\nvar DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' +\n 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' +\n 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' +\n 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' +\n 'TextTrackList,TouchList').split(',');\n\nfor (var i = 0; i < DOMIterables.length; i++) {\n var NAME = DOMIterables[i];\n var Collection = global[NAME];\n var proto = Collection && Collection.prototype;\n if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);\n Iterators[NAME] = Iterators.Array;\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\n\nfunction isArray(arg) {\n if (Array.isArray) {\n return Array.isArray(arg);\n }\n return objectToString(arg) === '[object Array]';\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\n\nfunction isError(e) {\n return (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = Buffer.isBuffer;\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n","var elliptic = require('elliptic');\nvar BN = require('bn.js');\n\nmodule.exports = function createECDH(curve) {\n\treturn new ECDH(curve);\n};\n\nvar aliases = {\n\tsecp256k1: {\n\t\tname: 'secp256k1',\n\t\tbyteLength: 32\n\t},\n\tsecp224r1: {\n\t\tname: 'p224',\n\t\tbyteLength: 28\n\t},\n\tprime256v1: {\n\t\tname: 'p256',\n\t\tbyteLength: 32\n\t},\n\tprime192v1: {\n\t\tname: 'p192',\n\t\tbyteLength: 24\n\t},\n\ted25519: {\n\t\tname: 'ed25519',\n\t\tbyteLength: 32\n\t},\n\tsecp384r1: {\n\t\tname: 'p384',\n\t\tbyteLength: 48\n\t},\n\tsecp521r1: {\n\t\tname: 'p521',\n\t\tbyteLength: 66\n\t}\n};\n\naliases.p224 = aliases.secp224r1;\naliases.p256 = aliases.secp256r1 = aliases.prime256v1;\naliases.p192 = aliases.secp192r1 = aliases.prime192v1;\naliases.p384 = aliases.secp384r1;\naliases.p521 = aliases.secp521r1;\n\nfunction ECDH(curve) {\n\tthis.curveType = aliases[curve];\n\tif (!this.curveType ) {\n\t\tthis.curveType = {\n\t\t\tname: curve\n\t\t};\n\t}\n\tthis.curve = new elliptic.ec(this.curveType.name);\n\tthis.keys = void 0;\n}\n\nECDH.prototype.generateKeys = function (enc, format) {\n\tthis.keys = this.curve.genKeyPair();\n\treturn this.getPublicKey(enc, format);\n};\n\nECDH.prototype.computeSecret = function (other, inenc, enc) {\n\tinenc = inenc || 'utf8';\n\tif (!Buffer.isBuffer(other)) {\n\t\tother = new Buffer(other, inenc);\n\t}\n\tvar otherPub = this.curve.keyFromPublic(other).getPublic();\n\tvar out = otherPub.mul(this.keys.getPrivate()).getX();\n\treturn formatReturnValue(out, enc, this.curveType.byteLength);\n};\n\nECDH.prototype.getPublicKey = function (enc, format) {\n\tvar key = this.keys.getPublic(format === 'compressed', true);\n\tif (format === 'hybrid') {\n\t\tif (key[key.length - 1] % 2) {\n\t\t\tkey[0] = 7;\n\t\t} else {\n\t\t\tkey [0] = 6;\n\t\t}\n\t}\n\treturn formatReturnValue(key, enc);\n};\n\nECDH.prototype.getPrivateKey = function (enc) {\n\treturn formatReturnValue(this.keys.getPrivate(), enc);\n};\n\nECDH.prototype.setPublicKey = function (pub, enc) {\n\tenc = enc || 'utf8';\n\tif (!Buffer.isBuffer(pub)) {\n\t\tpub = new Buffer(pub, enc);\n\t}\n\tthis.keys._importPublic(pub);\n\treturn this;\n};\n\nECDH.prototype.setPrivateKey = function (priv, enc) {\n\tenc = enc || 'utf8';\n\tif (!Buffer.isBuffer(priv)) {\n\t\tpriv = new Buffer(priv, enc);\n\t}\n\tvar _priv = new BN(priv);\n\t_priv = _priv.toString(16);\n\tthis.keys._importPrivate(_priv);\n\treturn this;\n};\n\nfunction formatReturnValue(bn, enc, len) {\n\tif (!Array.isArray(bn)) {\n\t\tbn = bn.toArray();\n\t}\n\tvar buf = new Buffer(bn);\n\tif (len && buf.length < len) {\n\t\tvar zeros = new Buffer(len - buf.length);\n\t\tzeros.fill(0);\n\t\tbuf = Buffer.concat([zeros, buf]);\n\t}\n\tif (!enc) {\n\t\treturn buf;\n\t} else {\n\t\treturn buf.toString(enc);\n\t}\n}\n","'use strict'\nvar inherits = require('inherits')\nvar md5 = require('./md5')\nvar RIPEMD160 = require('ripemd160')\nvar sha = require('sha.js')\n\nvar Base = require('cipher-base')\n\nfunction HashNoConstructor (hash) {\n Base.call(this, 'digest')\n\n this._hash = hash\n this.buffers = []\n}\n\ninherits(HashNoConstructor, Base)\n\nHashNoConstructor.prototype._update = function (data) {\n this.buffers.push(data)\n}\n\nHashNoConstructor.prototype._final = function () {\n var buf = Buffer.concat(this.buffers)\n var r = this._hash(buf)\n this.buffers = null\n\n return r\n}\n\nfunction Hash (hash) {\n Base.call(this, 'digest')\n\n this._hash = hash\n}\n\ninherits(Hash, Base)\n\nHash.prototype._update = function (data) {\n this._hash.update(data)\n}\n\nHash.prototype._final = function () {\n return this._hash.digest()\n}\n\nmodule.exports = function createHash (alg) {\n alg = alg.toLowerCase()\n if (alg === 'md5') return new HashNoConstructor(md5)\n if (alg === 'rmd160' || alg === 'ripemd160') return new Hash(new RIPEMD160())\n\n return new Hash(sha(alg))\n}\n","'use strict'\nvar intSize = 4\nvar zeroBuffer = new Buffer(intSize)\nzeroBuffer.fill(0)\n\nvar charSize = 8\nvar hashSize = 16\n\nfunction toArray (buf) {\n if ((buf.length % intSize) !== 0) {\n var len = buf.length + (intSize - (buf.length % intSize))\n buf = Buffer.concat([buf, zeroBuffer], len)\n }\n\n var arr = new Array(buf.length >>> 2)\n for (var i = 0, j = 0; i < buf.length; i += intSize, j++) {\n arr[j] = buf.readInt32LE(i)\n }\n\n return arr\n}\n\nmodule.exports = function hash (buf, fn) {\n var arr = fn(toArray(buf), buf.length * charSize)\n buf = new Buffer(hashSize)\n for (var i = 0; i < arr.length; i++) {\n buf.writeInt32LE(arr[i], i << 2, true)\n }\n return buf\n}\n","'use strict'\n/*\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\n\nvar makeHash = require('./make-hash')\n\n/*\n * Calculate the MD5 of an array of little-endian words, and a bit length\n */\nfunction core_md5 (x, len) {\n /* append padding */\n x[len >> 5] |= 0x80 << ((len) % 32)\n x[(((len + 64) >>> 9) << 4) + 14] = len\n\n var a = 1732584193\n var b = -271733879\n var c = -1732584194\n var d = 271733878\n\n for (var i = 0; i < x.length; i += 16) {\n var olda = a\n var oldb = b\n var oldc = c\n var oldd = d\n\n a = md5_ff(a, b, c, d, x[i + 0], 7, -680876936)\n d = md5_ff(d, a, b, c, x[i + 1], 12, -389564586)\n c = md5_ff(c, d, a, b, x[i + 2], 17, 606105819)\n b = md5_ff(b, c, d, a, x[i + 3], 22, -1044525330)\n a = md5_ff(a, b, c, d, x[i + 4], 7, -176418897)\n d = md5_ff(d, a, b, c, x[i + 5], 12, 1200080426)\n c = md5_ff(c, d, a, b, x[i + 6], 17, -1473231341)\n b = md5_ff(b, c, d, a, x[i + 7], 22, -45705983)\n a = md5_ff(a, b, c, d, x[i + 8], 7, 1770035416)\n d = md5_ff(d, a, b, c, x[i + 9], 12, -1958414417)\n c = md5_ff(c, d, a, b, x[i + 10], 17, -42063)\n b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162)\n a = md5_ff(a, b, c, d, x[i + 12], 7, 1804603682)\n d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101)\n c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290)\n b = md5_ff(b, c, d, a, x[i + 15], 22, 1236535329)\n\n a = md5_gg(a, b, c, d, x[i + 1], 5, -165796510)\n d = md5_gg(d, a, b, c, x[i + 6], 9, -1069501632)\n c = md5_gg(c, d, a, b, x[i + 11], 14, 643717713)\n b = md5_gg(b, c, d, a, x[i + 0], 20, -373897302)\n a = md5_gg(a, b, c, d, x[i + 5], 5, -701558691)\n d = md5_gg(d, a, b, c, x[i + 10], 9, 38016083)\n c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335)\n b = md5_gg(b, c, d, a, x[i + 4], 20, -405537848)\n a = md5_gg(a, b, c, d, x[i + 9], 5, 568446438)\n d = md5_gg(d, a, b, c, x[i + 14], 9, -1019803690)\n c = md5_gg(c, d, a, b, x[i + 3], 14, -187363961)\n b = md5_gg(b, c, d, a, x[i + 8], 20, 1163531501)\n a = md5_gg(a, b, c, d, x[i + 13], 5, -1444681467)\n d = md5_gg(d, a, b, c, x[i + 2], 9, -51403784)\n c = md5_gg(c, d, a, b, x[i + 7], 14, 1735328473)\n b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734)\n\n a = md5_hh(a, b, c, d, x[i + 5], 4, -378558)\n d = md5_hh(d, a, b, c, x[i + 8], 11, -2022574463)\n c = md5_hh(c, d, a, b, x[i + 11], 16, 1839030562)\n b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556)\n a = md5_hh(a, b, c, d, x[i + 1], 4, -1530992060)\n d = md5_hh(d, a, b, c, x[i + 4], 11, 1272893353)\n c = md5_hh(c, d, a, b, x[i + 7], 16, -155497632)\n b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640)\n a = md5_hh(a, b, c, d, x[i + 13], 4, 681279174)\n d = md5_hh(d, a, b, c, x[i + 0], 11, -358537222)\n c = md5_hh(c, d, a, b, x[i + 3], 16, -722521979)\n b = md5_hh(b, c, d, a, x[i + 6], 23, 76029189)\n a = md5_hh(a, b, c, d, x[i + 9], 4, -640364487)\n d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835)\n c = md5_hh(c, d, a, b, x[i + 15], 16, 530742520)\n b = md5_hh(b, c, d, a, x[i + 2], 23, -995338651)\n\n a = md5_ii(a, b, c, d, x[i + 0], 6, -198630844)\n d = md5_ii(d, a, b, c, x[i + 7], 10, 1126891415)\n c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905)\n b = md5_ii(b, c, d, a, x[i + 5], 21, -57434055)\n a = md5_ii(a, b, c, d, x[i + 12], 6, 1700485571)\n d = md5_ii(d, a, b, c, x[i + 3], 10, -1894986606)\n c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523)\n b = md5_ii(b, c, d, a, x[i + 1], 21, -2054922799)\n a = md5_ii(a, b, c, d, x[i + 8], 6, 1873313359)\n d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744)\n c = md5_ii(c, d, a, b, x[i + 6], 15, -1560198380)\n b = md5_ii(b, c, d, a, x[i + 13], 21, 1309151649)\n a = md5_ii(a, b, c, d, x[i + 4], 6, -145523070)\n d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379)\n c = md5_ii(c, d, a, b, x[i + 2], 15, 718787259)\n b = md5_ii(b, c, d, a, x[i + 9], 21, -343485551)\n\n a = safe_add(a, olda)\n b = safe_add(b, oldb)\n c = safe_add(c, oldc)\n d = safe_add(d, oldd)\n }\n\n return [a, b, c, d]\n}\n\n/*\n * These functions implement the four basic operations the algorithm uses.\n */\nfunction md5_cmn (q, a, b, x, s, t) {\n return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b)\n}\n\nfunction md5_ff (a, b, c, d, x, s, t) {\n return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t)\n}\n\nfunction md5_gg (a, b, c, d, x, s, t) {\n return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t)\n}\n\nfunction md5_hh (a, b, c, d, x, s, t) {\n return md5_cmn(b ^ c ^ d, a, b, x, s, t)\n}\n\nfunction md5_ii (a, b, c, d, x, s, t) {\n return md5_cmn(c ^ (b | (~d)), a, b, x, s, t)\n}\n\n/*\n * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n * to work around bugs in some JS interpreters.\n */\nfunction safe_add (x, y) {\n var lsw = (x & 0xFFFF) + (y & 0xFFFF)\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16)\n return (msw << 16) | (lsw & 0xFFFF)\n}\n\n/*\n * Bitwise rotate a 32-bit number to the left.\n */\nfunction bit_rol (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n}\n\nmodule.exports = function md5 (buf) {\n return makeHash(buf, core_md5)\n}\n","'use strict'\nvar inherits = require('inherits')\nvar Legacy = require('./legacy')\nvar Base = require('cipher-base')\nvar Buffer = require('safe-buffer').Buffer\nvar md5 = require('create-hash/md5')\nvar RIPEMD160 = require('ripemd160')\n\nvar sha = require('sha.js')\n\nvar ZEROS = Buffer.alloc(128)\n\nfunction Hmac (alg, key) {\n Base.call(this, 'digest')\n if (typeof key === 'string') {\n key = Buffer.from(key)\n }\n\n var blocksize = (alg === 'sha512' || alg === 'sha384') ? 128 : 64\n\n this._alg = alg\n this._key = key\n if (key.length > blocksize) {\n var hash = alg === 'rmd160' ? new RIPEMD160() : sha(alg)\n key = hash.update(key).digest()\n } else if (key.length < blocksize) {\n key = Buffer.concat([key, ZEROS], blocksize)\n }\n\n var ipad = this._ipad = Buffer.allocUnsafe(blocksize)\n var opad = this._opad = Buffer.allocUnsafe(blocksize)\n\n for (var i = 0; i < blocksize; i++) {\n ipad[i] = key[i] ^ 0x36\n opad[i] = key[i] ^ 0x5C\n }\n this._hash = alg === 'rmd160' ? new RIPEMD160() : sha(alg)\n this._hash.update(ipad)\n}\n\ninherits(Hmac, Base)\n\nHmac.prototype._update = function (data) {\n this._hash.update(data)\n}\n\nHmac.prototype._final = function () {\n var h = this._hash.digest()\n var hash = this._alg === 'rmd160' ? new RIPEMD160() : sha(this._alg)\n return hash.update(this._opad).update(h).digest()\n}\n\nmodule.exports = function createHmac (alg, key) {\n alg = alg.toLowerCase()\n if (alg === 'rmd160' || alg === 'ripemd160') {\n return new Hmac('rmd160', key)\n }\n if (alg === 'md5') {\n return new Legacy(md5, key)\n }\n return new Hmac(alg, key)\n}\n","'use strict'\nvar inherits = require('inherits')\nvar Buffer = require('safe-buffer').Buffer\n\nvar Base = require('cipher-base')\n\nvar ZEROS = Buffer.alloc(128)\nvar blocksize = 64\n\nfunction Hmac (alg, key) {\n Base.call(this, 'digest')\n if (typeof key === 'string') {\n key = Buffer.from(key)\n }\n\n this._alg = alg\n this._key = key\n\n if (key.length > blocksize) {\n key = alg(key)\n } else if (key.length < blocksize) {\n key = Buffer.concat([key, ZEROS], blocksize)\n }\n\n var ipad = this._ipad = Buffer.allocUnsafe(blocksize)\n var opad = this._opad = Buffer.allocUnsafe(blocksize)\n\n for (var i = 0; i < blocksize; i++) {\n ipad[i] = key[i] ^ 0x36\n opad[i] = key[i] ^ 0x5C\n }\n\n this._hash = [ipad]\n}\n\ninherits(Hmac, Base)\n\nHmac.prototype._update = function (data) {\n this._hash.push(data)\n}\n\nHmac.prototype._final = function () {\n var h = this._alg(Buffer.concat(this._hash))\n return this._alg(Buffer.concat([this._opad, h]))\n}\nmodule.exports = Hmac\n","'use strict'\n\nexports.randomBytes = exports.rng = exports.pseudoRandomBytes = exports.prng = require('randombytes')\nexports.createHash = exports.Hash = require('create-hash')\nexports.createHmac = exports.Hmac = require('create-hmac')\n\nvar algos = require('browserify-sign/algos')\nvar algoKeys = Object.keys(algos)\nvar hashes = ['sha1', 'sha224', 'sha256', 'sha384', 'sha512', 'md5', 'rmd160'].concat(algoKeys)\nexports.getHashes = function () {\n return hashes\n}\n\nvar p = require('pbkdf2')\nexports.pbkdf2 = p.pbkdf2\nexports.pbkdf2Sync = p.pbkdf2Sync\n\nvar aes = require('browserify-cipher')\n\nexports.Cipher = aes.Cipher\nexports.createCipher = aes.createCipher\nexports.Cipheriv = aes.Cipheriv\nexports.createCipheriv = aes.createCipheriv\nexports.Decipher = aes.Decipher\nexports.createDecipher = aes.createDecipher\nexports.Decipheriv = aes.Decipheriv\nexports.createDecipheriv = aes.createDecipheriv\nexports.getCiphers = aes.getCiphers\nexports.listCiphers = aes.listCiphers\n\nvar dh = require('diffie-hellman')\n\nexports.DiffieHellmanGroup = dh.DiffieHellmanGroup\nexports.createDiffieHellmanGroup = dh.createDiffieHellmanGroup\nexports.getDiffieHellman = dh.getDiffieHellman\nexports.createDiffieHellman = dh.createDiffieHellman\nexports.DiffieHellman = dh.DiffieHellman\n\nvar sign = require('browserify-sign')\n\nexports.createSign = sign.createSign\nexports.Sign = sign.Sign\nexports.createVerify = sign.createVerify\nexports.Verify = sign.Verify\n\nexports.createECDH = require('create-ecdh')\n\nvar publicEncrypt = require('public-encrypt')\n\nexports.publicEncrypt = publicEncrypt.publicEncrypt\nexports.privateEncrypt = publicEncrypt.privateEncrypt\nexports.publicDecrypt = publicEncrypt.publicDecrypt\nexports.privateDecrypt = publicEncrypt.privateDecrypt\n\n// the least I can do is make error messages for the rest of the node.js/crypto api.\n// ;[\n// 'createCredentials'\n// ].forEach(function (name) {\n// exports[name] = function () {\n// throw new Error([\n// 'sorry, ' + name + ' is not implemented yet',\n// 'we accept pull requests',\n// 'https://github.com/crypto-browserify/crypto-browserify'\n// ].join('\\n'))\n// }\n// })\n\nvar rf = require('randomfill')\n\nexports.randomFill = rf.randomFill\nexports.randomFillSync = rf.randomFillSync\n\nexports.createCredentials = function () {\n throw new Error([\n 'sorry, createCredentials is not implemented yet',\n 'we accept pull requests',\n 'https://github.com/crypto-browserify/crypto-browserify'\n ].join('\\n'))\n}\n\nexports.constants = {\n 'DH_CHECK_P_NOT_SAFE_PRIME': 2,\n 'DH_CHECK_P_NOT_PRIME': 1,\n 'DH_UNABLE_TO_CHECK_GENERATOR': 4,\n 'DH_NOT_SUITABLE_GENERATOR': 8,\n 'NPN_ENABLED': 1,\n 'ALPN_ENABLED': 1,\n 'RSA_PKCS1_PADDING': 1,\n 'RSA_SSLV23_PADDING': 2,\n 'RSA_NO_PADDING': 3,\n 'RSA_PKCS1_OAEP_PADDING': 4,\n 'RSA_X931_PADDING': 5,\n 'RSA_PKCS1_PSS_PADDING': 6,\n 'POINT_CONVERSION_COMPRESSED': 2,\n 'POINT_CONVERSION_UNCOMPRESSED': 4,\n 'POINT_CONVERSION_HYBRID': 6\n}\n",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory();\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\troot.CryptoJS = factory();\n\t}\n}(this, function () {\n\n\t/**\n\t * CryptoJS core components.\n\t */\n\tvar CryptoJS = CryptoJS || (function (Math, undefined) {\n\t /*\n\t * Local polyfil of Object.create\n\t */\n\t var create = Object.create || (function () {\n\t function F() {};\n\n\t return function (obj) {\n\t var subtype;\n\n\t F.prototype = obj;\n\n\t subtype = new F();\n\n\t F.prototype = null;\n\n\t return subtype;\n\t };\n\t }())\n\n\t /**\n\t * CryptoJS namespace.\n\t */\n\t var C = {};\n\n\t /**\n\t * Library namespace.\n\t */\n\t var C_lib = C.lib = {};\n\n\t /**\n\t * Base object for prototypal inheritance.\n\t */\n\t var Base = C_lib.Base = (function () {\n\n\n\t return {\n\t /**\n\t * Creates a new object that inherits from this object.\n\t *\n\t * @param {Object} overrides Properties to copy into the new object.\n\t *\n\t * @return {Object} The new object.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var MyType = CryptoJS.lib.Base.extend({\n\t * field: 'value',\n\t *\n\t * method: function () {\n\t * }\n\t * });\n\t */\n\t extend: function (overrides) {\n\t // Spawn\n\t var subtype = create(this);\n\n\t // Augment\n\t if (overrides) {\n\t subtype.mixIn(overrides);\n\t }\n\n\t // Create default initializer\n\t if (!subtype.hasOwnProperty('init') || this.init === subtype.init) {\n\t subtype.init = function () {\n\t subtype.$super.init.apply(this, arguments);\n\t };\n\t }\n\n\t // Initializer's prototype is the subtype object\n\t subtype.init.prototype = subtype;\n\n\t // Reference supertype\n\t subtype.$super = this;\n\n\t return subtype;\n\t },\n\n\t /**\n\t * Extends this object and runs the init method.\n\t * Arguments to create() will be passed to init().\n\t *\n\t * @return {Object} The new object.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var instance = MyType.create();\n\t */\n\t create: function () {\n\t var instance = this.extend();\n\t instance.init.apply(instance, arguments);\n\n\t return instance;\n\t },\n\n\t /**\n\t * Initializes a newly created object.\n\t * Override this method to add some logic when your objects are created.\n\t *\n\t * @example\n\t *\n\t * var MyType = CryptoJS.lib.Base.extend({\n\t * init: function () {\n\t * // ...\n\t * }\n\t * });\n\t */\n\t init: function () {\n\t },\n\n\t /**\n\t * Copies properties into this object.\n\t *\n\t * @param {Object} properties The properties to mix in.\n\t *\n\t * @example\n\t *\n\t * MyType.mixIn({\n\t * field: 'value'\n\t * });\n\t */\n\t mixIn: function (properties) {\n\t for (var propertyName in properties) {\n\t if (properties.hasOwnProperty(propertyName)) {\n\t this[propertyName] = properties[propertyName];\n\t }\n\t }\n\n\t // IE won't copy toString using the loop above\n\t if (properties.hasOwnProperty('toString')) {\n\t this.toString = properties.toString;\n\t }\n\t },\n\n\t /**\n\t * Creates a copy of this object.\n\t *\n\t * @return {Object} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = instance.clone();\n\t */\n\t clone: function () {\n\t return this.init.prototype.extend(this);\n\t }\n\t };\n\t }());\n\n\t /**\n\t * An array of 32-bit words.\n\t *\n\t * @property {Array} words The array of 32-bit words.\n\t * @property {number} sigBytes The number of significant bytes in this word array.\n\t */\n\t var WordArray = C_lib.WordArray = Base.extend({\n\t /**\n\t * Initializes a newly created word array.\n\t *\n\t * @param {Array} words (Optional) An array of 32-bit words.\n\t * @param {number} sigBytes (Optional) The number of significant bytes in the words.\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.lib.WordArray.create();\n\t * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);\n\t * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);\n\t */\n\t init: function (words, sigBytes) {\n\t words = this.words = words || [];\n\n\t if (sigBytes != undefined) {\n\t this.sigBytes = sigBytes;\n\t } else {\n\t this.sigBytes = words.length * 4;\n\t }\n\t },\n\n\t /**\n\t * Converts this word array to a string.\n\t *\n\t * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex\n\t *\n\t * @return {string} The stringified word array.\n\t *\n\t * @example\n\t *\n\t * var string = wordArray + '';\n\t * var string = wordArray.toString();\n\t * var string = wordArray.toString(CryptoJS.enc.Utf8);\n\t */\n\t toString: function (encoder) {\n\t return (encoder || Hex).stringify(this);\n\t },\n\n\t /**\n\t * Concatenates a word array to this word array.\n\t *\n\t * @param {WordArray} wordArray The word array to append.\n\t *\n\t * @return {WordArray} This word array.\n\t *\n\t * @example\n\t *\n\t * wordArray1.concat(wordArray2);\n\t */\n\t concat: function (wordArray) {\n\t // Shortcuts\n\t var thisWords = this.words;\n\t var thatWords = wordArray.words;\n\t var thisSigBytes = this.sigBytes;\n\t var thatSigBytes = wordArray.sigBytes;\n\n\t // Clamp excess bits\n\t this.clamp();\n\n\t // Concat\n\t if (thisSigBytes % 4) {\n\t // Copy one byte at a time\n\t for (var i = 0; i < thatSigBytes; i++) {\n\t var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8);\n\t }\n\t } else {\n\t // Copy one word at a time\n\t for (var i = 0; i < thatSigBytes; i += 4) {\n\t thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2];\n\t }\n\t }\n\t this.sigBytes += thatSigBytes;\n\n\t // Chainable\n\t return this;\n\t },\n\n\t /**\n\t * Removes insignificant bits.\n\t *\n\t * @example\n\t *\n\t * wordArray.clamp();\n\t */\n\t clamp: function () {\n\t // Shortcuts\n\t var words = this.words;\n\t var sigBytes = this.sigBytes;\n\n\t // Clamp\n\t words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8);\n\t words.length = Math.ceil(sigBytes / 4);\n\t },\n\n\t /**\n\t * Creates a copy of this word array.\n\t *\n\t * @return {WordArray} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = wordArray.clone();\n\t */\n\t clone: function () {\n\t var clone = Base.clone.call(this);\n\t clone.words = this.words.slice(0);\n\n\t return clone;\n\t },\n\n\t /**\n\t * Creates a word array filled with random bytes.\n\t *\n\t * @param {number} nBytes The number of random bytes to generate.\n\t *\n\t * @return {WordArray} The random word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.lib.WordArray.random(16);\n\t */\n\t random: function (nBytes) {\n\t var words = [];\n\n\t var r = (function (m_w) {\n\t var m_w = m_w;\n\t var m_z = 0x3ade68b1;\n\t var mask = 0xffffffff;\n\n\t return function () {\n\t m_z = (0x9069 * (m_z & 0xFFFF) + (m_z >> 0x10)) & mask;\n\t m_w = (0x4650 * (m_w & 0xFFFF) + (m_w >> 0x10)) & mask;\n\t var result = ((m_z << 0x10) + m_w) & mask;\n\t result /= 0x100000000;\n\t result += 0.5;\n\t return result * (Math.random() > .5 ? 1 : -1);\n\t }\n\t });\n\n\t for (var i = 0, rcache; i < nBytes; i += 4) {\n\t var _r = r((rcache || Math.random()) * 0x100000000);\n\n\t rcache = _r() * 0x3ade67b7;\n\t words.push((_r() * 0x100000000) | 0);\n\t }\n\n\t return new WordArray.init(words, nBytes);\n\t }\n\t });\n\n\t /**\n\t * Encoder namespace.\n\t */\n\t var C_enc = C.enc = {};\n\n\t /**\n\t * Hex encoding strategy.\n\t */\n\t var Hex = C_enc.Hex = {\n\t /**\n\t * Converts a word array to a hex string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The hex string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hexString = CryptoJS.enc.Hex.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\n\t // Convert\n\t var hexChars = [];\n\t for (var i = 0; i < sigBytes; i++) {\n\t var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t hexChars.push((bite >>> 4).toString(16));\n\t hexChars.push((bite & 0x0f).toString(16));\n\t }\n\n\t return hexChars.join('');\n\t },\n\n\t /**\n\t * Converts a hex string to a word array.\n\t *\n\t * @param {string} hexStr The hex string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Hex.parse(hexString);\n\t */\n\t parse: function (hexStr) {\n\t // Shortcut\n\t var hexStrLength = hexStr.length;\n\n\t // Convert\n\t var words = [];\n\t for (var i = 0; i < hexStrLength; i += 2) {\n\t words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4);\n\t }\n\n\t return new WordArray.init(words, hexStrLength / 2);\n\t }\n\t };\n\n\t /**\n\t * Latin1 encoding strategy.\n\t */\n\t var Latin1 = C_enc.Latin1 = {\n\t /**\n\t * Converts a word array to a Latin1 string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The Latin1 string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\n\t // Convert\n\t var latin1Chars = [];\n\t for (var i = 0; i < sigBytes; i++) {\n\t var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t latin1Chars.push(String.fromCharCode(bite));\n\t }\n\n\t return latin1Chars.join('');\n\t },\n\n\t /**\n\t * Converts a Latin1 string to a word array.\n\t *\n\t * @param {string} latin1Str The Latin1 string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);\n\t */\n\t parse: function (latin1Str) {\n\t // Shortcut\n\t var latin1StrLength = latin1Str.length;\n\n\t // Convert\n\t var words = [];\n\t for (var i = 0; i < latin1StrLength; i++) {\n\t words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8);\n\t }\n\n\t return new WordArray.init(words, latin1StrLength);\n\t }\n\t };\n\n\t /**\n\t * UTF-8 encoding strategy.\n\t */\n\t var Utf8 = C_enc.Utf8 = {\n\t /**\n\t * Converts a word array to a UTF-8 string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The UTF-8 string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t try {\n\t return decodeURIComponent(escape(Latin1.stringify(wordArray)));\n\t } catch (e) {\n\t throw new Error('Malformed UTF-8 data');\n\t }\n\t },\n\n\t /**\n\t * Converts a UTF-8 string to a word array.\n\t *\n\t * @param {string} utf8Str The UTF-8 string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);\n\t */\n\t parse: function (utf8Str) {\n\t return Latin1.parse(unescape(encodeURIComponent(utf8Str)));\n\t }\n\t };\n\n\t /**\n\t * Abstract buffered block algorithm template.\n\t *\n\t * The property blockSize must be implemented in a concrete subtype.\n\t *\n\t * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0\n\t */\n\t var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({\n\t /**\n\t * Resets this block algorithm's data buffer to its initial state.\n\t *\n\t * @example\n\t *\n\t * bufferedBlockAlgorithm.reset();\n\t */\n\t reset: function () {\n\t // Initial values\n\t this._data = new WordArray.init();\n\t this._nDataBytes = 0;\n\t },\n\n\t /**\n\t * Adds new data to this block algorithm's buffer.\n\t *\n\t * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.\n\t *\n\t * @example\n\t *\n\t * bufferedBlockAlgorithm._append('data');\n\t * bufferedBlockAlgorithm._append(wordArray);\n\t */\n\t _append: function (data) {\n\t // Convert string to WordArray, else assume WordArray already\n\t if (typeof data == 'string') {\n\t data = Utf8.parse(data);\n\t }\n\n\t // Append\n\t this._data.concat(data);\n\t this._nDataBytes += data.sigBytes;\n\t },\n\n\t /**\n\t * Processes available data blocks.\n\t *\n\t * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.\n\t *\n\t * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.\n\t *\n\t * @return {WordArray} The processed data.\n\t *\n\t * @example\n\t *\n\t * var processedData = bufferedBlockAlgorithm._process();\n\t * var processedData = bufferedBlockAlgorithm._process(!!'flush');\n\t */\n\t _process: function (doFlush) {\n\t // Shortcuts\n\t var data = this._data;\n\t var dataWords = data.words;\n\t var dataSigBytes = data.sigBytes;\n\t var blockSize = this.blockSize;\n\t var blockSizeBytes = blockSize * 4;\n\n\t // Count blocks ready\n\t var nBlocksReady = dataSigBytes / blockSizeBytes;\n\t if (doFlush) {\n\t // Round up to include partial blocks\n\t nBlocksReady = Math.ceil(nBlocksReady);\n\t } else {\n\t // Round down to include only full blocks,\n\t // less the number of blocks that must remain in the buffer\n\t nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);\n\t }\n\n\t // Count words ready\n\t var nWordsReady = nBlocksReady * blockSize;\n\n\t // Count bytes ready\n\t var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes);\n\n\t // Process blocks\n\t if (nWordsReady) {\n\t for (var offset = 0; offset < nWordsReady; offset += blockSize) {\n\t // Perform concrete-algorithm logic\n\t this._doProcessBlock(dataWords, offset);\n\t }\n\n\t // Remove processed words\n\t var processedWords = dataWords.splice(0, nWordsReady);\n\t data.sigBytes -= nBytesReady;\n\t }\n\n\t // Return processed words\n\t return new WordArray.init(processedWords, nBytesReady);\n\t },\n\n\t /**\n\t * Creates a copy of this object.\n\t *\n\t * @return {Object} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = bufferedBlockAlgorithm.clone();\n\t */\n\t clone: function () {\n\t var clone = Base.clone.call(this);\n\t clone._data = this._data.clone();\n\n\t return clone;\n\t },\n\n\t _minBufferSize: 0\n\t });\n\n\t /**\n\t * Abstract hasher template.\n\t *\n\t * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits)\n\t */\n\t var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({\n\t /**\n\t * Configuration options.\n\t */\n\t cfg: Base.extend(),\n\n\t /**\n\t * Initializes a newly created hasher.\n\t *\n\t * @param {Object} cfg (Optional) The configuration options to use for this hash computation.\n\t *\n\t * @example\n\t *\n\t * var hasher = CryptoJS.algo.SHA256.create();\n\t */\n\t init: function (cfg) {\n\t // Apply config defaults\n\t this.cfg = this.cfg.extend(cfg);\n\n\t // Set initial values\n\t this.reset();\n\t },\n\n\t /**\n\t * Resets this hasher to its initial state.\n\t *\n\t * @example\n\t *\n\t * hasher.reset();\n\t */\n\t reset: function () {\n\t // Reset data buffer\n\t BufferedBlockAlgorithm.reset.call(this);\n\n\t // Perform concrete-hasher logic\n\t this._doReset();\n\t },\n\n\t /**\n\t * Updates this hasher with a message.\n\t *\n\t * @param {WordArray|string} messageUpdate The message to append.\n\t *\n\t * @return {Hasher} This hasher.\n\t *\n\t * @example\n\t *\n\t * hasher.update('message');\n\t * hasher.update(wordArray);\n\t */\n\t update: function (messageUpdate) {\n\t // Append\n\t this._append(messageUpdate);\n\n\t // Update the hash\n\t this._process();\n\n\t // Chainable\n\t return this;\n\t },\n\n\t /**\n\t * Finalizes the hash computation.\n\t * Note that the finalize operation is effectively a destructive, read-once operation.\n\t *\n\t * @param {WordArray|string} messageUpdate (Optional) A final message update.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @example\n\t *\n\t * var hash = hasher.finalize();\n\t * var hash = hasher.finalize('message');\n\t * var hash = hasher.finalize(wordArray);\n\t */\n\t finalize: function (messageUpdate) {\n\t // Final message update\n\t if (messageUpdate) {\n\t this._append(messageUpdate);\n\t }\n\n\t // Perform concrete-hasher logic\n\t var hash = this._doFinalize();\n\n\t return hash;\n\t },\n\n\t blockSize: 512/32,\n\n\t /**\n\t * Creates a shortcut function to a hasher's object interface.\n\t *\n\t * @param {Hasher} hasher The hasher to create a helper for.\n\t *\n\t * @return {Function} The shortcut function.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);\n\t */\n\t _createHelper: function (hasher) {\n\t return function (message, cfg) {\n\t return new hasher.init(cfg).finalize(message);\n\t };\n\t },\n\n\t /**\n\t * Creates a shortcut function to the HMAC's object interface.\n\t *\n\t * @param {Hasher} hasher The hasher to use in this HMAC helper.\n\t *\n\t * @return {Function} The shortcut function.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);\n\t */\n\t _createHmacHelper: function (hasher) {\n\t return function (message, key) {\n\t return new C_algo.HMAC.init(hasher, key).finalize(message);\n\t };\n\t }\n\t });\n\n\t /**\n\t * Algorithm namespace.\n\t */\n\t var C_algo = C.algo = {};\n\n\t return C;\n\t}(Math));\n\n\n\treturn CryptoJS;\n\n}));",";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./x64-core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./x64-core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function (Math) {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\t var Hasher = C_lib.Hasher;\n\t var C_x64 = C.x64;\n\t var X64Word = C_x64.Word;\n\t var C_algo = C.algo;\n\n\t // Constants tables\n\t var RHO_OFFSETS = [];\n\t var PI_INDEXES = [];\n\t var ROUND_CONSTANTS = [];\n\n\t // Compute Constants\n\t (function () {\n\t // Compute rho offset constants\n\t var x = 1, y = 0;\n\t for (var t = 0; t < 24; t++) {\n\t RHO_OFFSETS[x + 5 * y] = ((t + 1) * (t + 2) / 2) % 64;\n\n\t var newX = y % 5;\n\t var newY = (2 * x + 3 * y) % 5;\n\t x = newX;\n\t y = newY;\n\t }\n\n\t // Compute pi index constants\n\t for (var x = 0; x < 5; x++) {\n\t for (var y = 0; y < 5; y++) {\n\t PI_INDEXES[x + 5 * y] = y + ((2 * x + 3 * y) % 5) * 5;\n\t }\n\t }\n\n\t // Compute round constants\n\t var LFSR = 0x01;\n\t for (var i = 0; i < 24; i++) {\n\t var roundConstantMsw = 0;\n\t var roundConstantLsw = 0;\n\n\t for (var j = 0; j < 7; j++) {\n\t if (LFSR & 0x01) {\n\t var bitPosition = (1 << j) - 1;\n\t if (bitPosition < 32) {\n\t roundConstantLsw ^= 1 << bitPosition;\n\t } else /* if (bitPosition >= 32) */ {\n\t roundConstantMsw ^= 1 << (bitPosition - 32);\n\t }\n\t }\n\n\t // Compute next LFSR\n\t if (LFSR & 0x80) {\n\t // Primitive polynomial over GF(2): x^8 + x^6 + x^5 + x^4 + 1\n\t LFSR = (LFSR << 1) ^ 0x71;\n\t } else {\n\t LFSR <<= 1;\n\t }\n\t }\n\n\t ROUND_CONSTANTS[i] = X64Word.create(roundConstantMsw, roundConstantLsw);\n\t }\n\t }());\n\n\t // Reusable objects for temporary values\n\t var T = [];\n\t (function () {\n\t for (var i = 0; i < 25; i++) {\n\t T[i] = X64Word.create();\n\t }\n\t }());\n\n\t /**\n\t * SHA-3 hash algorithm.\n\t */\n\t var SHA3 = C_algo.SHA3 = Hasher.extend({\n\t /**\n\t * Configuration options.\n\t *\n\t * @property {number} outputLength\n\t * The desired number of bits in the output hash.\n\t * Only values permitted are: 224, 256, 384, 512.\n\t * Default: 512\n\t */\n\t cfg: Hasher.cfg.extend({\n\t outputLength: 512\n\t }),\n\n\t _doReset: function () {\n\t var state = this._state = []\n\t for (var i = 0; i < 25; i++) {\n\t state[i] = new X64Word.init();\n\t }\n\n\t this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32;\n\t },\n\n\t _doProcessBlock: function (M, offset) {\n\t // Shortcuts\n\t var state = this._state;\n\t var nBlockSizeLanes = this.blockSize / 2;\n\n\t // Absorb\n\t for (var i = 0; i < nBlockSizeLanes; i++) {\n\t // Shortcuts\n\t var M2i = M[offset + 2 * i];\n\t var M2i1 = M[offset + 2 * i + 1];\n\n\t // Swap endian\n\t M2i = (\n\t (((M2i << 8) | (M2i >>> 24)) & 0x00ff00ff) |\n\t (((M2i << 24) | (M2i >>> 8)) & 0xff00ff00)\n\t );\n\t M2i1 = (\n\t (((M2i1 << 8) | (M2i1 >>> 24)) & 0x00ff00ff) |\n\t (((M2i1 << 24) | (M2i1 >>> 8)) & 0xff00ff00)\n\t );\n\n\t // Absorb message into state\n\t var lane = state[i];\n\t lane.high ^= M2i1;\n\t lane.low ^= M2i;\n\t }\n\n\t // Rounds\n\t for (var round = 0; round < 24; round++) {\n\t // Theta\n\t for (var x = 0; x < 5; x++) {\n\t // Mix column lanes\n\t var tMsw = 0, tLsw = 0;\n\t for (var y = 0; y < 5; y++) {\n\t var lane = state[x + 5 * y];\n\t tMsw ^= lane.high;\n\t tLsw ^= lane.low;\n\t }\n\n\t // Temporary values\n\t var Tx = T[x];\n\t Tx.high = tMsw;\n\t Tx.low = tLsw;\n\t }\n\t for (var x = 0; x < 5; x++) {\n\t // Shortcuts\n\t var Tx4 = T[(x + 4) % 5];\n\t var Tx1 = T[(x + 1) % 5];\n\t var Tx1Msw = Tx1.high;\n\t var Tx1Lsw = Tx1.low;\n\n\t // Mix surrounding columns\n\t var tMsw = Tx4.high ^ ((Tx1Msw << 1) | (Tx1Lsw >>> 31));\n\t var tLsw = Tx4.low ^ ((Tx1Lsw << 1) | (Tx1Msw >>> 31));\n\t for (var y = 0; y < 5; y++) {\n\t var lane = state[x + 5 * y];\n\t lane.high ^= tMsw;\n\t lane.low ^= tLsw;\n\t }\n\t }\n\n\t // Rho Pi\n\t for (var laneIndex = 1; laneIndex < 25; laneIndex++) {\n\t // Shortcuts\n\t var lane = state[laneIndex];\n\t var laneMsw = lane.high;\n\t var laneLsw = lane.low;\n\t var rhoOffset = RHO_OFFSETS[laneIndex];\n\n\t // Rotate lanes\n\t if (rhoOffset < 32) {\n\t var tMsw = (laneMsw << rhoOffset) | (laneLsw >>> (32 - rhoOffset));\n\t var tLsw = (laneLsw << rhoOffset) | (laneMsw >>> (32 - rhoOffset));\n\t } else /* if (rhoOffset >= 32) */ {\n\t var tMsw = (laneLsw << (rhoOffset - 32)) | (laneMsw >>> (64 - rhoOffset));\n\t var tLsw = (laneMsw << (rhoOffset - 32)) | (laneLsw >>> (64 - rhoOffset));\n\t }\n\n\t // Transpose lanes\n\t var TPiLane = T[PI_INDEXES[laneIndex]];\n\t TPiLane.high = tMsw;\n\t TPiLane.low = tLsw;\n\t }\n\n\t // Rho pi at x = y = 0\n\t var T0 = T[0];\n\t var state0 = state[0];\n\t T0.high = state0.high;\n\t T0.low = state0.low;\n\n\t // Chi\n\t for (var x = 0; x < 5; x++) {\n\t for (var y = 0; y < 5; y++) {\n\t // Shortcuts\n\t var laneIndex = x + 5 * y;\n\t var lane = state[laneIndex];\n\t var TLane = T[laneIndex];\n\t var Tx1Lane = T[((x + 1) % 5) + 5 * y];\n\t var Tx2Lane = T[((x + 2) % 5) + 5 * y];\n\n\t // Mix rows\n\t lane.high = TLane.high ^ (~Tx1Lane.high & Tx2Lane.high);\n\t lane.low = TLane.low ^ (~Tx1Lane.low & Tx2Lane.low);\n\t }\n\t }\n\n\t // Iota\n\t var lane = state[0];\n\t var roundConstant = ROUND_CONSTANTS[round];\n\t lane.high ^= roundConstant.high;\n\t lane.low ^= roundConstant.low;;\n\t }\n\t },\n\n\t _doFinalize: function () {\n\t // Shortcuts\n\t var data = this._data;\n\t var dataWords = data.words;\n\t var nBitsTotal = this._nDataBytes * 8;\n\t var nBitsLeft = data.sigBytes * 8;\n\t var blockSizeBits = this.blockSize * 32;\n\n\t // Add padding\n\t dataWords[nBitsLeft >>> 5] |= 0x1 << (24 - nBitsLeft % 32);\n\t dataWords[((Math.ceil((nBitsLeft + 1) / blockSizeBits) * blockSizeBits) >>> 5) - 1] |= 0x80;\n\t data.sigBytes = dataWords.length * 4;\n\n\t // Hash final blocks\n\t this._process();\n\n\t // Shortcuts\n\t var state = this._state;\n\t var outputLengthBytes = this.cfg.outputLength / 8;\n\t var outputLengthLanes = outputLengthBytes / 8;\n\n\t // Squeeze\n\t var hashWords = [];\n\t for (var i = 0; i < outputLengthLanes; i++) {\n\t // Shortcuts\n\t var lane = state[i];\n\t var laneMsw = lane.high;\n\t var laneLsw = lane.low;\n\n\t // Swap endian\n\t laneMsw = (\n\t (((laneMsw << 8) | (laneMsw >>> 24)) & 0x00ff00ff) |\n\t (((laneMsw << 24) | (laneMsw >>> 8)) & 0xff00ff00)\n\t );\n\t laneLsw = (\n\t (((laneLsw << 8) | (laneLsw >>> 24)) & 0x00ff00ff) |\n\t (((laneLsw << 24) | (laneLsw >>> 8)) & 0xff00ff00)\n\t );\n\n\t // Squeeze state to retrieve hash\n\t hashWords.push(laneLsw);\n\t hashWords.push(laneMsw);\n\t }\n\n\t // Return final computed hash\n\t return new WordArray.init(hashWords, outputLengthBytes);\n\t },\n\n\t clone: function () {\n\t var clone = Hasher.clone.call(this);\n\n\t var state = clone._state = this._state.slice(0);\n\t for (var i = 0; i < 25; i++) {\n\t state[i] = state[i].clone();\n\t }\n\n\t return clone;\n\t }\n\t });\n\n\t /**\n\t * Shortcut function to the hasher's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hash = CryptoJS.SHA3('message');\n\t * var hash = CryptoJS.SHA3(wordArray);\n\t */\n\t C.SHA3 = Hasher._createHelper(SHA3);\n\n\t /**\n\t * Shortcut function to the HMAC's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t * @param {WordArray|string} key The secret key.\n\t *\n\t * @return {WordArray} The HMAC.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hmac = CryptoJS.HmacSHA3(message, key);\n\t */\n\t C.HmacSHA3 = Hasher._createHmacHelper(SHA3);\n\t}(Math));\n\n\n\treturn CryptoJS.SHA3;\n\n}));",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function (undefined) {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var Base = C_lib.Base;\n\t var X32WordArray = C_lib.WordArray;\n\n\t /**\n\t * x64 namespace.\n\t */\n\t var C_x64 = C.x64 = {};\n\n\t /**\n\t * A 64-bit word.\n\t */\n\t var X64Word = C_x64.Word = Base.extend({\n\t /**\n\t * Initializes a newly created 64-bit word.\n\t *\n\t * @param {number} high The high 32 bits.\n\t * @param {number} low The low 32 bits.\n\t *\n\t * @example\n\t *\n\t * var x64Word = CryptoJS.x64.Word.create(0x00010203, 0x04050607);\n\t */\n\t init: function (high, low) {\n\t this.high = high;\n\t this.low = low;\n\t }\n\n\t /**\n\t * Bitwise NOTs this word.\n\t *\n\t * @return {X64Word} A new x64-Word object after negating.\n\t *\n\t * @example\n\t *\n\t * var negated = x64Word.not();\n\t */\n\t // not: function () {\n\t // var high = ~this.high;\n\t // var low = ~this.low;\n\n\t // return X64Word.create(high, low);\n\t // },\n\n\t /**\n\t * Bitwise ANDs this word with the passed word.\n\t *\n\t * @param {X64Word} word The x64-Word to AND with this word.\n\t *\n\t * @return {X64Word} A new x64-Word object after ANDing.\n\t *\n\t * @example\n\t *\n\t * var anded = x64Word.and(anotherX64Word);\n\t */\n\t // and: function (word) {\n\t // var high = this.high & word.high;\n\t // var low = this.low & word.low;\n\n\t // return X64Word.create(high, low);\n\t // },\n\n\t /**\n\t * Bitwise ORs this word with the passed word.\n\t *\n\t * @param {X64Word} word The x64-Word to OR with this word.\n\t *\n\t * @return {X64Word} A new x64-Word object after ORing.\n\t *\n\t * @example\n\t *\n\t * var ored = x64Word.or(anotherX64Word);\n\t */\n\t // or: function (word) {\n\t // var high = this.high | word.high;\n\t // var low = this.low | word.low;\n\n\t // return X64Word.create(high, low);\n\t // },\n\n\t /**\n\t * Bitwise XORs this word with the passed word.\n\t *\n\t * @param {X64Word} word The x64-Word to XOR with this word.\n\t *\n\t * @return {X64Word} A new x64-Word object after XORing.\n\t *\n\t * @example\n\t *\n\t * var xored = x64Word.xor(anotherX64Word);\n\t */\n\t // xor: function (word) {\n\t // var high = this.high ^ word.high;\n\t // var low = this.low ^ word.low;\n\n\t // return X64Word.create(high, low);\n\t // },\n\n\t /**\n\t * Shifts this word n bits to the left.\n\t *\n\t * @param {number} n The number of bits to shift.\n\t *\n\t * @return {X64Word} A new x64-Word object after shifting.\n\t *\n\t * @example\n\t *\n\t * var shifted = x64Word.shiftL(25);\n\t */\n\t // shiftL: function (n) {\n\t // if (n < 32) {\n\t // var high = (this.high << n) | (this.low >>> (32 - n));\n\t // var low = this.low << n;\n\t // } else {\n\t // var high = this.low << (n - 32);\n\t // var low = 0;\n\t // }\n\n\t // return X64Word.create(high, low);\n\t // },\n\n\t /**\n\t * Shifts this word n bits to the right.\n\t *\n\t * @param {number} n The number of bits to shift.\n\t *\n\t * @return {X64Word} A new x64-Word object after shifting.\n\t *\n\t * @example\n\t *\n\t * var shifted = x64Word.shiftR(7);\n\t */\n\t // shiftR: function (n) {\n\t // if (n < 32) {\n\t // var low = (this.low >>> n) | (this.high << (32 - n));\n\t // var high = this.high >>> n;\n\t // } else {\n\t // var low = this.high >>> (n - 32);\n\t // var high = 0;\n\t // }\n\n\t // return X64Word.create(high, low);\n\t // },\n\n\t /**\n\t * Rotates this word n bits to the left.\n\t *\n\t * @param {number} n The number of bits to rotate.\n\t *\n\t * @return {X64Word} A new x64-Word object after rotating.\n\t *\n\t * @example\n\t *\n\t * var rotated = x64Word.rotL(25);\n\t */\n\t // rotL: function (n) {\n\t // return this.shiftL(n).or(this.shiftR(64 - n));\n\t // },\n\n\t /**\n\t * Rotates this word n bits to the right.\n\t *\n\t * @param {number} n The number of bits to rotate.\n\t *\n\t * @return {X64Word} A new x64-Word object after rotating.\n\t *\n\t * @example\n\t *\n\t * var rotated = x64Word.rotR(7);\n\t */\n\t // rotR: function (n) {\n\t // return this.shiftR(n).or(this.shiftL(64 - n));\n\t // },\n\n\t /**\n\t * Adds this word with the passed word.\n\t *\n\t * @param {X64Word} word The x64-Word to add with this word.\n\t *\n\t * @return {X64Word} A new x64-Word object after adding.\n\t *\n\t * @example\n\t *\n\t * var added = x64Word.add(anotherX64Word);\n\t */\n\t // add: function (word) {\n\t // var low = (this.low + word.low) | 0;\n\t // var carry = (low >>> 0) < (this.low >>> 0) ? 1 : 0;\n\t // var high = (this.high + word.high + carry) | 0;\n\n\t // return X64Word.create(high, low);\n\t // }\n\t });\n\n\t /**\n\t * An array of 64-bit words.\n\t *\n\t * @property {Array} words The array of CryptoJS.x64.Word objects.\n\t * @property {number} sigBytes The number of significant bytes in this word array.\n\t */\n\t var X64WordArray = C_x64.WordArray = Base.extend({\n\t /**\n\t * Initializes a newly created word array.\n\t *\n\t * @param {Array} words (Optional) An array of CryptoJS.x64.Word objects.\n\t * @param {number} sigBytes (Optional) The number of significant bytes in the words.\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.x64.WordArray.create();\n\t *\n\t * var wordArray = CryptoJS.x64.WordArray.create([\n\t * CryptoJS.x64.Word.create(0x00010203, 0x04050607),\n\t * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)\n\t * ]);\n\t *\n\t * var wordArray = CryptoJS.x64.WordArray.create([\n\t * CryptoJS.x64.Word.create(0x00010203, 0x04050607),\n\t * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)\n\t * ], 10);\n\t */\n\t init: function (words, sigBytes) {\n\t words = this.words = words || [];\n\n\t if (sigBytes != undefined) {\n\t this.sigBytes = sigBytes;\n\t } else {\n\t this.sigBytes = words.length * 8;\n\t }\n\t },\n\n\t /**\n\t * Converts this 64-bit word array to a 32-bit word array.\n\t *\n\t * @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array.\n\t *\n\t * @example\n\t *\n\t * var x32WordArray = x64WordArray.toX32();\n\t */\n\t toX32: function () {\n\t // Shortcuts\n\t var x64Words = this.words;\n\t var x64WordsLength = x64Words.length;\n\n\t // Convert\n\t var x32Words = [];\n\t for (var i = 0; i < x64WordsLength; i++) {\n\t var x64Word = x64Words[i];\n\t x32Words.push(x64Word.high);\n\t x32Words.push(x64Word.low);\n\t }\n\n\t return X32WordArray.create(x32Words, this.sigBytes);\n\t },\n\n\t /**\n\t * Creates a copy of this word array.\n\t *\n\t * @return {X64WordArray} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = x64WordArray.clone();\n\t */\n\t clone: function () {\n\t var clone = Base.clone.call(this);\n\n\t // Clone \"words\" array\n\t var words = clone.words = this.words.slice(0);\n\n\t // Clone each X64Word object\n\t var wordsLength = words.length;\n\t for (var i = 0; i < wordsLength; i++) {\n\t words[i] = words[i].clone();\n\t }\n\n\t return clone;\n\t }\n\t });\n\t}());\n\n\n\treturn CryptoJS;\n\n}));","exports = module.exports = require(\"../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"body {\\n font-family: 'Montserrat', sans-serif;\\n color: #6b7c93;\\n background-color: #f0f1f3;\\n}\\n\\nh1, h2, h3 {\\n font-family: 'Montserrat', sans-serif;\\n}\\n\", \"\"]);\n\n// exports\n","exports = module.exports = require(\"../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \".index__header___1UDpl {\\n display: grid;\\n grid-template-columns: auto auto;\\n grid-column-gap: 20px;\\n -webkit-box-align: center;\\n -ms-flex-align: center;\\n align-items: center;\\n margin: 0 20px;\\n}\\n\\n.index__subtitle___V9mZb {\\n justify-self: center;\\n}\", \"\"]);\n\n// exports\nexports.locals = {\n\t\"header\": \"index__header___1UDpl\",\n\t\"subtitle\": \"index__subtitle___V9mZb\"\n};","exports = module.exports = require(\"../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \".index__page___1Tr0v {\\n margin: 0px 30px;\\n}\", \"\"]);\n\n// exports\nexports.locals = {\n\t\"page\": \"index__page___1Tr0v\"\n};","exports = module.exports = require(\"../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \".index__container___3ytmf {\\n margin: 0px 20px;\\n}\", \"\"]);\n\n// exports\nexports.locals = {\n\t\"container\": \"index__container___3ytmf\"\n};","/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\nmodule.exports = function(useSourceMap) {\n\tvar list = [];\n\n\t// return the list of modules as css string\n\tlist.toString = function toString() {\n\t\treturn this.map(function (item) {\n\t\t\tvar content = cssWithMappingToString(item, useSourceMap);\n\t\t\tif(item[2]) {\n\t\t\t\treturn \"@media \" + item[2] + \"{\" + content + \"}\";\n\t\t\t} else {\n\t\t\t\treturn content;\n\t\t\t}\n\t\t}).join(\"\");\n\t};\n\n\t// import a list of modules into the list\n\tlist.i = function(modules, mediaQuery) {\n\t\tif(typeof modules === \"string\")\n\t\t\tmodules = [[null, modules, \"\"]];\n\t\tvar alreadyImportedModules = {};\n\t\tfor(var i = 0; i < this.length; i++) {\n\t\t\tvar id = this[i][0];\n\t\t\tif(typeof id === \"number\")\n\t\t\t\talreadyImportedModules[id] = true;\n\t\t}\n\t\tfor(i = 0; i < modules.length; i++) {\n\t\t\tvar item = modules[i];\n\t\t\t// skip already imported module\n\t\t\t// this implementation is not 100% perfect for weird media query combinations\n\t\t\t// when a module is imported multiple times with different media queries.\n\t\t\t// I hope this will never occur (Hey this way we have smaller bundles)\n\t\t\tif(typeof item[0] !== \"number\" || !alreadyImportedModules[item[0]]) {\n\t\t\t\tif(mediaQuery && !item[2]) {\n\t\t\t\t\titem[2] = mediaQuery;\n\t\t\t\t} else if(mediaQuery) {\n\t\t\t\t\titem[2] = \"(\" + item[2] + \") and (\" + mediaQuery + \")\";\n\t\t\t\t}\n\t\t\t\tlist.push(item);\n\t\t\t}\n\t\t}\n\t};\n\treturn list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n\tvar content = item[1] || '';\n\tvar cssMapping = item[3];\n\tif (!cssMapping) {\n\t\treturn content;\n\t}\n\n\tif (useSourceMap && typeof btoa === 'function') {\n\t\tvar sourceMapping = toComment(cssMapping);\n\t\tvar sourceURLs = cssMapping.sources.map(function (source) {\n\t\t\treturn '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'\n\t\t});\n\n\t\treturn [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n\t}\n\n\treturn [content].join('\\n');\n}\n\n// Adapted from convert-source-map (MIT)\nfunction toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports['default'] = camelize;\nvar regExp = /[-\\s]+(.)?/g;\n\n/**\n * Convert dash separated strings to camel cased.\n *\n * @param {String} str\n * @return {String}\n */\nfunction camelize(str) {\n return str.replace(regExp, toUpper);\n}\n\nfunction toUpper(match, c) {\n return c ? c.toUpperCase() : '';\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.supportedValue = exports.supportedProperty = exports.prefix = undefined;\n\nvar _prefix = require('./prefix');\n\nvar _prefix2 = _interopRequireDefault(_prefix);\n\nvar _supportedProperty = require('./supported-property');\n\nvar _supportedProperty2 = _interopRequireDefault(_supportedProperty);\n\nvar _supportedValue = require('./supported-value');\n\nvar _supportedValue2 = _interopRequireDefault(_supportedValue);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nexports['default'] = {\n prefix: _prefix2['default'],\n supportedProperty: _supportedProperty2['default'],\n supportedValue: _supportedValue2['default']\n}; /**\n * CSS Vendor prefix detection and property feature testing.\n *\n * @copyright Oleg Slobodskoi 2015\n * @website https://github.com/jsstyles/css-vendor\n * @license MIT\n */\n\nexports.prefix = _prefix2['default'];\nexports.supportedProperty = _supportedProperty2['default'];\nexports.supportedValue = _supportedValue2['default'];","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _isInBrowser = require('is-in-browser');\n\nvar _isInBrowser2 = _interopRequireDefault(_isInBrowser);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar js = ''; /**\n * Export javascript style and css style vendor prefixes.\n * Based on \"transform\" support test.\n */\n\nvar css = '';\n\n// We should not do anything if required serverside.\nif (_isInBrowser2['default']) {\n // Order matters. We need to check Webkit the last one because\n // other vendors use to add Webkit prefixes to some properties\n var jsCssMap = {\n Moz: '-moz-',\n // IE did it wrong again ...\n ms: '-ms-',\n O: '-o-',\n Webkit: '-webkit-'\n };\n var style = document.createElement('p').style;\n var testProp = 'Transform';\n\n for (var key in jsCssMap) {\n if (key + testProp in style) {\n js = key;\n css = jsCssMap[key];\n break;\n }\n }\n}\n\n/**\n * Vendor prefix string for the current browser.\n *\n * @type {{js: String, css: String}}\n * @api public\n */\nexports['default'] = { js: js, css: css };","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports['default'] = supportedProperty;\n\nvar _isInBrowser = require('is-in-browser');\n\nvar _isInBrowser2 = _interopRequireDefault(_isInBrowser);\n\nvar _prefix = require('./prefix');\n\nvar _prefix2 = _interopRequireDefault(_prefix);\n\nvar _camelize = require('./camelize');\n\nvar _camelize2 = _interopRequireDefault(_camelize);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar el = void 0;\nvar cache = {};\n\nif (_isInBrowser2['default']) {\n el = document.createElement('p');\n\n /**\n * We test every property on vendor prefix requirement.\n * Once tested, result is cached. It gives us up to 70% perf boost.\n * http://jsperf.com/element-style-object-access-vs-plain-object\n *\n * Prefill cache with known css properties to reduce amount of\n * properties we need to feature test at runtime.\n * http://davidwalsh.name/vendor-prefix\n */\n var computed = window.getComputedStyle(document.documentElement, '');\n for (var key in computed) {\n if (!isNaN(key)) cache[computed[key]] = computed[key];\n }\n}\n\n/**\n * Test if a property is supported, returns supported property with vendor\n * prefix if required. Returns `false` if not supported.\n *\n * @param {String} prop dash separated\n * @return {String|Boolean}\n * @api public\n */\nfunction supportedProperty(prop) {\n // For server-side rendering.\n if (!el) return prop;\n\n // We have not tested this prop yet, lets do the test.\n if (cache[prop] != null) return cache[prop];\n\n // Camelization is required because we can't test using\n // css syntax for e.g. in FF.\n // Test if property is supported as it is.\n if ((0, _camelize2['default'])(prop) in el.style) {\n cache[prop] = prop;\n }\n // Test if property is supported with vendor prefix.\n else if (_prefix2['default'].js + (0, _camelize2['default'])('-' + prop) in el.style) {\n cache[prop] = _prefix2['default'].css + prop;\n } else {\n cache[prop] = false;\n }\n\n return cache[prop];\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports['default'] = supportedValue;\n\nvar _isInBrowser = require('is-in-browser');\n\nvar _isInBrowser2 = _interopRequireDefault(_isInBrowser);\n\nvar _prefix = require('./prefix');\n\nvar _prefix2 = _interopRequireDefault(_prefix);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar cache = {};\nvar el = void 0;\n\nif (_isInBrowser2['default']) el = document.createElement('p');\n\n/**\n * Returns prefixed value if needed. Returns `false` if value is not supported.\n *\n * @param {String} property\n * @param {String} value\n * @return {String|Boolean}\n * @api public\n */\nfunction supportedValue(property, value) {\n // For server-side rendering.\n if (!el) return value;\n\n // It is a string or a number as a string like '1'.\n // We want only prefixable values here.\n if (typeof value !== 'string' || !isNaN(parseInt(value, 10))) return value;\n\n var cacheKey = property + value;\n\n if (cache[cacheKey] != null) return cache[cacheKey];\n\n // IE can even throw an error in some cases, for e.g. style.content = 'bar'\n try {\n // Test value as it is.\n el.style[property] = value;\n } catch (err) {\n cache[cacheKey] = false;\n return false;\n }\n\n // Value is supported as it is.\n if (el.style[property] !== '') {\n cache[cacheKey] = value;\n } else {\n // Test value with vendor prefix.\n value = _prefix2['default'].css + value;\n\n // Hardcode test to convert \"flex\" to \"-ms-flexbox\" for IE10.\n if (value === '-ms-flex') value = '-ms-flexbox';\n\n el.style[property] = value;\n\n // Value is supported with vendor prefix.\n if (el.style[property] !== '') cache[cacheKey] = value;\n }\n\n if (!cache[cacheKey]) cache[cacheKey] = false;\n\n // Reset style value.\n el.style[property] = '';\n\n return cache[cacheKey];\n}","'use strict';\nvar token = '%[a-f0-9]{2}';\nvar singleMatcher = new RegExp(token, 'gi');\nvar multiMatcher = new RegExp('(' + token + ')+', 'gi');\n\nfunction decodeComponents(components, split) {\n\ttry {\n\t\t// Try to decode the entire string first\n\t\treturn decodeURIComponent(components.join(''));\n\t} catch (err) {\n\t\t// Do nothing\n\t}\n\n\tif (components.length === 1) {\n\t\treturn components;\n\t}\n\n\tsplit = split || 1;\n\n\t// Split the array in 2 parts\n\tvar left = components.slice(0, split);\n\tvar right = components.slice(split);\n\n\treturn Array.prototype.concat.call([], decodeComponents(left), decodeComponents(right));\n}\n\nfunction decode(input) {\n\ttry {\n\t\treturn decodeURIComponent(input);\n\t} catch (err) {\n\t\tvar tokens = input.match(singleMatcher);\n\n\t\tfor (var i = 1; i < tokens.length; i++) {\n\t\t\tinput = decodeComponents(tokens, i).join('');\n\n\t\t\ttokens = input.match(singleMatcher);\n\t\t}\n\n\t\treturn input;\n\t}\n}\n\nfunction customDecodeURIComponent(input) {\n\t// Keep track of all the replacements and prefill the map with the `BOM`\n\tvar replaceMap = {\n\t\t'%FE%FF': '\\uFFFD\\uFFFD',\n\t\t'%FF%FE': '\\uFFFD\\uFFFD'\n\t};\n\n\tvar match = multiMatcher.exec(input);\n\twhile (match) {\n\t\ttry {\n\t\t\t// Decode as big chunks as possible\n\t\t\treplaceMap[match[0]] = decodeURIComponent(match[0]);\n\t\t} catch (err) {\n\t\t\tvar result = decode(match[0]);\n\n\t\t\tif (result !== match[0]) {\n\t\t\t\treplaceMap[match[0]] = result;\n\t\t\t}\n\t\t}\n\n\t\tmatch = multiMatcher.exec(input);\n\t}\n\n\t// Add `%C2` at the end of the map to make sure it does not replace the combinator before everything else\n\treplaceMap['%C2'] = '\\uFFFD';\n\n\tvar entries = Object.keys(replaceMap);\n\n\tfor (var i = 0; i < entries.length; i++) {\n\t\t// Replace all decoded components\n\t\tvar key = entries[i];\n\t\tinput = input.replace(new RegExp(key, 'g'), replaceMap[key]);\n\t}\n\n\treturn input;\n}\n\nmodule.exports = function (encodedURI) {\n\tif (typeof encodedURI !== 'string') {\n\t\tthrow new TypeError('Expected `encodedURI` to be of type `string`, got `' + typeof encodedURI + '`');\n\t}\n\n\ttry {\n\t\tencodedURI = encodedURI.replace(/\\+/g, ' ');\n\n\t\t// Try the built in decoder first\n\t\treturn decodeURIComponent(encodedURI);\n\t} catch (err) {\n\t\t// Fallback to a more advanced decoder\n\t\treturn customDecodeURIComponent(encodedURI);\n\t}\n};\n","var isMergeableObject = function isMergeableObject(value) {\n\treturn isNonNullObject(value)\n\t\t&& !isSpecial(value)\n};\n\nfunction isNonNullObject(value) {\n\treturn !!value && typeof value === 'object'\n}\n\nfunction isSpecial(value) {\n\tvar stringValue = Object.prototype.toString.call(value);\n\n\treturn stringValue === '[object RegExp]'\n\t\t|| stringValue === '[object Date]'\n\t\t|| isReactElement(value)\n}\n\n// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25\nvar canUseSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;\n\nfunction isReactElement(value) {\n\treturn value.$$typeof === REACT_ELEMENT_TYPE\n}\n\nfunction emptyTarget(val) {\n\treturn Array.isArray(val) ? [] : {}\n}\n\nfunction cloneUnlessOtherwiseSpecified(value, optionsArgument) {\n\tvar clone = !optionsArgument || optionsArgument.clone !== false;\n\n\treturn (clone && isMergeableObject(value))\n\t\t? deepmerge(emptyTarget(value), value, optionsArgument)\n\t\t: value\n}\n\nfunction defaultArrayMerge(target, source, optionsArgument) {\n\treturn target.concat(source).map(function(element) {\n\t\treturn cloneUnlessOtherwiseSpecified(element, optionsArgument)\n\t})\n}\n\nfunction mergeObject(target, source, optionsArgument) {\n\tvar destination = {};\n\tif (isMergeableObject(target)) {\n\t\tObject.keys(target).forEach(function(key) {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(target[key], optionsArgument);\n\t\t});\n\t}\n\tObject.keys(source).forEach(function(key) {\n\t\tif (!isMergeableObject(source[key]) || !target[key]) {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(source[key], optionsArgument);\n\t\t} else {\n\t\t\tdestination[key] = deepmerge(target[key], source[key], optionsArgument);\n\t\t}\n\t});\n\treturn destination\n}\n\nfunction deepmerge(target, source, optionsArgument) {\n\tvar sourceIsArray = Array.isArray(source);\n\tvar targetIsArray = Array.isArray(target);\n\tvar options = optionsArgument || { arrayMerge: defaultArrayMerge };\n\tvar sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;\n\n\tif (!sourceAndTargetTypesMatch) {\n\t\treturn cloneUnlessOtherwiseSpecified(source, optionsArgument)\n\t} else if (sourceIsArray) {\n\t\tvar arrayMerge = options.arrayMerge || defaultArrayMerge;\n\t\treturn arrayMerge(target, source, optionsArgument)\n\t} else {\n\t\treturn mergeObject(target, source, optionsArgument)\n\t}\n}\n\ndeepmerge.all = function deepmergeAll(array, optionsArgument) {\n\tif (!Array.isArray(array)) {\n\t\tthrow new Error('first argument should be an array')\n\t}\n\n\treturn array.reduce(function(prev, next) {\n\t\treturn deepmerge(prev, next, optionsArgument)\n\t}, {})\n};\n\nvar deepmerge_1 = deepmerge;\n\nexport default deepmerge_1;\n","'use strict';\n\nexports.utils = require('./des/utils');\nexports.Cipher = require('./des/cipher');\nexports.DES = require('./des/des');\nexports.CBC = require('./des/cbc');\nexports.EDE = require('./des/ede');\n","'use strict';\n\nvar assert = require('minimalistic-assert');\nvar inherits = require('inherits');\n\nvar proto = {};\n\nfunction CBCState(iv) {\n assert.equal(iv.length, 8, 'Invalid IV length');\n\n this.iv = new Array(8);\n for (var i = 0; i < this.iv.length; i++)\n this.iv[i] = iv[i];\n}\n\nfunction instantiate(Base) {\n function CBC(options) {\n Base.call(this, options);\n this._cbcInit();\n }\n inherits(CBC, Base);\n\n var keys = Object.keys(proto);\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n CBC.prototype[key] = proto[key];\n }\n\n CBC.create = function create(options) {\n return new CBC(options);\n };\n\n return CBC;\n}\n\nexports.instantiate = instantiate;\n\nproto._cbcInit = function _cbcInit() {\n var state = new CBCState(this.options.iv);\n this._cbcState = state;\n};\n\nproto._update = function _update(inp, inOff, out, outOff) {\n var state = this._cbcState;\n var superProto = this.constructor.super_.prototype;\n\n var iv = state.iv;\n if (this.type === 'encrypt') {\n for (var i = 0; i < this.blockSize; i++)\n iv[i] ^= inp[inOff + i];\n\n superProto._update.call(this, iv, 0, out, outOff);\n\n for (var i = 0; i < this.blockSize; i++)\n iv[i] = out[outOff + i];\n } else {\n superProto._update.call(this, inp, inOff, out, outOff);\n\n for (var i = 0; i < this.blockSize; i++)\n out[outOff + i] ^= iv[i];\n\n for (var i = 0; i < this.blockSize; i++)\n iv[i] = inp[inOff + i];\n }\n};\n","'use strict';\n\nvar assert = require('minimalistic-assert');\n\nfunction Cipher(options) {\n this.options = options;\n\n this.type = this.options.type;\n this.blockSize = 8;\n this._init();\n\n this.buffer = new Array(this.blockSize);\n this.bufferOff = 0;\n}\nmodule.exports = Cipher;\n\nCipher.prototype._init = function _init() {\n // Might be overrided\n};\n\nCipher.prototype.update = function update(data) {\n if (data.length === 0)\n return [];\n\n if (this.type === 'decrypt')\n return this._updateDecrypt(data);\n else\n return this._updateEncrypt(data);\n};\n\nCipher.prototype._buffer = function _buffer(data, off) {\n // Append data to buffer\n var min = Math.min(this.buffer.length - this.bufferOff, data.length - off);\n for (var i = 0; i < min; i++)\n this.buffer[this.bufferOff + i] = data[off + i];\n this.bufferOff += min;\n\n // Shift next\n return min;\n};\n\nCipher.prototype._flushBuffer = function _flushBuffer(out, off) {\n this._update(this.buffer, 0, out, off);\n this.bufferOff = 0;\n return this.blockSize;\n};\n\nCipher.prototype._updateEncrypt = function _updateEncrypt(data) {\n var inputOff = 0;\n var outputOff = 0;\n\n var count = ((this.bufferOff + data.length) / this.blockSize) | 0;\n var out = new Array(count * this.blockSize);\n\n if (this.bufferOff !== 0) {\n inputOff += this._buffer(data, inputOff);\n\n if (this.bufferOff === this.buffer.length)\n outputOff += this._flushBuffer(out, outputOff);\n }\n\n // Write blocks\n var max = data.length - ((data.length - inputOff) % this.blockSize);\n for (; inputOff < max; inputOff += this.blockSize) {\n this._update(data, inputOff, out, outputOff);\n outputOff += this.blockSize;\n }\n\n // Queue rest\n for (; inputOff < data.length; inputOff++, this.bufferOff++)\n this.buffer[this.bufferOff] = data[inputOff];\n\n return out;\n};\n\nCipher.prototype._updateDecrypt = function _updateDecrypt(data) {\n var inputOff = 0;\n var outputOff = 0;\n\n var count = Math.ceil((this.bufferOff + data.length) / this.blockSize) - 1;\n var out = new Array(count * this.blockSize);\n\n // TODO(indutny): optimize it, this is far from optimal\n for (; count > 0; count--) {\n inputOff += this._buffer(data, inputOff);\n outputOff += this._flushBuffer(out, outputOff);\n }\n\n // Buffer rest of the input\n inputOff += this._buffer(data, inputOff);\n\n return out;\n};\n\nCipher.prototype.final = function final(buffer) {\n var first;\n if (buffer)\n first = this.update(buffer);\n\n var last;\n if (this.type === 'encrypt')\n last = this._finalEncrypt();\n else\n last = this._finalDecrypt();\n\n if (first)\n return first.concat(last);\n else\n return last;\n};\n\nCipher.prototype._pad = function _pad(buffer, off) {\n if (off === 0)\n return false;\n\n while (off < buffer.length)\n buffer[off++] = 0;\n\n return true;\n};\n\nCipher.prototype._finalEncrypt = function _finalEncrypt() {\n if (!this._pad(this.buffer, this.bufferOff))\n return [];\n\n var out = new Array(this.blockSize);\n this._update(this.buffer, 0, out, 0);\n return out;\n};\n\nCipher.prototype._unpad = function _unpad(buffer) {\n return buffer;\n};\n\nCipher.prototype._finalDecrypt = function _finalDecrypt() {\n assert.equal(this.bufferOff, this.blockSize, 'Not enough data to decrypt');\n var out = new Array(this.blockSize);\n this._flushBuffer(out, 0);\n\n return this._unpad(out);\n};\n","'use strict';\n\nvar assert = require('minimalistic-assert');\nvar inherits = require('inherits');\n\nvar des = require('../des');\nvar utils = des.utils;\nvar Cipher = des.Cipher;\n\nfunction DESState() {\n this.tmp = new Array(2);\n this.keys = null;\n}\n\nfunction DES(options) {\n Cipher.call(this, options);\n\n var state = new DESState();\n this._desState = state;\n\n this.deriveKeys(state, options.key);\n}\ninherits(DES, Cipher);\nmodule.exports = DES;\n\nDES.create = function create(options) {\n return new DES(options);\n};\n\nvar shiftTable = [\n 1, 1, 2, 2, 2, 2, 2, 2,\n 1, 2, 2, 2, 2, 2, 2, 1\n];\n\nDES.prototype.deriveKeys = function deriveKeys(state, key) {\n state.keys = new Array(16 * 2);\n\n assert.equal(key.length, this.blockSize, 'Invalid key length');\n\n var kL = utils.readUInt32BE(key, 0);\n var kR = utils.readUInt32BE(key, 4);\n\n utils.pc1(kL, kR, state.tmp, 0);\n kL = state.tmp[0];\n kR = state.tmp[1];\n for (var i = 0; i < state.keys.length; i += 2) {\n var shift = shiftTable[i >>> 1];\n kL = utils.r28shl(kL, shift);\n kR = utils.r28shl(kR, shift);\n utils.pc2(kL, kR, state.keys, i);\n }\n};\n\nDES.prototype._update = function _update(inp, inOff, out, outOff) {\n var state = this._desState;\n\n var l = utils.readUInt32BE(inp, inOff);\n var r = utils.readUInt32BE(inp, inOff + 4);\n\n // Initial Permutation\n utils.ip(l, r, state.tmp, 0);\n l = state.tmp[0];\n r = state.tmp[1];\n\n if (this.type === 'encrypt')\n this._encrypt(state, l, r, state.tmp, 0);\n else\n this._decrypt(state, l, r, state.tmp, 0);\n\n l = state.tmp[0];\n r = state.tmp[1];\n\n utils.writeUInt32BE(out, l, outOff);\n utils.writeUInt32BE(out, r, outOff + 4);\n};\n\nDES.prototype._pad = function _pad(buffer, off) {\n var value = buffer.length - off;\n for (var i = off; i < buffer.length; i++)\n buffer[i] = value;\n\n return true;\n};\n\nDES.prototype._unpad = function _unpad(buffer) {\n var pad = buffer[buffer.length - 1];\n for (var i = buffer.length - pad; i < buffer.length; i++)\n assert.equal(buffer[i], pad);\n\n return buffer.slice(0, buffer.length - pad);\n};\n\nDES.prototype._encrypt = function _encrypt(state, lStart, rStart, out, off) {\n var l = lStart;\n var r = rStart;\n\n // Apply f() x16 times\n for (var i = 0; i < state.keys.length; i += 2) {\n var keyL = state.keys[i];\n var keyR = state.keys[i + 1];\n\n // f(r, k)\n utils.expand(r, state.tmp, 0);\n\n keyL ^= state.tmp[0];\n keyR ^= state.tmp[1];\n var s = utils.substitute(keyL, keyR);\n var f = utils.permute(s);\n\n var t = r;\n r = (l ^ f) >>> 0;\n l = t;\n }\n\n // Reverse Initial Permutation\n utils.rip(r, l, out, off);\n};\n\nDES.prototype._decrypt = function _decrypt(state, lStart, rStart, out, off) {\n var l = rStart;\n var r = lStart;\n\n // Apply f() x16 times\n for (var i = state.keys.length - 2; i >= 0; i -= 2) {\n var keyL = state.keys[i];\n var keyR = state.keys[i + 1];\n\n // f(r, k)\n utils.expand(l, state.tmp, 0);\n\n keyL ^= state.tmp[0];\n keyR ^= state.tmp[1];\n var s = utils.substitute(keyL, keyR);\n var f = utils.permute(s);\n\n var t = l;\n l = (r ^ f) >>> 0;\n r = t;\n }\n\n // Reverse Initial Permutation\n utils.rip(l, r, out, off);\n};\n","'use strict';\n\nvar assert = require('minimalistic-assert');\nvar inherits = require('inherits');\n\nvar des = require('../des');\nvar Cipher = des.Cipher;\nvar DES = des.DES;\n\nfunction EDEState(type, key) {\n assert.equal(key.length, 24, 'Invalid key length');\n\n var k1 = key.slice(0, 8);\n var k2 = key.slice(8, 16);\n var k3 = key.slice(16, 24);\n\n if (type === 'encrypt') {\n this.ciphers = [\n DES.create({ type: 'encrypt', key: k1 }),\n DES.create({ type: 'decrypt', key: k2 }),\n DES.create({ type: 'encrypt', key: k3 })\n ];\n } else {\n this.ciphers = [\n DES.create({ type: 'decrypt', key: k3 }),\n DES.create({ type: 'encrypt', key: k2 }),\n DES.create({ type: 'decrypt', key: k1 })\n ];\n }\n}\n\nfunction EDE(options) {\n Cipher.call(this, options);\n\n var state = new EDEState(this.type, this.options.key);\n this._edeState = state;\n}\ninherits(EDE, Cipher);\n\nmodule.exports = EDE;\n\nEDE.create = function create(options) {\n return new EDE(options);\n};\n\nEDE.prototype._update = function _update(inp, inOff, out, outOff) {\n var state = this._edeState;\n\n state.ciphers[0]._update(inp, inOff, out, outOff);\n state.ciphers[1]._update(out, outOff, out, outOff);\n state.ciphers[2]._update(out, outOff, out, outOff);\n};\n\nEDE.prototype._pad = DES.prototype._pad;\nEDE.prototype._unpad = DES.prototype._unpad;\n","'use strict';\n\nexports.readUInt32BE = function readUInt32BE(bytes, off) {\n var res = (bytes[0 + off] << 24) |\n (bytes[1 + off] << 16) |\n (bytes[2 + off] << 8) |\n bytes[3 + off];\n return res >>> 0;\n};\n\nexports.writeUInt32BE = function writeUInt32BE(bytes, value, off) {\n bytes[0 + off] = value >>> 24;\n bytes[1 + off] = (value >>> 16) & 0xff;\n bytes[2 + off] = (value >>> 8) & 0xff;\n bytes[3 + off] = value & 0xff;\n};\n\nexports.ip = function ip(inL, inR, out, off) {\n var outL = 0;\n var outR = 0;\n\n for (var i = 6; i >= 0; i -= 2) {\n for (var j = 0; j <= 24; j += 8) {\n outL <<= 1;\n outL |= (inR >>> (j + i)) & 1;\n }\n for (var j = 0; j <= 24; j += 8) {\n outL <<= 1;\n outL |= (inL >>> (j + i)) & 1;\n }\n }\n\n for (var i = 6; i >= 0; i -= 2) {\n for (var j = 1; j <= 25; j += 8) {\n outR <<= 1;\n outR |= (inR >>> (j + i)) & 1;\n }\n for (var j = 1; j <= 25; j += 8) {\n outR <<= 1;\n outR |= (inL >>> (j + i)) & 1;\n }\n }\n\n out[off + 0] = outL >>> 0;\n out[off + 1] = outR >>> 0;\n};\n\nexports.rip = function rip(inL, inR, out, off) {\n var outL = 0;\n var outR = 0;\n\n for (var i = 0; i < 4; i++) {\n for (var j = 24; j >= 0; j -= 8) {\n outL <<= 1;\n outL |= (inR >>> (j + i)) & 1;\n outL <<= 1;\n outL |= (inL >>> (j + i)) & 1;\n }\n }\n for (var i = 4; i < 8; i++) {\n for (var j = 24; j >= 0; j -= 8) {\n outR <<= 1;\n outR |= (inR >>> (j + i)) & 1;\n outR <<= 1;\n outR |= (inL >>> (j + i)) & 1;\n }\n }\n\n out[off + 0] = outL >>> 0;\n out[off + 1] = outR >>> 0;\n};\n\nexports.pc1 = function pc1(inL, inR, out, off) {\n var outL = 0;\n var outR = 0;\n\n // 7, 15, 23, 31, 39, 47, 55, 63\n // 6, 14, 22, 30, 39, 47, 55, 63\n // 5, 13, 21, 29, 39, 47, 55, 63\n // 4, 12, 20, 28\n for (var i = 7; i >= 5; i--) {\n for (var j = 0; j <= 24; j += 8) {\n outL <<= 1;\n outL |= (inR >> (j + i)) & 1;\n }\n for (var j = 0; j <= 24; j += 8) {\n outL <<= 1;\n outL |= (inL >> (j + i)) & 1;\n }\n }\n for (var j = 0; j <= 24; j += 8) {\n outL <<= 1;\n outL |= (inR >> (j + i)) & 1;\n }\n\n // 1, 9, 17, 25, 33, 41, 49, 57\n // 2, 10, 18, 26, 34, 42, 50, 58\n // 3, 11, 19, 27, 35, 43, 51, 59\n // 36, 44, 52, 60\n for (var i = 1; i <= 3; i++) {\n for (var j = 0; j <= 24; j += 8) {\n outR <<= 1;\n outR |= (inR >> (j + i)) & 1;\n }\n for (var j = 0; j <= 24; j += 8) {\n outR <<= 1;\n outR |= (inL >> (j + i)) & 1;\n }\n }\n for (var j = 0; j <= 24; j += 8) {\n outR <<= 1;\n outR |= (inL >> (j + i)) & 1;\n }\n\n out[off + 0] = outL >>> 0;\n out[off + 1] = outR >>> 0;\n};\n\nexports.r28shl = function r28shl(num, shift) {\n return ((num << shift) & 0xfffffff) | (num >>> (28 - shift));\n};\n\nvar pc2table = [\n // inL => outL\n 14, 11, 17, 4, 27, 23, 25, 0,\n 13, 22, 7, 18, 5, 9, 16, 24,\n 2, 20, 12, 21, 1, 8, 15, 26,\n\n // inR => outR\n 15, 4, 25, 19, 9, 1, 26, 16,\n 5, 11, 23, 8, 12, 7, 17, 0,\n 22, 3, 10, 14, 6, 20, 27, 24\n];\n\nexports.pc2 = function pc2(inL, inR, out, off) {\n var outL = 0;\n var outR = 0;\n\n var len = pc2table.length >>> 1;\n for (var i = 0; i < len; i++) {\n outL <<= 1;\n outL |= (inL >>> pc2table[i]) & 0x1;\n }\n for (var i = len; i < pc2table.length; i++) {\n outR <<= 1;\n outR |= (inR >>> pc2table[i]) & 0x1;\n }\n\n out[off + 0] = outL >>> 0;\n out[off + 1] = outR >>> 0;\n};\n\nexports.expand = function expand(r, out, off) {\n var outL = 0;\n var outR = 0;\n\n outL = ((r & 1) << 5) | (r >>> 27);\n for (var i = 23; i >= 15; i -= 4) {\n outL <<= 6;\n outL |= (r >>> i) & 0x3f;\n }\n for (var i = 11; i >= 3; i -= 4) {\n outR |= (r >>> i) & 0x3f;\n outR <<= 6;\n }\n outR |= ((r & 0x1f) << 1) | (r >>> 31);\n\n out[off + 0] = outL >>> 0;\n out[off + 1] = outR >>> 0;\n};\n\nvar sTable = [\n 14, 0, 4, 15, 13, 7, 1, 4, 2, 14, 15, 2, 11, 13, 8, 1,\n 3, 10, 10, 6, 6, 12, 12, 11, 5, 9, 9, 5, 0, 3, 7, 8,\n 4, 15, 1, 12, 14, 8, 8, 2, 13, 4, 6, 9, 2, 1, 11, 7,\n 15, 5, 12, 11, 9, 3, 7, 14, 3, 10, 10, 0, 5, 6, 0, 13,\n\n 15, 3, 1, 13, 8, 4, 14, 7, 6, 15, 11, 2, 3, 8, 4, 14,\n 9, 12, 7, 0, 2, 1, 13, 10, 12, 6, 0, 9, 5, 11, 10, 5,\n 0, 13, 14, 8, 7, 10, 11, 1, 10, 3, 4, 15, 13, 4, 1, 2,\n 5, 11, 8, 6, 12, 7, 6, 12, 9, 0, 3, 5, 2, 14, 15, 9,\n\n 10, 13, 0, 7, 9, 0, 14, 9, 6, 3, 3, 4, 15, 6, 5, 10,\n 1, 2, 13, 8, 12, 5, 7, 14, 11, 12, 4, 11, 2, 15, 8, 1,\n 13, 1, 6, 10, 4, 13, 9, 0, 8, 6, 15, 9, 3, 8, 0, 7,\n 11, 4, 1, 15, 2, 14, 12, 3, 5, 11, 10, 5, 14, 2, 7, 12,\n\n 7, 13, 13, 8, 14, 11, 3, 5, 0, 6, 6, 15, 9, 0, 10, 3,\n 1, 4, 2, 7, 8, 2, 5, 12, 11, 1, 12, 10, 4, 14, 15, 9,\n 10, 3, 6, 15, 9, 0, 0, 6, 12, 10, 11, 1, 7, 13, 13, 8,\n 15, 9, 1, 4, 3, 5, 14, 11, 5, 12, 2, 7, 8, 2, 4, 14,\n\n 2, 14, 12, 11, 4, 2, 1, 12, 7, 4, 10, 7, 11, 13, 6, 1,\n 8, 5, 5, 0, 3, 15, 15, 10, 13, 3, 0, 9, 14, 8, 9, 6,\n 4, 11, 2, 8, 1, 12, 11, 7, 10, 1, 13, 14, 7, 2, 8, 13,\n 15, 6, 9, 15, 12, 0, 5, 9, 6, 10, 3, 4, 0, 5, 14, 3,\n\n 12, 10, 1, 15, 10, 4, 15, 2, 9, 7, 2, 12, 6, 9, 8, 5,\n 0, 6, 13, 1, 3, 13, 4, 14, 14, 0, 7, 11, 5, 3, 11, 8,\n 9, 4, 14, 3, 15, 2, 5, 12, 2, 9, 8, 5, 12, 15, 3, 10,\n 7, 11, 0, 14, 4, 1, 10, 7, 1, 6, 13, 0, 11, 8, 6, 13,\n\n 4, 13, 11, 0, 2, 11, 14, 7, 15, 4, 0, 9, 8, 1, 13, 10,\n 3, 14, 12, 3, 9, 5, 7, 12, 5, 2, 10, 15, 6, 8, 1, 6,\n 1, 6, 4, 11, 11, 13, 13, 8, 12, 1, 3, 4, 7, 10, 14, 7,\n 10, 9, 15, 5, 6, 0, 8, 15, 0, 14, 5, 2, 9, 3, 2, 12,\n\n 13, 1, 2, 15, 8, 13, 4, 8, 6, 10, 15, 3, 11, 7, 1, 4,\n 10, 12, 9, 5, 3, 6, 14, 11, 5, 0, 0, 14, 12, 9, 7, 2,\n 7, 2, 11, 1, 4, 14, 1, 7, 9, 4, 12, 10, 14, 8, 2, 13,\n 0, 15, 6, 12, 10, 9, 13, 0, 15, 3, 3, 5, 5, 6, 8, 11\n];\n\nexports.substitute = function substitute(inL, inR) {\n var out = 0;\n for (var i = 0; i < 4; i++) {\n var b = (inL >>> (18 - i * 6)) & 0x3f;\n var sb = sTable[i * 0x40 + b];\n\n out <<= 4;\n out |= sb;\n }\n for (var i = 0; i < 4; i++) {\n var b = (inR >>> (18 - i * 6)) & 0x3f;\n var sb = sTable[4 * 0x40 + i * 0x40 + b];\n\n out <<= 4;\n out |= sb;\n }\n return out >>> 0;\n};\n\nvar permuteTable = [\n 16, 25, 12, 11, 3, 20, 4, 15, 31, 17, 9, 6, 27, 14, 1, 22,\n 30, 24, 8, 18, 0, 5, 29, 23, 13, 19, 2, 26, 10, 21, 28, 7\n];\n\nexports.permute = function permute(num) {\n var out = 0;\n for (var i = 0; i < permuteTable.length; i++) {\n out <<= 1;\n out |= (num >>> permuteTable[i]) & 0x1;\n }\n return out >>> 0;\n};\n\nexports.padSplit = function padSplit(num, size, group) {\n var str = num.toString(2);\n while (str.length < size)\n str = '0' + str;\n\n var out = [];\n for (var i = 0; i < size; i += group)\n out.push(str.slice(i, i + group));\n return out.join(' ');\n};\n","var generatePrime = require('./lib/generatePrime')\nvar primes = require('./lib/primes.json')\n\nvar DH = require('./lib/dh')\n\nfunction getDiffieHellman (mod) {\n var prime = new Buffer(primes[mod].prime, 'hex')\n var gen = new Buffer(primes[mod].gen, 'hex')\n\n return new DH(prime, gen)\n}\n\nvar ENCODINGS = {\n 'binary': true, 'hex': true, 'base64': true\n}\n\nfunction createDiffieHellman (prime, enc, generator, genc) {\n if (Buffer.isBuffer(enc) || ENCODINGS[enc] === undefined) {\n return createDiffieHellman(prime, 'binary', enc, generator)\n }\n\n enc = enc || 'binary'\n genc = genc || 'binary'\n generator = generator || new Buffer([2])\n\n if (!Buffer.isBuffer(generator)) {\n generator = new Buffer(generator, genc)\n }\n\n if (typeof prime === 'number') {\n return new DH(generatePrime(prime, generator), generator, true)\n }\n\n if (!Buffer.isBuffer(prime)) {\n prime = new Buffer(prime, enc)\n }\n\n return new DH(prime, generator, true)\n}\n\nexports.DiffieHellmanGroup = exports.createDiffieHellmanGroup = exports.getDiffieHellman = getDiffieHellman\nexports.createDiffieHellman = exports.DiffieHellman = createDiffieHellman\n","var BN = require('bn.js');\nvar MillerRabin = require('miller-rabin');\nvar millerRabin = new MillerRabin();\nvar TWENTYFOUR = new BN(24);\nvar ELEVEN = new BN(11);\nvar TEN = new BN(10);\nvar THREE = new BN(3);\nvar SEVEN = new BN(7);\nvar primes = require('./generatePrime');\nvar randomBytes = require('randombytes');\nmodule.exports = DH;\n\nfunction setPublicKey(pub, enc) {\n enc = enc || 'utf8';\n if (!Buffer.isBuffer(pub)) {\n pub = new Buffer(pub, enc);\n }\n this._pub = new BN(pub);\n return this;\n}\n\nfunction setPrivateKey(priv, enc) {\n enc = enc || 'utf8';\n if (!Buffer.isBuffer(priv)) {\n priv = new Buffer(priv, enc);\n }\n this._priv = new BN(priv);\n return this;\n}\n\nvar primeCache = {};\nfunction checkPrime(prime, generator) {\n var gen = generator.toString('hex');\n var hex = [gen, prime.toString(16)].join('_');\n if (hex in primeCache) {\n return primeCache[hex];\n }\n var error = 0;\n\n if (prime.isEven() ||\n !primes.simpleSieve ||\n !primes.fermatTest(prime) ||\n !millerRabin.test(prime)) {\n //not a prime so +1\n error += 1;\n\n if (gen === '02' || gen === '05') {\n // we'd be able to check the generator\n // it would fail so +8\n error += 8;\n } else {\n //we wouldn't be able to test the generator\n // so +4\n error += 4;\n }\n primeCache[hex] = error;\n return error;\n }\n if (!millerRabin.test(prime.shrn(1))) {\n //not a safe prime\n error += 2;\n }\n var rem;\n switch (gen) {\n case '02':\n if (prime.mod(TWENTYFOUR).cmp(ELEVEN)) {\n // unsuidable generator\n error += 8;\n }\n break;\n case '05':\n rem = prime.mod(TEN);\n if (rem.cmp(THREE) && rem.cmp(SEVEN)) {\n // prime mod 10 needs to equal 3 or 7\n error += 8;\n }\n break;\n default:\n error += 4;\n }\n primeCache[hex] = error;\n return error;\n}\n\nfunction DH(prime, generator, malleable) {\n this.setGenerator(generator);\n this.__prime = new BN(prime);\n this._prime = BN.mont(this.__prime);\n this._primeLen = prime.length;\n this._pub = undefined;\n this._priv = undefined;\n this._primeCode = undefined;\n if (malleable) {\n this.setPublicKey = setPublicKey;\n this.setPrivateKey = setPrivateKey;\n } else {\n this._primeCode = 8;\n }\n}\nObject.defineProperty(DH.prototype, 'verifyError', {\n enumerable: true,\n get: function () {\n if (typeof this._primeCode !== 'number') {\n this._primeCode = checkPrime(this.__prime, this.__gen);\n }\n return this._primeCode;\n }\n});\nDH.prototype.generateKeys = function () {\n if (!this._priv) {\n this._priv = new BN(randomBytes(this._primeLen));\n }\n this._pub = this._gen.toRed(this._prime).redPow(this._priv).fromRed();\n return this.getPublicKey();\n};\n\nDH.prototype.computeSecret = function (other) {\n other = new BN(other);\n other = other.toRed(this._prime);\n var secret = other.redPow(this._priv).fromRed();\n var out = new Buffer(secret.toArray());\n var prime = this.getPrime();\n if (out.length < prime.length) {\n var front = new Buffer(prime.length - out.length);\n front.fill(0);\n out = Buffer.concat([front, out]);\n }\n return out;\n};\n\nDH.prototype.getPublicKey = function getPublicKey(enc) {\n return formatReturnValue(this._pub, enc);\n};\n\nDH.prototype.getPrivateKey = function getPrivateKey(enc) {\n return formatReturnValue(this._priv, enc);\n};\n\nDH.prototype.getPrime = function (enc) {\n return formatReturnValue(this.__prime, enc);\n};\n\nDH.prototype.getGenerator = function (enc) {\n return formatReturnValue(this._gen, enc);\n};\n\nDH.prototype.setGenerator = function (gen, enc) {\n enc = enc || 'utf8';\n if (!Buffer.isBuffer(gen)) {\n gen = new Buffer(gen, enc);\n }\n this.__gen = gen;\n this._gen = new BN(gen);\n return this;\n};\n\nfunction formatReturnValue(bn, enc) {\n var buf = new Buffer(bn.toArray());\n if (!enc) {\n return buf;\n } else {\n return buf.toString(enc);\n }\n}\n","var randomBytes = require('randombytes');\nmodule.exports = findPrime;\nfindPrime.simpleSieve = simpleSieve;\nfindPrime.fermatTest = fermatTest;\nvar BN = require('bn.js');\nvar TWENTYFOUR = new BN(24);\nvar MillerRabin = require('miller-rabin');\nvar millerRabin = new MillerRabin();\nvar ONE = new BN(1);\nvar TWO = new BN(2);\nvar FIVE = new BN(5);\nvar SIXTEEN = new BN(16);\nvar EIGHT = new BN(8);\nvar TEN = new BN(10);\nvar THREE = new BN(3);\nvar SEVEN = new BN(7);\nvar ELEVEN = new BN(11);\nvar FOUR = new BN(4);\nvar TWELVE = new BN(12);\nvar primes = null;\n\nfunction _getPrimes() {\n if (primes !== null)\n return primes;\n\n var limit = 0x100000;\n var res = [];\n res[0] = 2;\n for (var i = 1, k = 3; k < limit; k += 2) {\n var sqrt = Math.ceil(Math.sqrt(k));\n for (var j = 0; j < i && res[j] <= sqrt; j++)\n if (k % res[j] === 0)\n break;\n\n if (i !== j && res[j] <= sqrt)\n continue;\n\n res[i++] = k;\n }\n primes = res;\n return res;\n}\n\nfunction simpleSieve(p) {\n var primes = _getPrimes();\n\n for (var i = 0; i < primes.length; i++)\n if (p.modn(primes[i]) === 0) {\n if (p.cmpn(primes[i]) === 0) {\n return true;\n } else {\n return false;\n }\n }\n\n return true;\n}\n\nfunction fermatTest(p) {\n var red = BN.mont(p);\n return TWO.toRed(red).redPow(p.subn(1)).fromRed().cmpn(1) === 0;\n}\n\nfunction findPrime(bits, gen) {\n if (bits < 16) {\n // this is what openssl does\n if (gen === 2 || gen === 5) {\n return new BN([0x8c, 0x7b]);\n } else {\n return new BN([0x8c, 0x27]);\n }\n }\n gen = new BN(gen);\n\n var num, n2;\n\n while (true) {\n num = new BN(randomBytes(Math.ceil(bits / 8)));\n while (num.bitLength() > bits) {\n num.ishrn(1);\n }\n if (num.isEven()) {\n num.iadd(ONE);\n }\n if (!num.testn(1)) {\n num.iadd(TWO);\n }\n if (!gen.cmp(TWO)) {\n while (num.mod(TWENTYFOUR).cmp(ELEVEN)) {\n num.iadd(FOUR);\n }\n } else if (!gen.cmp(FIVE)) {\n while (num.mod(TEN).cmp(THREE)) {\n num.iadd(FOUR);\n }\n }\n n2 = num.shrn(1);\n if (simpleSieve(n2) && simpleSieve(num) &&\n fermatTest(n2) && fermatTest(num) &&\n millerRabin.test(n2) && millerRabin.test(num)) {\n return num;\n }\n }\n\n}\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = activeElement;\n\nvar _ownerDocument = require('./ownerDocument');\n\nvar _ownerDocument2 = _interopRequireDefault(_ownerDocument);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction activeElement() {\n var doc = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : (0, _ownerDocument2.default)();\n\n try {\n return doc.activeElement;\n } catch (e) {/* ie throws if no active element */}\n}\nmodule.exports = exports['default'];","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = ownerDocument;\nfunction ownerDocument(node) {\n return node && node.ownerDocument || document;\n}\nmodule.exports = exports[\"default\"];","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = ownerWindow;\n\nvar _ownerDocument = require('./ownerDocument');\n\nvar _ownerDocument2 = _interopRequireDefault(_ownerDocument);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction ownerWindow(node) {\n var doc = (0, _ownerDocument2.default)(node);\n return doc && doc.defaultView || doc.parentWindow;\n}\nmodule.exports = exports['default'];","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _inDOM = require('../util/inDOM');\n\nvar _inDOM2 = _interopRequireDefault(_inDOM);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function () {\n // HTML DOM and SVG DOM may have different support levels,\n // so we need to check on context instead of a document root element.\n return _inDOM2.default ? function (context, node) {\n if (context.contains) {\n return context.contains(node);\n } else if (context.compareDocumentPosition) {\n return context === node || !!(context.compareDocumentPosition(node) & 16);\n } else {\n return fallback(context, node);\n }\n } : fallback;\n}();\n\nfunction fallback(context, node) {\n if (node) do {\n if (node === context) return true;\n } while (node = node.parentNode);\n\n return false;\n}\nmodule.exports = exports['default'];","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = getWindow;\nfunction getWindow(node) {\n return node === node.window ? node : node.nodeType === 9 ? node.defaultView || node.parentWindow : false;\n}\nmodule.exports = exports[\"default\"];","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _getComputedStyle;\n\nvar _camelizeStyle = require('../util/camelizeStyle');\n\nvar _camelizeStyle2 = _interopRequireDefault(_camelizeStyle);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar rposition = /^(top|right|bottom|left)$/;\nvar rnumnonpx = /^([+-]?(?:\\d*\\.|)\\d+(?:[eE][+-]?\\d+|))(?!px)[a-z%]+$/i;\n\nfunction _getComputedStyle(node) {\n if (!node) throw new TypeError('No Element passed to `getComputedStyle()`');\n var doc = node.ownerDocument;\n\n return 'defaultView' in doc ? doc.defaultView.opener ? node.ownerDocument.defaultView.getComputedStyle(node, null) : window.getComputedStyle(node, null) : {\n //ie 8 \"magic\" from: https://github.com/jquery/jquery/blob/1.11-stable/src/css/curCSS.js#L72\n getPropertyValue: function getPropertyValue(prop) {\n var style = node.style;\n\n prop = (0, _camelizeStyle2.default)(prop);\n\n if (prop == 'float') prop = 'styleFloat';\n\n var current = node.currentStyle[prop] || null;\n\n if (current == null && style && style[prop]) current = style[prop];\n\n if (rnumnonpx.test(current) && !rposition.test(prop)) {\n // Remember the original values\n var left = style.left;\n var runStyle = node.runtimeStyle;\n var rsLeft = runStyle && runStyle.left;\n\n // Put in the new values to get a computed value out\n if (rsLeft) runStyle.left = node.currentStyle.left;\n\n style.left = prop === 'fontSize' ? '1em' : current;\n current = style.pixelLeft + 'px';\n\n // Revert the changed values\n style.left = left;\n if (rsLeft) runStyle.left = rsLeft;\n }\n\n return current;\n }\n };\n}\nmodule.exports = exports['default'];","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = style;\n\nvar _camelizeStyle = require('../util/camelizeStyle');\n\nvar _camelizeStyle2 = _interopRequireDefault(_camelizeStyle);\n\nvar _hyphenateStyle = require('../util/hyphenateStyle');\n\nvar _hyphenateStyle2 = _interopRequireDefault(_hyphenateStyle);\n\nvar _getComputedStyle2 = require('./getComputedStyle');\n\nvar _getComputedStyle3 = _interopRequireDefault(_getComputedStyle2);\n\nvar _removeStyle = require('./removeStyle');\n\nvar _removeStyle2 = _interopRequireDefault(_removeStyle);\n\nvar _properties = require('../transition/properties');\n\nvar _isTransform = require('../transition/isTransform');\n\nvar _isTransform2 = _interopRequireDefault(_isTransform);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction style(node, property, value) {\n var css = '';\n var transforms = '';\n var props = property;\n\n if (typeof property === 'string') {\n if (value === undefined) {\n return node.style[(0, _camelizeStyle2.default)(property)] || (0, _getComputedStyle3.default)(node).getPropertyValue((0, _hyphenateStyle2.default)(property));\n } else {\n (props = {})[property] = value;\n }\n }\n\n Object.keys(props).forEach(function (key) {\n var value = props[key];\n if (!value && value !== 0) {\n (0, _removeStyle2.default)(node, (0, _hyphenateStyle2.default)(key));\n } else if ((0, _isTransform2.default)(key)) {\n transforms += key + '(' + value + ') ';\n } else {\n css += (0, _hyphenateStyle2.default)(key) + ': ' + value + ';';\n }\n });\n\n if (transforms) {\n css += _properties.transform + ': ' + transforms + ';';\n }\n\n node.style.cssText += ';' + css;\n}\nmodule.exports = exports['default'];","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = removeStyle;\nfunction removeStyle(node, key) {\n return 'removeProperty' in node.style ? node.style.removeProperty(key) : node.style.removeAttribute(key);\n}\nmodule.exports = exports['default'];","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isTransform;\nvar supportedTransforms = /^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;\n\nfunction isTransform(property) {\n return !!(property && supportedTransforms.test(property));\n}\nmodule.exports = exports[\"default\"];","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.animationEnd = exports.animationDelay = exports.animationTiming = exports.animationDuration = exports.animationName = exports.transitionEnd = exports.transitionDuration = exports.transitionDelay = exports.transitionTiming = exports.transitionProperty = exports.transform = undefined;\n\nvar _inDOM = require('../util/inDOM');\n\nvar _inDOM2 = _interopRequireDefault(_inDOM);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar transform = 'transform';\nvar prefix = void 0,\n transitionEnd = void 0,\n animationEnd = void 0;\nvar transitionProperty = void 0,\n transitionDuration = void 0,\n transitionTiming = void 0,\n transitionDelay = void 0;\nvar animationName = void 0,\n animationDuration = void 0,\n animationTiming = void 0,\n animationDelay = void 0;\n\nif (_inDOM2.default) {\n var _getTransitionPropert = getTransitionProperties();\n\n prefix = _getTransitionPropert.prefix;\n exports.transitionEnd = transitionEnd = _getTransitionPropert.transitionEnd;\n exports.animationEnd = animationEnd = _getTransitionPropert.animationEnd;\n\n\n exports.transform = transform = prefix + '-' + transform;\n exports.transitionProperty = transitionProperty = prefix + '-transition-property';\n exports.transitionDuration = transitionDuration = prefix + '-transition-duration';\n exports.transitionDelay = transitionDelay = prefix + '-transition-delay';\n exports.transitionTiming = transitionTiming = prefix + '-transition-timing-function';\n\n exports.animationName = animationName = prefix + '-animation-name';\n exports.animationDuration = animationDuration = prefix + '-animation-duration';\n exports.animationTiming = animationTiming = prefix + '-animation-delay';\n exports.animationDelay = animationDelay = prefix + '-animation-timing-function';\n}\n\nexports.transform = transform;\nexports.transitionProperty = transitionProperty;\nexports.transitionTiming = transitionTiming;\nexports.transitionDelay = transitionDelay;\nexports.transitionDuration = transitionDuration;\nexports.transitionEnd = transitionEnd;\nexports.animationName = animationName;\nexports.animationDuration = animationDuration;\nexports.animationTiming = animationTiming;\nexports.animationDelay = animationDelay;\nexports.animationEnd = animationEnd;\nexports.default = {\n transform: transform,\n end: transitionEnd,\n property: transitionProperty,\n timing: transitionTiming,\n delay: transitionDelay,\n duration: transitionDuration\n};\n\n\nfunction getTransitionProperties() {\n var style = document.createElement('div').style;\n\n var vendorMap = {\n O: function O(e) {\n return 'o' + e.toLowerCase();\n },\n Moz: function Moz(e) {\n return e.toLowerCase();\n },\n Webkit: function Webkit(e) {\n return 'webkit' + e;\n },\n ms: function ms(e) {\n return 'MS' + e;\n }\n };\n\n var vendors = Object.keys(vendorMap);\n\n var transitionEnd = void 0,\n animationEnd = void 0;\n var prefix = '';\n\n for (var i = 0; i < vendors.length; i++) {\n var vendor = vendors[i];\n\n if (vendor + 'TransitionProperty' in style) {\n prefix = '-' + vendor.toLowerCase();\n transitionEnd = vendorMap[vendor]('TransitionEnd');\n animationEnd = vendorMap[vendor]('AnimationEnd');\n break;\n }\n }\n\n if (!transitionEnd && 'transitionProperty' in style) transitionEnd = 'transitionend';\n\n if (!animationEnd && 'animationName' in style) animationEnd = 'animationend';\n\n style = null;\n\n return { animationEnd: animationEnd, transitionEnd: transitionEnd, prefix: prefix };\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = camelize;\nvar rHyphen = /-(.)/g;\n\nfunction camelize(string) {\n return string.replace(rHyphen, function (_, chr) {\n return chr.toUpperCase();\n });\n}\nmodule.exports = exports[\"default\"];","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = camelizeStyleName;\n\nvar _camelize = require('./camelize');\n\nvar _camelize2 = _interopRequireDefault(_camelize);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar msPattern = /^-ms-/; /**\n * Copyright 2014-2015, Facebook, Inc.\n * All rights reserved.\n * https://github.com/facebook/react/blob/2aeb8a2a6beb00617a4217f7f8284924fa2ad819/src/vendor/core/camelizeStyleName.js\n */\nfunction camelizeStyleName(string) {\n return (0, _camelize2.default)(string.replace(msPattern, 'ms-'));\n}\nmodule.exports = exports['default'];","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = hyphenate;\n\nvar rUpper = /([A-Z])/g;\n\nfunction hyphenate(string) {\n return string.replace(rUpper, '-$1').toLowerCase();\n}\nmodule.exports = exports['default'];","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = hyphenateStyleName;\n\nvar _hyphenate = require('./hyphenate');\n\nvar _hyphenate2 = _interopRequireDefault(_hyphenate);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar msPattern = /^ms-/; /**\n * Copyright 2013-2014, Facebook, Inc.\n * All rights reserved.\n * https://github.com/facebook/react/blob/2aeb8a2a6beb00617a4217f7f8284924fa2ad819/src/vendor/core/hyphenateStyleName.js\n */\n\nfunction hyphenateStyleName(string) {\n return (0, _hyphenate2.default)(string).replace(msPattern, '-ms-');\n}\nmodule.exports = exports['default'];","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = !!(typeof window !== 'undefined' && window.document && window.document.createElement);\nmodule.exports = exports['default'];","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nexports.default = function (recalc) {\n if (!size && size !== 0 || recalc) {\n if (_inDOM2.default) {\n var scrollDiv = document.createElement('div');\n\n scrollDiv.style.position = 'absolute';\n scrollDiv.style.top = '-9999px';\n scrollDiv.style.width = '50px';\n scrollDiv.style.height = '50px';\n scrollDiv.style.overflow = 'scroll';\n\n document.body.appendChild(scrollDiv);\n size = scrollDiv.offsetWidth - scrollDiv.clientWidth;\n document.body.removeChild(scrollDiv);\n }\n }\n\n return size;\n};\n\nvar _inDOM = require('./inDOM');\n\nvar _inDOM2 = _interopRequireDefault(_inDOM);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar size = void 0;\n\nmodule.exports = exports['default'];","'use strict';\n\nvar elliptic = exports;\n\nelliptic.version = require('../package.json').version;\nelliptic.utils = require('./elliptic/utils');\nelliptic.rand = require('brorand');\nelliptic.curve = require('./elliptic/curve');\nelliptic.curves = require('./elliptic/curves');\n\n// Protocols\nelliptic.ec = require('./elliptic/ec');\nelliptic.eddsa = require('./elliptic/eddsa');\n","'use strict';\n\nvar BN = require('bn.js');\nvar elliptic = require('../../elliptic');\nvar utils = elliptic.utils;\nvar getNAF = utils.getNAF;\nvar getJSF = utils.getJSF;\nvar assert = utils.assert;\n\nfunction BaseCurve(type, conf) {\n this.type = type;\n this.p = new BN(conf.p, 16);\n\n // Use Montgomery, when there is no fast reduction for the prime\n this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p);\n\n // Useful for many curves\n this.zero = new BN(0).toRed(this.red);\n this.one = new BN(1).toRed(this.red);\n this.two = new BN(2).toRed(this.red);\n\n // Curve configuration, optional\n this.n = conf.n && new BN(conf.n, 16);\n this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed);\n\n // Temporary arrays\n this._wnafT1 = new Array(4);\n this._wnafT2 = new Array(4);\n this._wnafT3 = new Array(4);\n this._wnafT4 = new Array(4);\n\n // Generalized Greg Maxwell's trick\n var adjustCount = this.n && this.p.div(this.n);\n if (!adjustCount || adjustCount.cmpn(100) > 0) {\n this.redN = null;\n } else {\n this._maxwellTrick = true;\n this.redN = this.n.toRed(this.red);\n }\n}\nmodule.exports = BaseCurve;\n\nBaseCurve.prototype.point = function point() {\n throw new Error('Not implemented');\n};\n\nBaseCurve.prototype.validate = function validate() {\n throw new Error('Not implemented');\n};\n\nBaseCurve.prototype._fixedNafMul = function _fixedNafMul(p, k) {\n assert(p.precomputed);\n var doubles = p._getDoubles();\n\n var naf = getNAF(k, 1);\n var I = (1 << (doubles.step + 1)) - (doubles.step % 2 === 0 ? 2 : 1);\n I /= 3;\n\n // Translate into more windowed form\n var repr = [];\n for (var j = 0; j < naf.length; j += doubles.step) {\n var nafW = 0;\n for (var k = j + doubles.step - 1; k >= j; k--)\n nafW = (nafW << 1) + naf[k];\n repr.push(nafW);\n }\n\n var a = this.jpoint(null, null, null);\n var b = this.jpoint(null, null, null);\n for (var i = I; i > 0; i--) {\n for (var j = 0; j < repr.length; j++) {\n var nafW = repr[j];\n if (nafW === i)\n b = b.mixedAdd(doubles.points[j]);\n else if (nafW === -i)\n b = b.mixedAdd(doubles.points[j].neg());\n }\n a = a.add(b);\n }\n return a.toP();\n};\n\nBaseCurve.prototype._wnafMul = function _wnafMul(p, k) {\n var w = 4;\n\n // Precompute window\n var nafPoints = p._getNAFPoints(w);\n w = nafPoints.wnd;\n var wnd = nafPoints.points;\n\n // Get NAF form\n var naf = getNAF(k, w);\n\n // Add `this`*(N+1) for every w-NAF index\n var acc = this.jpoint(null, null, null);\n for (var i = naf.length - 1; i >= 0; i--) {\n // Count zeroes\n for (var k = 0; i >= 0 && naf[i] === 0; i--)\n k++;\n if (i >= 0)\n k++;\n acc = acc.dblp(k);\n\n if (i < 0)\n break;\n var z = naf[i];\n assert(z !== 0);\n if (p.type === 'affine') {\n // J +- P\n if (z > 0)\n acc = acc.mixedAdd(wnd[(z - 1) >> 1]);\n else\n acc = acc.mixedAdd(wnd[(-z - 1) >> 1].neg());\n } else {\n // J +- J\n if (z > 0)\n acc = acc.add(wnd[(z - 1) >> 1]);\n else\n acc = acc.add(wnd[(-z - 1) >> 1].neg());\n }\n }\n return p.type === 'affine' ? acc.toP() : acc;\n};\n\nBaseCurve.prototype._wnafMulAdd = function _wnafMulAdd(defW,\n points,\n coeffs,\n len,\n jacobianResult) {\n var wndWidth = this._wnafT1;\n var wnd = this._wnafT2;\n var naf = this._wnafT3;\n\n // Fill all arrays\n var max = 0;\n for (var i = 0; i < len; i++) {\n var p = points[i];\n var nafPoints = p._getNAFPoints(defW);\n wndWidth[i] = nafPoints.wnd;\n wnd[i] = nafPoints.points;\n }\n\n // Comb small window NAFs\n for (var i = len - 1; i >= 1; i -= 2) {\n var a = i - 1;\n var b = i;\n if (wndWidth[a] !== 1 || wndWidth[b] !== 1) {\n naf[a] = getNAF(coeffs[a], wndWidth[a]);\n naf[b] = getNAF(coeffs[b], wndWidth[b]);\n max = Math.max(naf[a].length, max);\n max = Math.max(naf[b].length, max);\n continue;\n }\n\n var comb = [\n points[a], /* 1 */\n null, /* 3 */\n null, /* 5 */\n points[b] /* 7 */\n ];\n\n // Try to avoid Projective points, if possible\n if (points[a].y.cmp(points[b].y) === 0) {\n comb[1] = points[a].add(points[b]);\n comb[2] = points[a].toJ().mixedAdd(points[b].neg());\n } else if (points[a].y.cmp(points[b].y.redNeg()) === 0) {\n comb[1] = points[a].toJ().mixedAdd(points[b]);\n comb[2] = points[a].add(points[b].neg());\n } else {\n comb[1] = points[a].toJ().mixedAdd(points[b]);\n comb[2] = points[a].toJ().mixedAdd(points[b].neg());\n }\n\n var index = [\n -3, /* -1 -1 */\n -1, /* -1 0 */\n -5, /* -1 1 */\n -7, /* 0 -1 */\n 0, /* 0 0 */\n 7, /* 0 1 */\n 5, /* 1 -1 */\n 1, /* 1 0 */\n 3 /* 1 1 */\n ];\n\n var jsf = getJSF(coeffs[a], coeffs[b]);\n max = Math.max(jsf[0].length, max);\n naf[a] = new Array(max);\n naf[b] = new Array(max);\n for (var j = 0; j < max; j++) {\n var ja = jsf[0][j] | 0;\n var jb = jsf[1][j] | 0;\n\n naf[a][j] = index[(ja + 1) * 3 + (jb + 1)];\n naf[b][j] = 0;\n wnd[a] = comb;\n }\n }\n\n var acc = this.jpoint(null, null, null);\n var tmp = this._wnafT4;\n for (var i = max; i >= 0; i--) {\n var k = 0;\n\n while (i >= 0) {\n var zero = true;\n for (var j = 0; j < len; j++) {\n tmp[j] = naf[j][i] | 0;\n if (tmp[j] !== 0)\n zero = false;\n }\n if (!zero)\n break;\n k++;\n i--;\n }\n if (i >= 0)\n k++;\n acc = acc.dblp(k);\n if (i < 0)\n break;\n\n for (var j = 0; j < len; j++) {\n var z = tmp[j];\n var p;\n if (z === 0)\n continue;\n else if (z > 0)\n p = wnd[j][(z - 1) >> 1];\n else if (z < 0)\n p = wnd[j][(-z - 1) >> 1].neg();\n\n if (p.type === 'affine')\n acc = acc.mixedAdd(p);\n else\n acc = acc.add(p);\n }\n }\n // Zeroify references\n for (var i = 0; i < len; i++)\n wnd[i] = null;\n\n if (jacobianResult)\n return acc;\n else\n return acc.toP();\n};\n\nfunction BasePoint(curve, type) {\n this.curve = curve;\n this.type = type;\n this.precomputed = null;\n}\nBaseCurve.BasePoint = BasePoint;\n\nBasePoint.prototype.eq = function eq(/*other*/) {\n throw new Error('Not implemented');\n};\n\nBasePoint.prototype.validate = function validate() {\n return this.curve.validate(this);\n};\n\nBaseCurve.prototype.decodePoint = function decodePoint(bytes, enc) {\n bytes = utils.toArray(bytes, enc);\n\n var len = this.p.byteLength();\n\n // uncompressed, hybrid-odd, hybrid-even\n if ((bytes[0] === 0x04 || bytes[0] === 0x06 || bytes[0] === 0x07) &&\n bytes.length - 1 === 2 * len) {\n if (bytes[0] === 0x06)\n assert(bytes[bytes.length - 1] % 2 === 0);\n else if (bytes[0] === 0x07)\n assert(bytes[bytes.length - 1] % 2 === 1);\n\n var res = this.point(bytes.slice(1, 1 + len),\n bytes.slice(1 + len, 1 + 2 * len));\n\n return res;\n } else if ((bytes[0] === 0x02 || bytes[0] === 0x03) &&\n bytes.length - 1 === len) {\n return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 0x03);\n }\n throw new Error('Unknown point format');\n};\n\nBasePoint.prototype.encodeCompressed = function encodeCompressed(enc) {\n return this.encode(enc, true);\n};\n\nBasePoint.prototype._encode = function _encode(compact) {\n var len = this.curve.p.byteLength();\n var x = this.getX().toArray('be', len);\n\n if (compact)\n return [ this.getY().isEven() ? 0x02 : 0x03 ].concat(x);\n\n return [ 0x04 ].concat(x, this.getY().toArray('be', len)) ;\n};\n\nBasePoint.prototype.encode = function encode(enc, compact) {\n return utils.encode(this._encode(compact), enc);\n};\n\nBasePoint.prototype.precompute = function precompute(power) {\n if (this.precomputed)\n return this;\n\n var precomputed = {\n doubles: null,\n naf: null,\n beta: null\n };\n precomputed.naf = this._getNAFPoints(8);\n precomputed.doubles = this._getDoubles(4, power);\n precomputed.beta = this._getBeta();\n this.precomputed = precomputed;\n\n return this;\n};\n\nBasePoint.prototype._hasDoubles = function _hasDoubles(k) {\n if (!this.precomputed)\n return false;\n\n var doubles = this.precomputed.doubles;\n if (!doubles)\n return false;\n\n return doubles.points.length >= Math.ceil((k.bitLength() + 1) / doubles.step);\n};\n\nBasePoint.prototype._getDoubles = function _getDoubles(step, power) {\n if (this.precomputed && this.precomputed.doubles)\n return this.precomputed.doubles;\n\n var doubles = [ this ];\n var acc = this;\n for (var i = 0; i < power; i += step) {\n for (var j = 0; j < step; j++)\n acc = acc.dbl();\n doubles.push(acc);\n }\n return {\n step: step,\n points: doubles\n };\n};\n\nBasePoint.prototype._getNAFPoints = function _getNAFPoints(wnd) {\n if (this.precomputed && this.precomputed.naf)\n return this.precomputed.naf;\n\n var res = [ this ];\n var max = (1 << wnd) - 1;\n var dbl = max === 1 ? null : this.dbl();\n for (var i = 1; i < max; i++)\n res[i] = res[i - 1].add(dbl);\n return {\n wnd: wnd,\n points: res\n };\n};\n\nBasePoint.prototype._getBeta = function _getBeta() {\n return null;\n};\n\nBasePoint.prototype.dblp = function dblp(k) {\n var r = this;\n for (var i = 0; i < k; i++)\n r = r.dbl();\n return r;\n};\n","'use strict';\n\nvar curve = require('../curve');\nvar elliptic = require('../../elliptic');\nvar BN = require('bn.js');\nvar inherits = require('inherits');\nvar Base = curve.base;\n\nvar assert = elliptic.utils.assert;\n\nfunction EdwardsCurve(conf) {\n // NOTE: Important as we are creating point in Base.call()\n this.twisted = (conf.a | 0) !== 1;\n this.mOneA = this.twisted && (conf.a | 0) === -1;\n this.extended = this.mOneA;\n\n Base.call(this, 'edwards', conf);\n\n this.a = new BN(conf.a, 16).umod(this.red.m);\n this.a = this.a.toRed(this.red);\n this.c = new BN(conf.c, 16).toRed(this.red);\n this.c2 = this.c.redSqr();\n this.d = new BN(conf.d, 16).toRed(this.red);\n this.dd = this.d.redAdd(this.d);\n\n assert(!this.twisted || this.c.fromRed().cmpn(1) === 0);\n this.oneC = (conf.c | 0) === 1;\n}\ninherits(EdwardsCurve, Base);\nmodule.exports = EdwardsCurve;\n\nEdwardsCurve.prototype._mulA = function _mulA(num) {\n if (this.mOneA)\n return num.redNeg();\n else\n return this.a.redMul(num);\n};\n\nEdwardsCurve.prototype._mulC = function _mulC(num) {\n if (this.oneC)\n return num;\n else\n return this.c.redMul(num);\n};\n\n// Just for compatibility with Short curve\nEdwardsCurve.prototype.jpoint = function jpoint(x, y, z, t) {\n return this.point(x, y, z, t);\n};\n\nEdwardsCurve.prototype.pointFromX = function pointFromX(x, odd) {\n x = new BN(x, 16);\n if (!x.red)\n x = x.toRed(this.red);\n\n var x2 = x.redSqr();\n var rhs = this.c2.redSub(this.a.redMul(x2));\n var lhs = this.one.redSub(this.c2.redMul(this.d).redMul(x2));\n\n var y2 = rhs.redMul(lhs.redInvm());\n var y = y2.redSqrt();\n if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)\n throw new Error('invalid point');\n\n var isOdd = y.fromRed().isOdd();\n if (odd && !isOdd || !odd && isOdd)\n y = y.redNeg();\n\n return this.point(x, y);\n};\n\nEdwardsCurve.prototype.pointFromY = function pointFromY(y, odd) {\n y = new BN(y, 16);\n if (!y.red)\n y = y.toRed(this.red);\n\n // x^2 = (y^2 - 1) / (d y^2 + 1)\n var y2 = y.redSqr();\n var lhs = y2.redSub(this.one);\n var rhs = y2.redMul(this.d).redAdd(this.one);\n var x2 = lhs.redMul(rhs.redInvm());\n\n if (x2.cmp(this.zero) === 0) {\n if (odd)\n throw new Error('invalid point');\n else\n return this.point(this.zero, y);\n }\n\n var x = x2.redSqrt();\n if (x.redSqr().redSub(x2).cmp(this.zero) !== 0)\n throw new Error('invalid point');\n\n if (x.isOdd() !== odd)\n x = x.redNeg();\n\n return this.point(x, y);\n};\n\nEdwardsCurve.prototype.validate = function validate(point) {\n if (point.isInfinity())\n return true;\n\n // Curve: A * X^2 + Y^2 = C^2 * (1 + D * X^2 * Y^2)\n point.normalize();\n\n var x2 = point.x.redSqr();\n var y2 = point.y.redSqr();\n var lhs = x2.redMul(this.a).redAdd(y2);\n var rhs = this.c2.redMul(this.one.redAdd(this.d.redMul(x2).redMul(y2)));\n\n return lhs.cmp(rhs) === 0;\n};\n\nfunction Point(curve, x, y, z, t) {\n Base.BasePoint.call(this, curve, 'projective');\n if (x === null && y === null && z === null) {\n this.x = this.curve.zero;\n this.y = this.curve.one;\n this.z = this.curve.one;\n this.t = this.curve.zero;\n this.zOne = true;\n } else {\n this.x = new BN(x, 16);\n this.y = new BN(y, 16);\n this.z = z ? new BN(z, 16) : this.curve.one;\n this.t = t && new BN(t, 16);\n if (!this.x.red)\n this.x = this.x.toRed(this.curve.red);\n if (!this.y.red)\n this.y = this.y.toRed(this.curve.red);\n if (!this.z.red)\n this.z = this.z.toRed(this.curve.red);\n if (this.t && !this.t.red)\n this.t = this.t.toRed(this.curve.red);\n this.zOne = this.z === this.curve.one;\n\n // Use extended coordinates\n if (this.curve.extended && !this.t) {\n this.t = this.x.redMul(this.y);\n if (!this.zOne)\n this.t = this.t.redMul(this.z.redInvm());\n }\n }\n}\ninherits(Point, Base.BasePoint);\n\nEdwardsCurve.prototype.pointFromJSON = function pointFromJSON(obj) {\n return Point.fromJSON(this, obj);\n};\n\nEdwardsCurve.prototype.point = function point(x, y, z, t) {\n return new Point(this, x, y, z, t);\n};\n\nPoint.fromJSON = function fromJSON(curve, obj) {\n return new Point(curve, obj[0], obj[1], obj[2]);\n};\n\nPoint.prototype.inspect = function inspect() {\n if (this.isInfinity())\n return '';\n return '';\n};\n\nPoint.prototype.isInfinity = function isInfinity() {\n // XXX This code assumes that zero is always zero in red\n return this.x.cmpn(0) === 0 &&\n this.y.cmp(this.z) === 0;\n};\n\nPoint.prototype._extDbl = function _extDbl() {\n // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html\n // #doubling-dbl-2008-hwcd\n // 4M + 4S\n\n // A = X1^2\n var a = this.x.redSqr();\n // B = Y1^2\n var b = this.y.redSqr();\n // C = 2 * Z1^2\n var c = this.z.redSqr();\n c = c.redIAdd(c);\n // D = a * A\n var d = this.curve._mulA(a);\n // E = (X1 + Y1)^2 - A - B\n var e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b);\n // G = D + B\n var g = d.redAdd(b);\n // F = G - C\n var f = g.redSub(c);\n // H = D - B\n var h = d.redSub(b);\n // X3 = E * F\n var nx = e.redMul(f);\n // Y3 = G * H\n var ny = g.redMul(h);\n // T3 = E * H\n var nt = e.redMul(h);\n // Z3 = F * G\n var nz = f.redMul(g);\n return this.curve.point(nx, ny, nz, nt);\n};\n\nPoint.prototype._projDbl = function _projDbl() {\n // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html\n // #doubling-dbl-2008-bbjlp\n // #doubling-dbl-2007-bl\n // and others\n // Generally 3M + 4S or 2M + 4S\n\n // B = (X1 + Y1)^2\n var b = this.x.redAdd(this.y).redSqr();\n // C = X1^2\n var c = this.x.redSqr();\n // D = Y1^2\n var d = this.y.redSqr();\n\n var nx;\n var ny;\n var nz;\n if (this.curve.twisted) {\n // E = a * C\n var e = this.curve._mulA(c);\n // F = E + D\n var f = e.redAdd(d);\n if (this.zOne) {\n // X3 = (B - C - D) * (F - 2)\n nx = b.redSub(c).redSub(d).redMul(f.redSub(this.curve.two));\n // Y3 = F * (E - D)\n ny = f.redMul(e.redSub(d));\n // Z3 = F^2 - 2 * F\n nz = f.redSqr().redSub(f).redSub(f);\n } else {\n // H = Z1^2\n var h = this.z.redSqr();\n // J = F - 2 * H\n var j = f.redSub(h).redISub(h);\n // X3 = (B-C-D)*J\n nx = b.redSub(c).redISub(d).redMul(j);\n // Y3 = F * (E - D)\n ny = f.redMul(e.redSub(d));\n // Z3 = F * J\n nz = f.redMul(j);\n }\n } else {\n // E = C + D\n var e = c.redAdd(d);\n // H = (c * Z1)^2\n var h = this.curve._mulC(this.c.redMul(this.z)).redSqr();\n // J = E - 2 * H\n var j = e.redSub(h).redSub(h);\n // X3 = c * (B - E) * J\n nx = this.curve._mulC(b.redISub(e)).redMul(j);\n // Y3 = c * E * (C - D)\n ny = this.curve._mulC(e).redMul(c.redISub(d));\n // Z3 = E * J\n nz = e.redMul(j);\n }\n return this.curve.point(nx, ny, nz);\n};\n\nPoint.prototype.dbl = function dbl() {\n if (this.isInfinity())\n return this;\n\n // Double in extended coordinates\n if (this.curve.extended)\n return this._extDbl();\n else\n return this._projDbl();\n};\n\nPoint.prototype._extAdd = function _extAdd(p) {\n // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html\n // #addition-add-2008-hwcd-3\n // 8M\n\n // A = (Y1 - X1) * (Y2 - X2)\n var a = this.y.redSub(this.x).redMul(p.y.redSub(p.x));\n // B = (Y1 + X1) * (Y2 + X2)\n var b = this.y.redAdd(this.x).redMul(p.y.redAdd(p.x));\n // C = T1 * k * T2\n var c = this.t.redMul(this.curve.dd).redMul(p.t);\n // D = Z1 * 2 * Z2\n var d = this.z.redMul(p.z.redAdd(p.z));\n // E = B - A\n var e = b.redSub(a);\n // F = D - C\n var f = d.redSub(c);\n // G = D + C\n var g = d.redAdd(c);\n // H = B + A\n var h = b.redAdd(a);\n // X3 = E * F\n var nx = e.redMul(f);\n // Y3 = G * H\n var ny = g.redMul(h);\n // T3 = E * H\n var nt = e.redMul(h);\n // Z3 = F * G\n var nz = f.redMul(g);\n return this.curve.point(nx, ny, nz, nt);\n};\n\nPoint.prototype._projAdd = function _projAdd(p) {\n // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html\n // #addition-add-2008-bbjlp\n // #addition-add-2007-bl\n // 10M + 1S\n\n // A = Z1 * Z2\n var a = this.z.redMul(p.z);\n // B = A^2\n var b = a.redSqr();\n // C = X1 * X2\n var c = this.x.redMul(p.x);\n // D = Y1 * Y2\n var d = this.y.redMul(p.y);\n // E = d * C * D\n var e = this.curve.d.redMul(c).redMul(d);\n // F = B - E\n var f = b.redSub(e);\n // G = B + E\n var g = b.redAdd(e);\n // X3 = A * F * ((X1 + Y1) * (X2 + Y2) - C - D)\n var tmp = this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)).redISub(c).redISub(d);\n var nx = a.redMul(f).redMul(tmp);\n var ny;\n var nz;\n if (this.curve.twisted) {\n // Y3 = A * G * (D - a * C)\n ny = a.redMul(g).redMul(d.redSub(this.curve._mulA(c)));\n // Z3 = F * G\n nz = f.redMul(g);\n } else {\n // Y3 = A * G * (D - C)\n ny = a.redMul(g).redMul(d.redSub(c));\n // Z3 = c * F * G\n nz = this.curve._mulC(f).redMul(g);\n }\n return this.curve.point(nx, ny, nz);\n};\n\nPoint.prototype.add = function add(p) {\n if (this.isInfinity())\n return p;\n if (p.isInfinity())\n return this;\n\n if (this.curve.extended)\n return this._extAdd(p);\n else\n return this._projAdd(p);\n};\n\nPoint.prototype.mul = function mul(k) {\n if (this._hasDoubles(k))\n return this.curve._fixedNafMul(this, k);\n else\n return this.curve._wnafMul(this, k);\n};\n\nPoint.prototype.mulAdd = function mulAdd(k1, p, k2) {\n return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, false);\n};\n\nPoint.prototype.jmulAdd = function jmulAdd(k1, p, k2) {\n return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, true);\n};\n\nPoint.prototype.normalize = function normalize() {\n if (this.zOne)\n return this;\n\n // Normalize coordinates\n var zi = this.z.redInvm();\n this.x = this.x.redMul(zi);\n this.y = this.y.redMul(zi);\n if (this.t)\n this.t = this.t.redMul(zi);\n this.z = this.curve.one;\n this.zOne = true;\n return this;\n};\n\nPoint.prototype.neg = function neg() {\n return this.curve.point(this.x.redNeg(),\n this.y,\n this.z,\n this.t && this.t.redNeg());\n};\n\nPoint.prototype.getX = function getX() {\n this.normalize();\n return this.x.fromRed();\n};\n\nPoint.prototype.getY = function getY() {\n this.normalize();\n return this.y.fromRed();\n};\n\nPoint.prototype.eq = function eq(other) {\n return this === other ||\n this.getX().cmp(other.getX()) === 0 &&\n this.getY().cmp(other.getY()) === 0;\n};\n\nPoint.prototype.eqXToP = function eqXToP(x) {\n var rx = x.toRed(this.curve.red).redMul(this.z);\n if (this.x.cmp(rx) === 0)\n return true;\n\n var xc = x.clone();\n var t = this.curve.redN.redMul(this.z);\n for (;;) {\n xc.iadd(this.curve.n);\n if (xc.cmp(this.curve.p) >= 0)\n return false;\n\n rx.redIAdd(t);\n if (this.x.cmp(rx) === 0)\n return true;\n }\n return false;\n};\n\n// Compatibility with BaseCurve\nPoint.prototype.toP = Point.prototype.normalize;\nPoint.prototype.mixedAdd = Point.prototype.add;\n","'use strict';\n\nvar curve = exports;\n\ncurve.base = require('./base');\ncurve.short = require('./short');\ncurve.mont = require('./mont');\ncurve.edwards = require('./edwards');\n","'use strict';\n\nvar curve = require('../curve');\nvar BN = require('bn.js');\nvar inherits = require('inherits');\nvar Base = curve.base;\n\nvar elliptic = require('../../elliptic');\nvar utils = elliptic.utils;\n\nfunction MontCurve(conf) {\n Base.call(this, 'mont', conf);\n\n this.a = new BN(conf.a, 16).toRed(this.red);\n this.b = new BN(conf.b, 16).toRed(this.red);\n this.i4 = new BN(4).toRed(this.red).redInvm();\n this.two = new BN(2).toRed(this.red);\n this.a24 = this.i4.redMul(this.a.redAdd(this.two));\n}\ninherits(MontCurve, Base);\nmodule.exports = MontCurve;\n\nMontCurve.prototype.validate = function validate(point) {\n var x = point.normalize().x;\n var x2 = x.redSqr();\n var rhs = x2.redMul(x).redAdd(x2.redMul(this.a)).redAdd(x);\n var y = rhs.redSqrt();\n\n return y.redSqr().cmp(rhs) === 0;\n};\n\nfunction Point(curve, x, z) {\n Base.BasePoint.call(this, curve, 'projective');\n if (x === null && z === null) {\n this.x = this.curve.one;\n this.z = this.curve.zero;\n } else {\n this.x = new BN(x, 16);\n this.z = new BN(z, 16);\n if (!this.x.red)\n this.x = this.x.toRed(this.curve.red);\n if (!this.z.red)\n this.z = this.z.toRed(this.curve.red);\n }\n}\ninherits(Point, Base.BasePoint);\n\nMontCurve.prototype.decodePoint = function decodePoint(bytes, enc) {\n return this.point(utils.toArray(bytes, enc), 1);\n};\n\nMontCurve.prototype.point = function point(x, z) {\n return new Point(this, x, z);\n};\n\nMontCurve.prototype.pointFromJSON = function pointFromJSON(obj) {\n return Point.fromJSON(this, obj);\n};\n\nPoint.prototype.precompute = function precompute() {\n // No-op\n};\n\nPoint.prototype._encode = function _encode() {\n return this.getX().toArray('be', this.curve.p.byteLength());\n};\n\nPoint.fromJSON = function fromJSON(curve, obj) {\n return new Point(curve, obj[0], obj[1] || curve.one);\n};\n\nPoint.prototype.inspect = function inspect() {\n if (this.isInfinity())\n return '';\n return '';\n};\n\nPoint.prototype.isInfinity = function isInfinity() {\n // XXX This code assumes that zero is always zero in red\n return this.z.cmpn(0) === 0;\n};\n\nPoint.prototype.dbl = function dbl() {\n // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#doubling-dbl-1987-m-3\n // 2M + 2S + 4A\n\n // A = X1 + Z1\n var a = this.x.redAdd(this.z);\n // AA = A^2\n var aa = a.redSqr();\n // B = X1 - Z1\n var b = this.x.redSub(this.z);\n // BB = B^2\n var bb = b.redSqr();\n // C = AA - BB\n var c = aa.redSub(bb);\n // X3 = AA * BB\n var nx = aa.redMul(bb);\n // Z3 = C * (BB + A24 * C)\n var nz = c.redMul(bb.redAdd(this.curve.a24.redMul(c)));\n return this.curve.point(nx, nz);\n};\n\nPoint.prototype.add = function add() {\n throw new Error('Not supported on Montgomery curve');\n};\n\nPoint.prototype.diffAdd = function diffAdd(p, diff) {\n // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#diffadd-dadd-1987-m-3\n // 4M + 2S + 6A\n\n // A = X2 + Z2\n var a = this.x.redAdd(this.z);\n // B = X2 - Z2\n var b = this.x.redSub(this.z);\n // C = X3 + Z3\n var c = p.x.redAdd(p.z);\n // D = X3 - Z3\n var d = p.x.redSub(p.z);\n // DA = D * A\n var da = d.redMul(a);\n // CB = C * B\n var cb = c.redMul(b);\n // X5 = Z1 * (DA + CB)^2\n var nx = diff.z.redMul(da.redAdd(cb).redSqr());\n // Z5 = X1 * (DA - CB)^2\n var nz = diff.x.redMul(da.redISub(cb).redSqr());\n return this.curve.point(nx, nz);\n};\n\nPoint.prototype.mul = function mul(k) {\n var t = k.clone();\n var a = this; // (N / 2) * Q + Q\n var b = this.curve.point(null, null); // (N / 2) * Q\n var c = this; // Q\n\n for (var bits = []; t.cmpn(0) !== 0; t.iushrn(1))\n bits.push(t.andln(1));\n\n for (var i = bits.length - 1; i >= 0; i--) {\n if (bits[i] === 0) {\n // N * Q + Q = ((N / 2) * Q + Q)) + (N / 2) * Q\n a = a.diffAdd(b, c);\n // N * Q = 2 * ((N / 2) * Q + Q))\n b = b.dbl();\n } else {\n // N * Q = ((N / 2) * Q + Q) + ((N / 2) * Q)\n b = a.diffAdd(b, c);\n // N * Q + Q = 2 * ((N / 2) * Q + Q)\n a = a.dbl();\n }\n }\n return b;\n};\n\nPoint.prototype.mulAdd = function mulAdd() {\n throw new Error('Not supported on Montgomery curve');\n};\n\nPoint.prototype.jumlAdd = function jumlAdd() {\n throw new Error('Not supported on Montgomery curve');\n};\n\nPoint.prototype.eq = function eq(other) {\n return this.getX().cmp(other.getX()) === 0;\n};\n\nPoint.prototype.normalize = function normalize() {\n this.x = this.x.redMul(this.z.redInvm());\n this.z = this.curve.one;\n return this;\n};\n\nPoint.prototype.getX = function getX() {\n // Normalize coordinates\n this.normalize();\n\n return this.x.fromRed();\n};\n","'use strict';\n\nvar curve = require('../curve');\nvar elliptic = require('../../elliptic');\nvar BN = require('bn.js');\nvar inherits = require('inherits');\nvar Base = curve.base;\n\nvar assert = elliptic.utils.assert;\n\nfunction ShortCurve(conf) {\n Base.call(this, 'short', conf);\n\n this.a = new BN(conf.a, 16).toRed(this.red);\n this.b = new BN(conf.b, 16).toRed(this.red);\n this.tinv = this.two.redInvm();\n\n this.zeroA = this.a.fromRed().cmpn(0) === 0;\n this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0;\n\n // If the curve is endomorphic, precalculate beta and lambda\n this.endo = this._getEndomorphism(conf);\n this._endoWnafT1 = new Array(4);\n this._endoWnafT2 = new Array(4);\n}\ninherits(ShortCurve, Base);\nmodule.exports = ShortCurve;\n\nShortCurve.prototype._getEndomorphism = function _getEndomorphism(conf) {\n // No efficient endomorphism\n if (!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1)\n return;\n\n // Compute beta and lambda, that lambda * P = (beta * Px; Py)\n var beta;\n var lambda;\n if (conf.beta) {\n beta = new BN(conf.beta, 16).toRed(this.red);\n } else {\n var betas = this._getEndoRoots(this.p);\n // Choose the smallest beta\n beta = betas[0].cmp(betas[1]) < 0 ? betas[0] : betas[1];\n beta = beta.toRed(this.red);\n }\n if (conf.lambda) {\n lambda = new BN(conf.lambda, 16);\n } else {\n // Choose the lambda that is matching selected beta\n var lambdas = this._getEndoRoots(this.n);\n if (this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta)) === 0) {\n lambda = lambdas[0];\n } else {\n lambda = lambdas[1];\n assert(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0);\n }\n }\n\n // Get basis vectors, used for balanced length-two representation\n var basis;\n if (conf.basis) {\n basis = conf.basis.map(function(vec) {\n return {\n a: new BN(vec.a, 16),\n b: new BN(vec.b, 16)\n };\n });\n } else {\n basis = this._getEndoBasis(lambda);\n }\n\n return {\n beta: beta,\n lambda: lambda,\n basis: basis\n };\n};\n\nShortCurve.prototype._getEndoRoots = function _getEndoRoots(num) {\n // Find roots of for x^2 + x + 1 in F\n // Root = (-1 +- Sqrt(-3)) / 2\n //\n var red = num === this.p ? this.red : BN.mont(num);\n var tinv = new BN(2).toRed(red).redInvm();\n var ntinv = tinv.redNeg();\n\n var s = new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv);\n\n var l1 = ntinv.redAdd(s).fromRed();\n var l2 = ntinv.redSub(s).fromRed();\n return [ l1, l2 ];\n};\n\nShortCurve.prototype._getEndoBasis = function _getEndoBasis(lambda) {\n // aprxSqrt >= sqrt(this.n)\n var aprxSqrt = this.n.ushrn(Math.floor(this.n.bitLength() / 2));\n\n // 3.74\n // Run EGCD, until r(L + 1) < aprxSqrt\n var u = lambda;\n var v = this.n.clone();\n var x1 = new BN(1);\n var y1 = new BN(0);\n var x2 = new BN(0);\n var y2 = new BN(1);\n\n // NOTE: all vectors are roots of: a + b * lambda = 0 (mod n)\n var a0;\n var b0;\n // First vector\n var a1;\n var b1;\n // Second vector\n var a2;\n var b2;\n\n var prevR;\n var i = 0;\n var r;\n var x;\n while (u.cmpn(0) !== 0) {\n var q = v.div(u);\n r = v.sub(q.mul(u));\n x = x2.sub(q.mul(x1));\n var y = y2.sub(q.mul(y1));\n\n if (!a1 && r.cmp(aprxSqrt) < 0) {\n a0 = prevR.neg();\n b0 = x1;\n a1 = r.neg();\n b1 = x;\n } else if (a1 && ++i === 2) {\n break;\n }\n prevR = r;\n\n v = u;\n u = r;\n x2 = x1;\n x1 = x;\n y2 = y1;\n y1 = y;\n }\n a2 = r.neg();\n b2 = x;\n\n var len1 = a1.sqr().add(b1.sqr());\n var len2 = a2.sqr().add(b2.sqr());\n if (len2.cmp(len1) >= 0) {\n a2 = a0;\n b2 = b0;\n }\n\n // Normalize signs\n if (a1.negative) {\n a1 = a1.neg();\n b1 = b1.neg();\n }\n if (a2.negative) {\n a2 = a2.neg();\n b2 = b2.neg();\n }\n\n return [\n { a: a1, b: b1 },\n { a: a2, b: b2 }\n ];\n};\n\nShortCurve.prototype._endoSplit = function _endoSplit(k) {\n var basis = this.endo.basis;\n var v1 = basis[0];\n var v2 = basis[1];\n\n var c1 = v2.b.mul(k).divRound(this.n);\n var c2 = v1.b.neg().mul(k).divRound(this.n);\n\n var p1 = c1.mul(v1.a);\n var p2 = c2.mul(v2.a);\n var q1 = c1.mul(v1.b);\n var q2 = c2.mul(v2.b);\n\n // Calculate answer\n var k1 = k.sub(p1).sub(p2);\n var k2 = q1.add(q2).neg();\n return { k1: k1, k2: k2 };\n};\n\nShortCurve.prototype.pointFromX = function pointFromX(x, odd) {\n x = new BN(x, 16);\n if (!x.red)\n x = x.toRed(this.red);\n\n var y2 = x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b);\n var y = y2.redSqrt();\n if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)\n throw new Error('invalid point');\n\n // XXX Is there any way to tell if the number is odd without converting it\n // to non-red form?\n var isOdd = y.fromRed().isOdd();\n if (odd && !isOdd || !odd && isOdd)\n y = y.redNeg();\n\n return this.point(x, y);\n};\n\nShortCurve.prototype.validate = function validate(point) {\n if (point.inf)\n return true;\n\n var x = point.x;\n var y = point.y;\n\n var ax = this.a.redMul(x);\n var rhs = x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b);\n return y.redSqr().redISub(rhs).cmpn(0) === 0;\n};\n\nShortCurve.prototype._endoWnafMulAdd =\n function _endoWnafMulAdd(points, coeffs, jacobianResult) {\n var npoints = this._endoWnafT1;\n var ncoeffs = this._endoWnafT2;\n for (var i = 0; i < points.length; i++) {\n var split = this._endoSplit(coeffs[i]);\n var p = points[i];\n var beta = p._getBeta();\n\n if (split.k1.negative) {\n split.k1.ineg();\n p = p.neg(true);\n }\n if (split.k2.negative) {\n split.k2.ineg();\n beta = beta.neg(true);\n }\n\n npoints[i * 2] = p;\n npoints[i * 2 + 1] = beta;\n ncoeffs[i * 2] = split.k1;\n ncoeffs[i * 2 + 1] = split.k2;\n }\n var res = this._wnafMulAdd(1, npoints, ncoeffs, i * 2, jacobianResult);\n\n // Clean-up references to points and coefficients\n for (var j = 0; j < i * 2; j++) {\n npoints[j] = null;\n ncoeffs[j] = null;\n }\n return res;\n};\n\nfunction Point(curve, x, y, isRed) {\n Base.BasePoint.call(this, curve, 'affine');\n if (x === null && y === null) {\n this.x = null;\n this.y = null;\n this.inf = true;\n } else {\n this.x = new BN(x, 16);\n this.y = new BN(y, 16);\n // Force redgomery representation when loading from JSON\n if (isRed) {\n this.x.forceRed(this.curve.red);\n this.y.forceRed(this.curve.red);\n }\n if (!this.x.red)\n this.x = this.x.toRed(this.curve.red);\n if (!this.y.red)\n this.y = this.y.toRed(this.curve.red);\n this.inf = false;\n }\n}\ninherits(Point, Base.BasePoint);\n\nShortCurve.prototype.point = function point(x, y, isRed) {\n return new Point(this, x, y, isRed);\n};\n\nShortCurve.prototype.pointFromJSON = function pointFromJSON(obj, red) {\n return Point.fromJSON(this, obj, red);\n};\n\nPoint.prototype._getBeta = function _getBeta() {\n if (!this.curve.endo)\n return;\n\n var pre = this.precomputed;\n if (pre && pre.beta)\n return pre.beta;\n\n var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y);\n if (pre) {\n var curve = this.curve;\n var endoMul = function(p) {\n return curve.point(p.x.redMul(curve.endo.beta), p.y);\n };\n pre.beta = beta;\n beta.precomputed = {\n beta: null,\n naf: pre.naf && {\n wnd: pre.naf.wnd,\n points: pre.naf.points.map(endoMul)\n },\n doubles: pre.doubles && {\n step: pre.doubles.step,\n points: pre.doubles.points.map(endoMul)\n }\n };\n }\n return beta;\n};\n\nPoint.prototype.toJSON = function toJSON() {\n if (!this.precomputed)\n return [ this.x, this.y ];\n\n return [ this.x, this.y, this.precomputed && {\n doubles: this.precomputed.doubles && {\n step: this.precomputed.doubles.step,\n points: this.precomputed.doubles.points.slice(1)\n },\n naf: this.precomputed.naf && {\n wnd: this.precomputed.naf.wnd,\n points: this.precomputed.naf.points.slice(1)\n }\n } ];\n};\n\nPoint.fromJSON = function fromJSON(curve, obj, red) {\n if (typeof obj === 'string')\n obj = JSON.parse(obj);\n var res = curve.point(obj[0], obj[1], red);\n if (!obj[2])\n return res;\n\n function obj2point(obj) {\n return curve.point(obj[0], obj[1], red);\n }\n\n var pre = obj[2];\n res.precomputed = {\n beta: null,\n doubles: pre.doubles && {\n step: pre.doubles.step,\n points: [ res ].concat(pre.doubles.points.map(obj2point))\n },\n naf: pre.naf && {\n wnd: pre.naf.wnd,\n points: [ res ].concat(pre.naf.points.map(obj2point))\n }\n };\n return res;\n};\n\nPoint.prototype.inspect = function inspect() {\n if (this.isInfinity())\n return '';\n return '';\n};\n\nPoint.prototype.isInfinity = function isInfinity() {\n return this.inf;\n};\n\nPoint.prototype.add = function add(p) {\n // O + P = P\n if (this.inf)\n return p;\n\n // P + O = P\n if (p.inf)\n return this;\n\n // P + P = 2P\n if (this.eq(p))\n return this.dbl();\n\n // P + (-P) = O\n if (this.neg().eq(p))\n return this.curve.point(null, null);\n\n // P + Q = O\n if (this.x.cmp(p.x) === 0)\n return this.curve.point(null, null);\n\n var c = this.y.redSub(p.y);\n if (c.cmpn(0) !== 0)\n c = c.redMul(this.x.redSub(p.x).redInvm());\n var nx = c.redSqr().redISub(this.x).redISub(p.x);\n var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);\n return this.curve.point(nx, ny);\n};\n\nPoint.prototype.dbl = function dbl() {\n if (this.inf)\n return this;\n\n // 2P = O\n var ys1 = this.y.redAdd(this.y);\n if (ys1.cmpn(0) === 0)\n return this.curve.point(null, null);\n\n var a = this.curve.a;\n\n var x2 = this.x.redSqr();\n var dyinv = ys1.redInvm();\n var c = x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv);\n\n var nx = c.redSqr().redISub(this.x.redAdd(this.x));\n var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);\n return this.curve.point(nx, ny);\n};\n\nPoint.prototype.getX = function getX() {\n return this.x.fromRed();\n};\n\nPoint.prototype.getY = function getY() {\n return this.y.fromRed();\n};\n\nPoint.prototype.mul = function mul(k) {\n k = new BN(k, 16);\n\n if (this._hasDoubles(k))\n return this.curve._fixedNafMul(this, k);\n else if (this.curve.endo)\n return this.curve._endoWnafMulAdd([ this ], [ k ]);\n else\n return this.curve._wnafMul(this, k);\n};\n\nPoint.prototype.mulAdd = function mulAdd(k1, p2, k2) {\n var points = [ this, p2 ];\n var coeffs = [ k1, k2 ];\n if (this.curve.endo)\n return this.curve._endoWnafMulAdd(points, coeffs);\n else\n return this.curve._wnafMulAdd(1, points, coeffs, 2);\n};\n\nPoint.prototype.jmulAdd = function jmulAdd(k1, p2, k2) {\n var points = [ this, p2 ];\n var coeffs = [ k1, k2 ];\n if (this.curve.endo)\n return this.curve._endoWnafMulAdd(points, coeffs, true);\n else\n return this.curve._wnafMulAdd(1, points, coeffs, 2, true);\n};\n\nPoint.prototype.eq = function eq(p) {\n return this === p ||\n this.inf === p.inf &&\n (this.inf || this.x.cmp(p.x) === 0 && this.y.cmp(p.y) === 0);\n};\n\nPoint.prototype.neg = function neg(_precompute) {\n if (this.inf)\n return this;\n\n var res = this.curve.point(this.x, this.y.redNeg());\n if (_precompute && this.precomputed) {\n var pre = this.precomputed;\n var negate = function(p) {\n return p.neg();\n };\n res.precomputed = {\n naf: pre.naf && {\n wnd: pre.naf.wnd,\n points: pre.naf.points.map(negate)\n },\n doubles: pre.doubles && {\n step: pre.doubles.step,\n points: pre.doubles.points.map(negate)\n }\n };\n }\n return res;\n};\n\nPoint.prototype.toJ = function toJ() {\n if (this.inf)\n return this.curve.jpoint(null, null, null);\n\n var res = this.curve.jpoint(this.x, this.y, this.curve.one);\n return res;\n};\n\nfunction JPoint(curve, x, y, z) {\n Base.BasePoint.call(this, curve, 'jacobian');\n if (x === null && y === null && z === null) {\n this.x = this.curve.one;\n this.y = this.curve.one;\n this.z = new BN(0);\n } else {\n this.x = new BN(x, 16);\n this.y = new BN(y, 16);\n this.z = new BN(z, 16);\n }\n if (!this.x.red)\n this.x = this.x.toRed(this.curve.red);\n if (!this.y.red)\n this.y = this.y.toRed(this.curve.red);\n if (!this.z.red)\n this.z = this.z.toRed(this.curve.red);\n\n this.zOne = this.z === this.curve.one;\n}\ninherits(JPoint, Base.BasePoint);\n\nShortCurve.prototype.jpoint = function jpoint(x, y, z) {\n return new JPoint(this, x, y, z);\n};\n\nJPoint.prototype.toP = function toP() {\n if (this.isInfinity())\n return this.curve.point(null, null);\n\n var zinv = this.z.redInvm();\n var zinv2 = zinv.redSqr();\n var ax = this.x.redMul(zinv2);\n var ay = this.y.redMul(zinv2).redMul(zinv);\n\n return this.curve.point(ax, ay);\n};\n\nJPoint.prototype.neg = function neg() {\n return this.curve.jpoint(this.x, this.y.redNeg(), this.z);\n};\n\nJPoint.prototype.add = function add(p) {\n // O + P = P\n if (this.isInfinity())\n return p;\n\n // P + O = P\n if (p.isInfinity())\n return this;\n\n // 12M + 4S + 7A\n var pz2 = p.z.redSqr();\n var z2 = this.z.redSqr();\n var u1 = this.x.redMul(pz2);\n var u2 = p.x.redMul(z2);\n var s1 = this.y.redMul(pz2.redMul(p.z));\n var s2 = p.y.redMul(z2.redMul(this.z));\n\n var h = u1.redSub(u2);\n var r = s1.redSub(s2);\n if (h.cmpn(0) === 0) {\n if (r.cmpn(0) !== 0)\n return this.curve.jpoint(null, null, null);\n else\n return this.dbl();\n }\n\n var h2 = h.redSqr();\n var h3 = h2.redMul(h);\n var v = u1.redMul(h2);\n\n var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);\n var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));\n var nz = this.z.redMul(p.z).redMul(h);\n\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype.mixedAdd = function mixedAdd(p) {\n // O + P = P\n if (this.isInfinity())\n return p.toJ();\n\n // P + O = P\n if (p.isInfinity())\n return this;\n\n // 8M + 3S + 7A\n var z2 = this.z.redSqr();\n var u1 = this.x;\n var u2 = p.x.redMul(z2);\n var s1 = this.y;\n var s2 = p.y.redMul(z2).redMul(this.z);\n\n var h = u1.redSub(u2);\n var r = s1.redSub(s2);\n if (h.cmpn(0) === 0) {\n if (r.cmpn(0) !== 0)\n return this.curve.jpoint(null, null, null);\n else\n return this.dbl();\n }\n\n var h2 = h.redSqr();\n var h3 = h2.redMul(h);\n var v = u1.redMul(h2);\n\n var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);\n var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));\n var nz = this.z.redMul(h);\n\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype.dblp = function dblp(pow) {\n if (pow === 0)\n return this;\n if (this.isInfinity())\n return this;\n if (!pow)\n return this.dbl();\n\n if (this.curve.zeroA || this.curve.threeA) {\n var r = this;\n for (var i = 0; i < pow; i++)\n r = r.dbl();\n return r;\n }\n\n // 1M + 2S + 1A + N * (4S + 5M + 8A)\n // N = 1 => 6M + 6S + 9A\n var a = this.curve.a;\n var tinv = this.curve.tinv;\n\n var jx = this.x;\n var jy = this.y;\n var jz = this.z;\n var jz4 = jz.redSqr().redSqr();\n\n // Reuse results\n var jyd = jy.redAdd(jy);\n for (var i = 0; i < pow; i++) {\n var jx2 = jx.redSqr();\n var jyd2 = jyd.redSqr();\n var jyd4 = jyd2.redSqr();\n var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));\n\n var t1 = jx.redMul(jyd2);\n var nx = c.redSqr().redISub(t1.redAdd(t1));\n var t2 = t1.redISub(nx);\n var dny = c.redMul(t2);\n dny = dny.redIAdd(dny).redISub(jyd4);\n var nz = jyd.redMul(jz);\n if (i + 1 < pow)\n jz4 = jz4.redMul(jyd4);\n\n jx = nx;\n jz = nz;\n jyd = dny;\n }\n\n return this.curve.jpoint(jx, jyd.redMul(tinv), jz);\n};\n\nJPoint.prototype.dbl = function dbl() {\n if (this.isInfinity())\n return this;\n\n if (this.curve.zeroA)\n return this._zeroDbl();\n else if (this.curve.threeA)\n return this._threeDbl();\n else\n return this._dbl();\n};\n\nJPoint.prototype._zeroDbl = function _zeroDbl() {\n var nx;\n var ny;\n var nz;\n // Z = 1\n if (this.zOne) {\n // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html\n // #doubling-mdbl-2007-bl\n // 1M + 5S + 14A\n\n // XX = X1^2\n var xx = this.x.redSqr();\n // YY = Y1^2\n var yy = this.y.redSqr();\n // YYYY = YY^2\n var yyyy = yy.redSqr();\n // S = 2 * ((X1 + YY)^2 - XX - YYYY)\n var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n s = s.redIAdd(s);\n // M = 3 * XX + a; a = 0\n var m = xx.redAdd(xx).redIAdd(xx);\n // T = M ^ 2 - 2*S\n var t = m.redSqr().redISub(s).redISub(s);\n\n // 8 * YYYY\n var yyyy8 = yyyy.redIAdd(yyyy);\n yyyy8 = yyyy8.redIAdd(yyyy8);\n yyyy8 = yyyy8.redIAdd(yyyy8);\n\n // X3 = T\n nx = t;\n // Y3 = M * (S - T) - 8 * YYYY\n ny = m.redMul(s.redISub(t)).redISub(yyyy8);\n // Z3 = 2*Y1\n nz = this.y.redAdd(this.y);\n } else {\n // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html\n // #doubling-dbl-2009-l\n // 2M + 5S + 13A\n\n // A = X1^2\n var a = this.x.redSqr();\n // B = Y1^2\n var b = this.y.redSqr();\n // C = B^2\n var c = b.redSqr();\n // D = 2 * ((X1 + B)^2 - A - C)\n var d = this.x.redAdd(b).redSqr().redISub(a).redISub(c);\n d = d.redIAdd(d);\n // E = 3 * A\n var e = a.redAdd(a).redIAdd(a);\n // F = E^2\n var f = e.redSqr();\n\n // 8 * C\n var c8 = c.redIAdd(c);\n c8 = c8.redIAdd(c8);\n c8 = c8.redIAdd(c8);\n\n // X3 = F - 2 * D\n nx = f.redISub(d).redISub(d);\n // Y3 = E * (D - X3) - 8 * C\n ny = e.redMul(d.redISub(nx)).redISub(c8);\n // Z3 = 2 * Y1 * Z1\n nz = this.y.redMul(this.z);\n nz = nz.redIAdd(nz);\n }\n\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype._threeDbl = function _threeDbl() {\n var nx;\n var ny;\n var nz;\n // Z = 1\n if (this.zOne) {\n // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html\n // #doubling-mdbl-2007-bl\n // 1M + 5S + 15A\n\n // XX = X1^2\n var xx = this.x.redSqr();\n // YY = Y1^2\n var yy = this.y.redSqr();\n // YYYY = YY^2\n var yyyy = yy.redSqr();\n // S = 2 * ((X1 + YY)^2 - XX - YYYY)\n var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n s = s.redIAdd(s);\n // M = 3 * XX + a\n var m = xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a);\n // T = M^2 - 2 * S\n var t = m.redSqr().redISub(s).redISub(s);\n // X3 = T\n nx = t;\n // Y3 = M * (S - T) - 8 * YYYY\n var yyyy8 = yyyy.redIAdd(yyyy);\n yyyy8 = yyyy8.redIAdd(yyyy8);\n yyyy8 = yyyy8.redIAdd(yyyy8);\n ny = m.redMul(s.redISub(t)).redISub(yyyy8);\n // Z3 = 2 * Y1\n nz = this.y.redAdd(this.y);\n } else {\n // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b\n // 3M + 5S\n\n // delta = Z1^2\n var delta = this.z.redSqr();\n // gamma = Y1^2\n var gamma = this.y.redSqr();\n // beta = X1 * gamma\n var beta = this.x.redMul(gamma);\n // alpha = 3 * (X1 - delta) * (X1 + delta)\n var alpha = this.x.redSub(delta).redMul(this.x.redAdd(delta));\n alpha = alpha.redAdd(alpha).redIAdd(alpha);\n // X3 = alpha^2 - 8 * beta\n var beta4 = beta.redIAdd(beta);\n beta4 = beta4.redIAdd(beta4);\n var beta8 = beta4.redAdd(beta4);\n nx = alpha.redSqr().redISub(beta8);\n // Z3 = (Y1 + Z1)^2 - gamma - delta\n nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta);\n // Y3 = alpha * (4 * beta - X3) - 8 * gamma^2\n var ggamma8 = gamma.redSqr();\n ggamma8 = ggamma8.redIAdd(ggamma8);\n ggamma8 = ggamma8.redIAdd(ggamma8);\n ggamma8 = ggamma8.redIAdd(ggamma8);\n ny = alpha.redMul(beta4.redISub(nx)).redISub(ggamma8);\n }\n\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype._dbl = function _dbl() {\n var a = this.curve.a;\n\n // 4M + 6S + 10A\n var jx = this.x;\n var jy = this.y;\n var jz = this.z;\n var jz4 = jz.redSqr().redSqr();\n\n var jx2 = jx.redSqr();\n var jy2 = jy.redSqr();\n\n var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));\n\n var jxd4 = jx.redAdd(jx);\n jxd4 = jxd4.redIAdd(jxd4);\n var t1 = jxd4.redMul(jy2);\n var nx = c.redSqr().redISub(t1.redAdd(t1));\n var t2 = t1.redISub(nx);\n\n var jyd8 = jy2.redSqr();\n jyd8 = jyd8.redIAdd(jyd8);\n jyd8 = jyd8.redIAdd(jyd8);\n jyd8 = jyd8.redIAdd(jyd8);\n var ny = c.redMul(t2).redISub(jyd8);\n var nz = jy.redAdd(jy).redMul(jz);\n\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype.trpl = function trpl() {\n if (!this.curve.zeroA)\n return this.dbl().add(this);\n\n // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#tripling-tpl-2007-bl\n // 5M + 10S + ...\n\n // XX = X1^2\n var xx = this.x.redSqr();\n // YY = Y1^2\n var yy = this.y.redSqr();\n // ZZ = Z1^2\n var zz = this.z.redSqr();\n // YYYY = YY^2\n var yyyy = yy.redSqr();\n // M = 3 * XX + a * ZZ2; a = 0\n var m = xx.redAdd(xx).redIAdd(xx);\n // MM = M^2\n var mm = m.redSqr();\n // E = 6 * ((X1 + YY)^2 - XX - YYYY) - MM\n var e = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n e = e.redIAdd(e);\n e = e.redAdd(e).redIAdd(e);\n e = e.redISub(mm);\n // EE = E^2\n var ee = e.redSqr();\n // T = 16*YYYY\n var t = yyyy.redIAdd(yyyy);\n t = t.redIAdd(t);\n t = t.redIAdd(t);\n t = t.redIAdd(t);\n // U = (M + E)^2 - MM - EE - T\n var u = m.redIAdd(e).redSqr().redISub(mm).redISub(ee).redISub(t);\n // X3 = 4 * (X1 * EE - 4 * YY * U)\n var yyu4 = yy.redMul(u);\n yyu4 = yyu4.redIAdd(yyu4);\n yyu4 = yyu4.redIAdd(yyu4);\n var nx = this.x.redMul(ee).redISub(yyu4);\n nx = nx.redIAdd(nx);\n nx = nx.redIAdd(nx);\n // Y3 = 8 * Y1 * (U * (T - U) - E * EE)\n var ny = this.y.redMul(u.redMul(t.redISub(u)).redISub(e.redMul(ee)));\n ny = ny.redIAdd(ny);\n ny = ny.redIAdd(ny);\n ny = ny.redIAdd(ny);\n // Z3 = (Z1 + E)^2 - ZZ - EE\n var nz = this.z.redAdd(e).redSqr().redISub(zz).redISub(ee);\n\n return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype.mul = function mul(k, kbase) {\n k = new BN(k, kbase);\n\n return this.curve._wnafMul(this, k);\n};\n\nJPoint.prototype.eq = function eq(p) {\n if (p.type === 'affine')\n return this.eq(p.toJ());\n\n if (this === p)\n return true;\n\n // x1 * z2^2 == x2 * z1^2\n var z2 = this.z.redSqr();\n var pz2 = p.z.redSqr();\n if (this.x.redMul(pz2).redISub(p.x.redMul(z2)).cmpn(0) !== 0)\n return false;\n\n // y1 * z2^3 == y2 * z1^3\n var z3 = z2.redMul(this.z);\n var pz3 = pz2.redMul(p.z);\n return this.y.redMul(pz3).redISub(p.y.redMul(z3)).cmpn(0) === 0;\n};\n\nJPoint.prototype.eqXToP = function eqXToP(x) {\n var zs = this.z.redSqr();\n var rx = x.toRed(this.curve.red).redMul(zs);\n if (this.x.cmp(rx) === 0)\n return true;\n\n var xc = x.clone();\n var t = this.curve.redN.redMul(zs);\n for (;;) {\n xc.iadd(this.curve.n);\n if (xc.cmp(this.curve.p) >= 0)\n return false;\n\n rx.redIAdd(t);\n if (this.x.cmp(rx) === 0)\n return true;\n }\n return false;\n};\n\nJPoint.prototype.inspect = function inspect() {\n if (this.isInfinity())\n return '';\n return '';\n};\n\nJPoint.prototype.isInfinity = function isInfinity() {\n // XXX This code assumes that zero is always zero in red\n return this.z.cmpn(0) === 0;\n};\n","'use strict';\n\nvar curves = exports;\n\nvar hash = require('hash.js');\nvar elliptic = require('../elliptic');\n\nvar assert = elliptic.utils.assert;\n\nfunction PresetCurve(options) {\n if (options.type === 'short')\n this.curve = new elliptic.curve.short(options);\n else if (options.type === 'edwards')\n this.curve = new elliptic.curve.edwards(options);\n else\n this.curve = new elliptic.curve.mont(options);\n this.g = this.curve.g;\n this.n = this.curve.n;\n this.hash = options.hash;\n\n assert(this.g.validate(), 'Invalid curve');\n assert(this.g.mul(this.n).isInfinity(), 'Invalid curve, G*N != O');\n}\ncurves.PresetCurve = PresetCurve;\n\nfunction defineCurve(name, options) {\n Object.defineProperty(curves, name, {\n configurable: true,\n enumerable: true,\n get: function() {\n var curve = new PresetCurve(options);\n Object.defineProperty(curves, name, {\n configurable: true,\n enumerable: true,\n value: curve\n });\n return curve;\n }\n });\n}\n\ndefineCurve('p192', {\n type: 'short',\n prime: 'p192',\n p: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff',\n a: 'ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc',\n b: '64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1',\n n: 'ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831',\n hash: hash.sha256,\n gRed: false,\n g: [\n '188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012',\n '07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811'\n ]\n});\n\ndefineCurve('p224', {\n type: 'short',\n prime: 'p224',\n p: 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001',\n a: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe',\n b: 'b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4',\n n: 'ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d',\n hash: hash.sha256,\n gRed: false,\n g: [\n 'b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21',\n 'bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34'\n ]\n});\n\ndefineCurve('p256', {\n type: 'short',\n prime: null,\n p: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff',\n a: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc',\n b: '5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b',\n n: 'ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551',\n hash: hash.sha256,\n gRed: false,\n g: [\n '6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296',\n '4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5'\n ]\n});\n\ndefineCurve('p384', {\n type: 'short',\n prime: null,\n p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'fffffffe ffffffff 00000000 00000000 ffffffff',\n a: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'fffffffe ffffffff 00000000 00000000 fffffffc',\n b: 'b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f ' +\n '5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef',\n n: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 ' +\n 'f4372ddf 581a0db2 48b0a77a ecec196a ccc52973',\n hash: hash.sha384,\n gRed: false,\n g: [\n 'aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 ' +\n '5502f25d bf55296c 3a545e38 72760ab7',\n '3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 ' +\n '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f'\n ]\n});\n\ndefineCurve('p521', {\n type: 'short',\n prime: null,\n p: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'ffffffff ffffffff ffffffff ffffffff ffffffff',\n a: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'ffffffff ffffffff ffffffff ffffffff fffffffc',\n b: '00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b ' +\n '99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd ' +\n '3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00',\n n: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n 'ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 ' +\n 'f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409',\n hash: hash.sha512,\n gRed: false,\n g: [\n '000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 ' +\n '053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 ' +\n 'a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66',\n '00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 ' +\n '579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 ' +\n '3fad0761 353c7086 a272c240 88be9476 9fd16650'\n ]\n});\n\ndefineCurve('curve25519', {\n type: 'mont',\n prime: 'p25519',\n p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed',\n a: '76d06',\n b: '1',\n n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',\n hash: hash.sha256,\n gRed: false,\n g: [\n '9'\n ]\n});\n\ndefineCurve('ed25519', {\n type: 'edwards',\n prime: 'p25519',\n p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed',\n a: '-1',\n c: '1',\n // -121665 * (121666^(-1)) (mod P)\n d: '52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3',\n n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',\n hash: hash.sha256,\n gRed: false,\n g: [\n '216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a',\n\n // 4/5\n '6666666666666666666666666666666666666666666666666666666666666658'\n ]\n});\n\nvar pre;\ntry {\n pre = require('./precomputed/secp256k1');\n} catch (e) {\n pre = undefined;\n}\n\ndefineCurve('secp256k1', {\n type: 'short',\n prime: 'k256',\n p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f',\n a: '0',\n b: '7',\n n: 'ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141',\n h: '1',\n hash: hash.sha256,\n\n // Precomputed endomorphism\n beta: '7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee',\n lambda: '5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72',\n basis: [\n {\n a: '3086d221a7d46bcde86c90e49284eb15',\n b: '-e4437ed6010e88286f547fa90abfe4c3'\n },\n {\n a: '114ca50f7a8e2f3f657c1108d9d44cfd8',\n b: '3086d221a7d46bcde86c90e49284eb15'\n }\n ],\n\n gRed: false,\n g: [\n '79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798',\n '483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8',\n pre\n ]\n});\n","'use strict';\n\nvar BN = require('bn.js');\nvar HmacDRBG = require('hmac-drbg');\nvar elliptic = require('../../elliptic');\nvar utils = elliptic.utils;\nvar assert = utils.assert;\n\nvar KeyPair = require('./key');\nvar Signature = require('./signature');\n\nfunction EC(options) {\n if (!(this instanceof EC))\n return new EC(options);\n\n // Shortcut `elliptic.ec(curve-name)`\n if (typeof options === 'string') {\n assert(elliptic.curves.hasOwnProperty(options), 'Unknown curve ' + options);\n\n options = elliptic.curves[options];\n }\n\n // Shortcut for `elliptic.ec(elliptic.curves.curveName)`\n if (options instanceof elliptic.curves.PresetCurve)\n options = { curve: options };\n\n this.curve = options.curve.curve;\n this.n = this.curve.n;\n this.nh = this.n.ushrn(1);\n this.g = this.curve.g;\n\n // Point on curve\n this.g = options.curve.g;\n this.g.precompute(options.curve.n.bitLength() + 1);\n\n // Hash for function for DRBG\n this.hash = options.hash || options.curve.hash;\n}\nmodule.exports = EC;\n\nEC.prototype.keyPair = function keyPair(options) {\n return new KeyPair(this, options);\n};\n\nEC.prototype.keyFromPrivate = function keyFromPrivate(priv, enc) {\n return KeyPair.fromPrivate(this, priv, enc);\n};\n\nEC.prototype.keyFromPublic = function keyFromPublic(pub, enc) {\n return KeyPair.fromPublic(this, pub, enc);\n};\n\nEC.prototype.genKeyPair = function genKeyPair(options) {\n if (!options)\n options = {};\n\n // Instantiate Hmac_DRBG\n var drbg = new HmacDRBG({\n hash: this.hash,\n pers: options.pers,\n persEnc: options.persEnc || 'utf8',\n entropy: options.entropy || elliptic.rand(this.hash.hmacStrength),\n entropyEnc: options.entropy && options.entropyEnc || 'utf8',\n nonce: this.n.toArray()\n });\n\n var bytes = this.n.byteLength();\n var ns2 = this.n.sub(new BN(2));\n do {\n var priv = new BN(drbg.generate(bytes));\n if (priv.cmp(ns2) > 0)\n continue;\n\n priv.iaddn(1);\n return this.keyFromPrivate(priv);\n } while (true);\n};\n\nEC.prototype._truncateToN = function truncateToN(msg, truncOnly) {\n var delta = msg.byteLength() * 8 - this.n.bitLength();\n if (delta > 0)\n msg = msg.ushrn(delta);\n if (!truncOnly && msg.cmp(this.n) >= 0)\n return msg.sub(this.n);\n else\n return msg;\n};\n\nEC.prototype.sign = function sign(msg, key, enc, options) {\n if (typeof enc === 'object') {\n options = enc;\n enc = null;\n }\n if (!options)\n options = {};\n\n key = this.keyFromPrivate(key, enc);\n msg = this._truncateToN(new BN(msg, 16));\n\n // Zero-extend key to provide enough entropy\n var bytes = this.n.byteLength();\n var bkey = key.getPrivate().toArray('be', bytes);\n\n // Zero-extend nonce to have the same byte size as N\n var nonce = msg.toArray('be', bytes);\n\n // Instantiate Hmac_DRBG\n var drbg = new HmacDRBG({\n hash: this.hash,\n entropy: bkey,\n nonce: nonce,\n pers: options.pers,\n persEnc: options.persEnc || 'utf8'\n });\n\n // Number of bytes to generate\n var ns1 = this.n.sub(new BN(1));\n\n for (var iter = 0; true; iter++) {\n var k = options.k ?\n options.k(iter) :\n new BN(drbg.generate(this.n.byteLength()));\n k = this._truncateToN(k, true);\n if (k.cmpn(1) <= 0 || k.cmp(ns1) >= 0)\n continue;\n\n var kp = this.g.mul(k);\n if (kp.isInfinity())\n continue;\n\n var kpX = kp.getX();\n var r = kpX.umod(this.n);\n if (r.cmpn(0) === 0)\n continue;\n\n var s = k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg));\n s = s.umod(this.n);\n if (s.cmpn(0) === 0)\n continue;\n\n var recoveryParam = (kp.getY().isOdd() ? 1 : 0) |\n (kpX.cmp(r) !== 0 ? 2 : 0);\n\n // Use complement of `s`, if it is > `n / 2`\n if (options.canonical && s.cmp(this.nh) > 0) {\n s = this.n.sub(s);\n recoveryParam ^= 1;\n }\n\n return new Signature({ r: r, s: s, recoveryParam: recoveryParam });\n }\n};\n\nEC.prototype.verify = function verify(msg, signature, key, enc) {\n msg = this._truncateToN(new BN(msg, 16));\n key = this.keyFromPublic(key, enc);\n signature = new Signature(signature, 'hex');\n\n // Perform primitive values validation\n var r = signature.r;\n var s = signature.s;\n if (r.cmpn(1) < 0 || r.cmp(this.n) >= 0)\n return false;\n if (s.cmpn(1) < 0 || s.cmp(this.n) >= 0)\n return false;\n\n // Validate signature\n var sinv = s.invm(this.n);\n var u1 = sinv.mul(msg).umod(this.n);\n var u2 = sinv.mul(r).umod(this.n);\n\n if (!this.curve._maxwellTrick) {\n var p = this.g.mulAdd(u1, key.getPublic(), u2);\n if (p.isInfinity())\n return false;\n\n return p.getX().umod(this.n).cmp(r) === 0;\n }\n\n // NOTE: Greg Maxwell's trick, inspired by:\n // https://git.io/vad3K\n\n var p = this.g.jmulAdd(u1, key.getPublic(), u2);\n if (p.isInfinity())\n return false;\n\n // Compare `p.x` of Jacobian point with `r`,\n // this will do `p.x == r * p.z^2` instead of multiplying `p.x` by the\n // inverse of `p.z^2`\n return p.eqXToP(r);\n};\n\nEC.prototype.recoverPubKey = function(msg, signature, j, enc) {\n assert((3 & j) === j, 'The recovery param is more than two bits');\n signature = new Signature(signature, enc);\n\n var n = this.n;\n var e = new BN(msg);\n var r = signature.r;\n var s = signature.s;\n\n // A set LSB signifies that the y-coordinate is odd\n var isYOdd = j & 1;\n var isSecondKey = j >> 1;\n if (r.cmp(this.curve.p.umod(this.curve.n)) >= 0 && isSecondKey)\n throw new Error('Unable to find sencond key candinate');\n\n // 1.1. Let x = r + jn.\n if (isSecondKey)\n r = this.curve.pointFromX(r.add(this.curve.n), isYOdd);\n else\n r = this.curve.pointFromX(r, isYOdd);\n\n var rInv = signature.r.invm(n);\n var s1 = n.sub(e).mul(rInv).umod(n);\n var s2 = s.mul(rInv).umod(n);\n\n // 1.6.1 Compute Q = r^-1 (sR - eG)\n // Q = r^-1 (sR + -eG)\n return this.g.mulAdd(s1, r, s2);\n};\n\nEC.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) {\n signature = new Signature(signature, enc);\n if (signature.recoveryParam !== null)\n return signature.recoveryParam;\n\n for (var i = 0; i < 4; i++) {\n var Qprime;\n try {\n Qprime = this.recoverPubKey(e, signature, i);\n } catch (e) {\n continue;\n }\n\n if (Qprime.eq(Q))\n return i;\n }\n throw new Error('Unable to find valid recovery factor');\n};\n","'use strict';\n\nvar BN = require('bn.js');\nvar elliptic = require('../../elliptic');\nvar utils = elliptic.utils;\nvar assert = utils.assert;\n\nfunction KeyPair(ec, options) {\n this.ec = ec;\n this.priv = null;\n this.pub = null;\n\n // KeyPair(ec, { priv: ..., pub: ... })\n if (options.priv)\n this._importPrivate(options.priv, options.privEnc);\n if (options.pub)\n this._importPublic(options.pub, options.pubEnc);\n}\nmodule.exports = KeyPair;\n\nKeyPair.fromPublic = function fromPublic(ec, pub, enc) {\n if (pub instanceof KeyPair)\n return pub;\n\n return new KeyPair(ec, {\n pub: pub,\n pubEnc: enc\n });\n};\n\nKeyPair.fromPrivate = function fromPrivate(ec, priv, enc) {\n if (priv instanceof KeyPair)\n return priv;\n\n return new KeyPair(ec, {\n priv: priv,\n privEnc: enc\n });\n};\n\nKeyPair.prototype.validate = function validate() {\n var pub = this.getPublic();\n\n if (pub.isInfinity())\n return { result: false, reason: 'Invalid public key' };\n if (!pub.validate())\n return { result: false, reason: 'Public key is not a point' };\n if (!pub.mul(this.ec.curve.n).isInfinity())\n return { result: false, reason: 'Public key * N != O' };\n\n return { result: true, reason: null };\n};\n\nKeyPair.prototype.getPublic = function getPublic(compact, enc) {\n // compact is optional argument\n if (typeof compact === 'string') {\n enc = compact;\n compact = null;\n }\n\n if (!this.pub)\n this.pub = this.ec.g.mul(this.priv);\n\n if (!enc)\n return this.pub;\n\n return this.pub.encode(enc, compact);\n};\n\nKeyPair.prototype.getPrivate = function getPrivate(enc) {\n if (enc === 'hex')\n return this.priv.toString(16, 2);\n else\n return this.priv;\n};\n\nKeyPair.prototype._importPrivate = function _importPrivate(key, enc) {\n this.priv = new BN(key, enc || 16);\n\n // Ensure that the priv won't be bigger than n, otherwise we may fail\n // in fixed multiplication method\n this.priv = this.priv.umod(this.ec.curve.n);\n};\n\nKeyPair.prototype._importPublic = function _importPublic(key, enc) {\n if (key.x || key.y) {\n // Montgomery points only have an `x` coordinate.\n // Weierstrass/Edwards points on the other hand have both `x` and\n // `y` coordinates.\n if (this.ec.curve.type === 'mont') {\n assert(key.x, 'Need x coordinate');\n } else if (this.ec.curve.type === 'short' ||\n this.ec.curve.type === 'edwards') {\n assert(key.x && key.y, 'Need both x and y coordinate');\n }\n this.pub = this.ec.curve.point(key.x, key.y);\n return;\n }\n this.pub = this.ec.curve.decodePoint(key, enc);\n};\n\n// ECDH\nKeyPair.prototype.derive = function derive(pub) {\n return pub.mul(this.priv).getX();\n};\n\n// ECDSA\nKeyPair.prototype.sign = function sign(msg, enc, options) {\n return this.ec.sign(msg, this, enc, options);\n};\n\nKeyPair.prototype.verify = function verify(msg, signature) {\n return this.ec.verify(msg, signature, this);\n};\n\nKeyPair.prototype.inspect = function inspect() {\n return '';\n};\n","'use strict';\n\nvar BN = require('bn.js');\n\nvar elliptic = require('../../elliptic');\nvar utils = elliptic.utils;\nvar assert = utils.assert;\n\nfunction Signature(options, enc) {\n if (options instanceof Signature)\n return options;\n\n if (this._importDER(options, enc))\n return;\n\n assert(options.r && options.s, 'Signature without r or s');\n this.r = new BN(options.r, 16);\n this.s = new BN(options.s, 16);\n if (options.recoveryParam === undefined)\n this.recoveryParam = null;\n else\n this.recoveryParam = options.recoveryParam;\n}\nmodule.exports = Signature;\n\nfunction Position() {\n this.place = 0;\n}\n\nfunction getLength(buf, p) {\n var initial = buf[p.place++];\n if (!(initial & 0x80)) {\n return initial;\n }\n var octetLen = initial & 0xf;\n var val = 0;\n for (var i = 0, off = p.place; i < octetLen; i++, off++) {\n val <<= 8;\n val |= buf[off];\n }\n p.place = off;\n return val;\n}\n\nfunction rmPadding(buf) {\n var i = 0;\n var len = buf.length - 1;\n while (!buf[i] && !(buf[i + 1] & 0x80) && i < len) {\n i++;\n }\n if (i === 0) {\n return buf;\n }\n return buf.slice(i);\n}\n\nSignature.prototype._importDER = function _importDER(data, enc) {\n data = utils.toArray(data, enc);\n var p = new Position();\n if (data[p.place++] !== 0x30) {\n return false;\n }\n var len = getLength(data, p);\n if ((len + p.place) !== data.length) {\n return false;\n }\n if (data[p.place++] !== 0x02) {\n return false;\n }\n var rlen = getLength(data, p);\n var r = data.slice(p.place, rlen + p.place);\n p.place += rlen;\n if (data[p.place++] !== 0x02) {\n return false;\n }\n var slen = getLength(data, p);\n if (data.length !== slen + p.place) {\n return false;\n }\n var s = data.slice(p.place, slen + p.place);\n if (r[0] === 0 && (r[1] & 0x80)) {\n r = r.slice(1);\n }\n if (s[0] === 0 && (s[1] & 0x80)) {\n s = s.slice(1);\n }\n\n this.r = new BN(r);\n this.s = new BN(s);\n this.recoveryParam = null;\n\n return true;\n};\n\nfunction constructLength(arr, len) {\n if (len < 0x80) {\n arr.push(len);\n return;\n }\n var octets = 1 + (Math.log(len) / Math.LN2 >>> 3);\n arr.push(octets | 0x80);\n while (--octets) {\n arr.push((len >>> (octets << 3)) & 0xff);\n }\n arr.push(len);\n}\n\nSignature.prototype.toDER = function toDER(enc) {\n var r = this.r.toArray();\n var s = this.s.toArray();\n\n // Pad values\n if (r[0] & 0x80)\n r = [ 0 ].concat(r);\n // Pad values\n if (s[0] & 0x80)\n s = [ 0 ].concat(s);\n\n r = rmPadding(r);\n s = rmPadding(s);\n\n while (!s[0] && !(s[1] & 0x80)) {\n s = s.slice(1);\n }\n var arr = [ 0x02 ];\n constructLength(arr, r.length);\n arr = arr.concat(r);\n arr.push(0x02);\n constructLength(arr, s.length);\n var backHalf = arr.concat(s);\n var res = [ 0x30 ];\n constructLength(res, backHalf.length);\n res = res.concat(backHalf);\n return utils.encode(res, enc);\n};\n","'use strict';\n\nvar hash = require('hash.js');\nvar elliptic = require('../../elliptic');\nvar utils = elliptic.utils;\nvar assert = utils.assert;\nvar parseBytes = utils.parseBytes;\nvar KeyPair = require('./key');\nvar Signature = require('./signature');\n\nfunction EDDSA(curve) {\n assert(curve === 'ed25519', 'only tested with ed25519 so far');\n\n if (!(this instanceof EDDSA))\n return new EDDSA(curve);\n\n var curve = elliptic.curves[curve].curve;\n this.curve = curve;\n this.g = curve.g;\n this.g.precompute(curve.n.bitLength() + 1);\n\n this.pointClass = curve.point().constructor;\n this.encodingLength = Math.ceil(curve.n.bitLength() / 8);\n this.hash = hash.sha512;\n}\n\nmodule.exports = EDDSA;\n\n/**\n* @param {Array|String} message - message bytes\n* @param {Array|String|KeyPair} secret - secret bytes or a keypair\n* @returns {Signature} - signature\n*/\nEDDSA.prototype.sign = function sign(message, secret) {\n message = parseBytes(message);\n var key = this.keyFromSecret(secret);\n var r = this.hashInt(key.messagePrefix(), message);\n var R = this.g.mul(r);\n var Rencoded = this.encodePoint(R);\n var s_ = this.hashInt(Rencoded, key.pubBytes(), message)\n .mul(key.priv());\n var S = r.add(s_).umod(this.curve.n);\n return this.makeSignature({ R: R, S: S, Rencoded: Rencoded });\n};\n\n/**\n* @param {Array} message - message bytes\n* @param {Array|String|Signature} sig - sig bytes\n* @param {Array|String|Point|KeyPair} pub - public key\n* @returns {Boolean} - true if public key matches sig of message\n*/\nEDDSA.prototype.verify = function verify(message, sig, pub) {\n message = parseBytes(message);\n sig = this.makeSignature(sig);\n var key = this.keyFromPublic(pub);\n var h = this.hashInt(sig.Rencoded(), key.pubBytes(), message);\n var SG = this.g.mul(sig.S());\n var RplusAh = sig.R().add(key.pub().mul(h));\n return RplusAh.eq(SG);\n};\n\nEDDSA.prototype.hashInt = function hashInt() {\n var hash = this.hash();\n for (var i = 0; i < arguments.length; i++)\n hash.update(arguments[i]);\n return utils.intFromLE(hash.digest()).umod(this.curve.n);\n};\n\nEDDSA.prototype.keyFromPublic = function keyFromPublic(pub) {\n return KeyPair.fromPublic(this, pub);\n};\n\nEDDSA.prototype.keyFromSecret = function keyFromSecret(secret) {\n return KeyPair.fromSecret(this, secret);\n};\n\nEDDSA.prototype.makeSignature = function makeSignature(sig) {\n if (sig instanceof Signature)\n return sig;\n return new Signature(this, sig);\n};\n\n/**\n* * https://tools.ietf.org/html/draft-josefsson-eddsa-ed25519-03#section-5.2\n*\n* EDDSA defines methods for encoding and decoding points and integers. These are\n* helper convenience methods, that pass along to utility functions implied\n* parameters.\n*\n*/\nEDDSA.prototype.encodePoint = function encodePoint(point) {\n var enc = point.getY().toArray('le', this.encodingLength);\n enc[this.encodingLength - 1] |= point.getX().isOdd() ? 0x80 : 0;\n return enc;\n};\n\nEDDSA.prototype.decodePoint = function decodePoint(bytes) {\n bytes = utils.parseBytes(bytes);\n\n var lastIx = bytes.length - 1;\n var normed = bytes.slice(0, lastIx).concat(bytes[lastIx] & ~0x80);\n var xIsOdd = (bytes[lastIx] & 0x80) !== 0;\n\n var y = utils.intFromLE(normed);\n return this.curve.pointFromY(y, xIsOdd);\n};\n\nEDDSA.prototype.encodeInt = function encodeInt(num) {\n return num.toArray('le', this.encodingLength);\n};\n\nEDDSA.prototype.decodeInt = function decodeInt(bytes) {\n return utils.intFromLE(bytes);\n};\n\nEDDSA.prototype.isPoint = function isPoint(val) {\n return val instanceof this.pointClass;\n};\n","'use strict';\n\nvar elliptic = require('../../elliptic');\nvar utils = elliptic.utils;\nvar assert = utils.assert;\nvar parseBytes = utils.parseBytes;\nvar cachedProperty = utils.cachedProperty;\n\n/**\n* @param {EDDSA} eddsa - instance\n* @param {Object} params - public/private key parameters\n*\n* @param {Array} [params.secret] - secret seed bytes\n* @param {Point} [params.pub] - public key point (aka `A` in eddsa terms)\n* @param {Array} [params.pub] - public key point encoded as bytes\n*\n*/\nfunction KeyPair(eddsa, params) {\n this.eddsa = eddsa;\n this._secret = parseBytes(params.secret);\n if (eddsa.isPoint(params.pub))\n this._pub = params.pub;\n else\n this._pubBytes = parseBytes(params.pub);\n}\n\nKeyPair.fromPublic = function fromPublic(eddsa, pub) {\n if (pub instanceof KeyPair)\n return pub;\n return new KeyPair(eddsa, { pub: pub });\n};\n\nKeyPair.fromSecret = function fromSecret(eddsa, secret) {\n if (secret instanceof KeyPair)\n return secret;\n return new KeyPair(eddsa, { secret: secret });\n};\n\nKeyPair.prototype.secret = function secret() {\n return this._secret;\n};\n\ncachedProperty(KeyPair, 'pubBytes', function pubBytes() {\n return this.eddsa.encodePoint(this.pub());\n});\n\ncachedProperty(KeyPair, 'pub', function pub() {\n if (this._pubBytes)\n return this.eddsa.decodePoint(this._pubBytes);\n return this.eddsa.g.mul(this.priv());\n});\n\ncachedProperty(KeyPair, 'privBytes', function privBytes() {\n var eddsa = this.eddsa;\n var hash = this.hash();\n var lastIx = eddsa.encodingLength - 1;\n\n var a = hash.slice(0, eddsa.encodingLength);\n a[0] &= 248;\n a[lastIx] &= 127;\n a[lastIx] |= 64;\n\n return a;\n});\n\ncachedProperty(KeyPair, 'priv', function priv() {\n return this.eddsa.decodeInt(this.privBytes());\n});\n\ncachedProperty(KeyPair, 'hash', function hash() {\n return this.eddsa.hash().update(this.secret()).digest();\n});\n\ncachedProperty(KeyPair, 'messagePrefix', function messagePrefix() {\n return this.hash().slice(this.eddsa.encodingLength);\n});\n\nKeyPair.prototype.sign = function sign(message) {\n assert(this._secret, 'KeyPair can only verify');\n return this.eddsa.sign(message, this);\n};\n\nKeyPair.prototype.verify = function verify(message, sig) {\n return this.eddsa.verify(message, sig, this);\n};\n\nKeyPair.prototype.getSecret = function getSecret(enc) {\n assert(this._secret, 'KeyPair is public only');\n return utils.encode(this.secret(), enc);\n};\n\nKeyPair.prototype.getPublic = function getPublic(enc) {\n return utils.encode(this.pubBytes(), enc);\n};\n\nmodule.exports = KeyPair;\n","'use strict';\n\nvar BN = require('bn.js');\nvar elliptic = require('../../elliptic');\nvar utils = elliptic.utils;\nvar assert = utils.assert;\nvar cachedProperty = utils.cachedProperty;\nvar parseBytes = utils.parseBytes;\n\n/**\n* @param {EDDSA} eddsa - eddsa instance\n* @param {Array|Object} sig -\n* @param {Array|Point} [sig.R] - R point as Point or bytes\n* @param {Array|bn} [sig.S] - S scalar as bn or bytes\n* @param {Array} [sig.Rencoded] - R point encoded\n* @param {Array} [sig.Sencoded] - S scalar encoded\n*/\nfunction Signature(eddsa, sig) {\n this.eddsa = eddsa;\n\n if (typeof sig !== 'object')\n sig = parseBytes(sig);\n\n if (Array.isArray(sig)) {\n sig = {\n R: sig.slice(0, eddsa.encodingLength),\n S: sig.slice(eddsa.encodingLength)\n };\n }\n\n assert(sig.R && sig.S, 'Signature without R or S');\n\n if (eddsa.isPoint(sig.R))\n this._R = sig.R;\n if (sig.S instanceof BN)\n this._S = sig.S;\n\n this._Rencoded = Array.isArray(sig.R) ? sig.R : sig.Rencoded;\n this._Sencoded = Array.isArray(sig.S) ? sig.S : sig.Sencoded;\n}\n\ncachedProperty(Signature, 'S', function S() {\n return this.eddsa.decodeInt(this.Sencoded());\n});\n\ncachedProperty(Signature, 'R', function R() {\n return this.eddsa.decodePoint(this.Rencoded());\n});\n\ncachedProperty(Signature, 'Rencoded', function Rencoded() {\n return this.eddsa.encodePoint(this.R());\n});\n\ncachedProperty(Signature, 'Sencoded', function Sencoded() {\n return this.eddsa.encodeInt(this.S());\n});\n\nSignature.prototype.toBytes = function toBytes() {\n return this.Rencoded().concat(this.Sencoded());\n};\n\nSignature.prototype.toHex = function toHex() {\n return utils.encode(this.toBytes(), 'hex').toUpperCase();\n};\n\nmodule.exports = Signature;\n","module.exports = {\n doubles: {\n step: 4,\n points: [\n [\n 'e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a',\n 'f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821'\n ],\n [\n '8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508',\n '11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf'\n ],\n [\n '175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739',\n 'd3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695'\n ],\n [\n '363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640',\n '4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9'\n ],\n [\n '8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c',\n '4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36'\n ],\n [\n '723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda',\n '96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f'\n ],\n [\n 'eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa',\n '5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999'\n ],\n [\n '100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0',\n 'cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09'\n ],\n [\n 'e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d',\n '9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d'\n ],\n [\n 'feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d',\n 'e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088'\n ],\n [\n 'da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1',\n '9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d'\n ],\n [\n '53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0',\n '5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8'\n ],\n [\n '8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047',\n '10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a'\n ],\n [\n '385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862',\n '283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453'\n ],\n [\n '6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7',\n '7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160'\n ],\n [\n '3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd',\n '56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0'\n ],\n [\n '85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83',\n '7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6'\n ],\n [\n '948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a',\n '53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589'\n ],\n [\n '6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8',\n 'bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17'\n ],\n [\n 'e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d',\n '4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda'\n ],\n [\n 'e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725',\n '7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd'\n ],\n [\n '213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754',\n '4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2'\n ],\n [\n '4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c',\n '17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6'\n ],\n [\n 'fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6',\n '6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f'\n ],\n [\n '76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39',\n 'c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01'\n ],\n [\n 'c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891',\n '893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3'\n ],\n [\n 'd895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b',\n 'febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f'\n ],\n [\n 'b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03',\n '2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7'\n ],\n [\n 'e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d',\n 'eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78'\n ],\n [\n 'a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070',\n '7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1'\n ],\n [\n '90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4',\n 'e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150'\n ],\n [\n '8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da',\n '662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82'\n ],\n [\n 'e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11',\n '1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc'\n ],\n [\n '8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e',\n 'efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b'\n ],\n [\n 'e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41',\n '2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51'\n ],\n [\n 'b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef',\n '67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45'\n ],\n [\n 'd68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8',\n 'db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120'\n ],\n [\n '324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d',\n '648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84'\n ],\n [\n '4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96',\n '35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d'\n ],\n [\n '9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd',\n 'ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d'\n ],\n [\n '6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5',\n '9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8'\n ],\n [\n 'a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266',\n '40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8'\n ],\n [\n '7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71',\n '34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac'\n ],\n [\n '928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac',\n 'c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f'\n ],\n [\n '85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751',\n '1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962'\n ],\n [\n 'ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e',\n '493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907'\n ],\n [\n '827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241',\n 'c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec'\n ],\n [\n 'eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3',\n 'be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d'\n ],\n [\n 'e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f',\n '4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414'\n ],\n [\n '1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19',\n 'aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd'\n ],\n [\n '146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be',\n 'b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0'\n ],\n [\n 'fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9',\n '6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811'\n ],\n [\n 'da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2',\n '8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1'\n ],\n [\n 'a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13',\n '7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c'\n ],\n [\n '174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c',\n 'ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73'\n ],\n [\n '959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba',\n '2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd'\n ],\n [\n 'd2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151',\n 'e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405'\n ],\n [\n '64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073',\n 'd99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589'\n ],\n [\n '8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458',\n '38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e'\n ],\n [\n '13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b',\n '69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27'\n ],\n [\n 'bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366',\n 'd3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1'\n ],\n [\n '8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa',\n '40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482'\n ],\n [\n '8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0',\n '620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945'\n ],\n [\n 'dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787',\n '7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573'\n ],\n [\n 'f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e',\n 'ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82'\n ]\n ]\n },\n naf: {\n wnd: 7,\n points: [\n [\n 'f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9',\n '388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672'\n ],\n [\n '2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4',\n 'd8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6'\n ],\n [\n '5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc',\n '6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da'\n ],\n [\n 'acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe',\n 'cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37'\n ],\n [\n '774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb',\n 'd984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b'\n ],\n [\n 'f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8',\n 'ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81'\n ],\n [\n 'd7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e',\n '581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58'\n ],\n [\n 'defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34',\n '4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77'\n ],\n [\n '2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c',\n '85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a'\n ],\n [\n '352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5',\n '321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c'\n ],\n [\n '2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f',\n '2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67'\n ],\n [\n '9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714',\n '73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402'\n ],\n [\n 'daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729',\n 'a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55'\n ],\n [\n 'c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db',\n '2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482'\n ],\n [\n '6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4',\n 'e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82'\n ],\n [\n '1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5',\n 'b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396'\n ],\n [\n '605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479',\n '2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49'\n ],\n [\n '62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d',\n '80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf'\n ],\n [\n '80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f',\n '1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a'\n ],\n [\n '7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb',\n 'd0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7'\n ],\n [\n 'd528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9',\n 'eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933'\n ],\n [\n '49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963',\n '758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a'\n ],\n [\n '77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74',\n '958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6'\n ],\n [\n 'f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530',\n 'e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37'\n ],\n [\n '463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b',\n '5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e'\n ],\n [\n 'f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247',\n 'cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6'\n ],\n [\n 'caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1',\n 'cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476'\n ],\n [\n '2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120',\n '4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40'\n ],\n [\n '7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435',\n '91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61'\n ],\n [\n '754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18',\n '673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683'\n ],\n [\n 'e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8',\n '59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5'\n ],\n [\n '186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb',\n '3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b'\n ],\n [\n 'df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f',\n '55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417'\n ],\n [\n '5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143',\n 'efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868'\n ],\n [\n '290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba',\n 'e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a'\n ],\n [\n 'af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45',\n 'f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6'\n ],\n [\n '766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a',\n '744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996'\n ],\n [\n '59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e',\n 'c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e'\n ],\n [\n 'f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8',\n 'e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d'\n ],\n [\n '7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c',\n '30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2'\n ],\n [\n '948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519',\n 'e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e'\n ],\n [\n '7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab',\n '100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437'\n ],\n [\n '3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca',\n 'ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311'\n ],\n [\n 'd3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf',\n '8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4'\n ],\n [\n '1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610',\n '68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575'\n ],\n [\n '733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4',\n 'f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d'\n ],\n [\n '15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c',\n 'd56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d'\n ],\n [\n 'a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940',\n 'edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629'\n ],\n [\n 'e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980',\n 'a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06'\n ],\n [\n '311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3',\n '66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374'\n ],\n [\n '34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf',\n '9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee'\n ],\n [\n 'f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63',\n '4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1'\n ],\n [\n 'd7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448',\n 'fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b'\n ],\n [\n '32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf',\n '5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661'\n ],\n [\n '7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5',\n '8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6'\n ],\n [\n 'ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6',\n '8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e'\n ],\n [\n '16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5',\n '5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d'\n ],\n [\n 'eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99',\n 'f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc'\n ],\n [\n '78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51',\n 'f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4'\n ],\n [\n '494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5',\n '42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c'\n ],\n [\n 'a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5',\n '204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b'\n ],\n [\n 'c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997',\n '4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913'\n ],\n [\n '841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881',\n '73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154'\n ],\n [\n '5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5',\n '39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865'\n ],\n [\n '36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66',\n 'd2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc'\n ],\n [\n '336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726',\n 'ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224'\n ],\n [\n '8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede',\n '6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e'\n ],\n [\n '1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94',\n '60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6'\n ],\n [\n '85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31',\n '3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511'\n ],\n [\n '29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51',\n 'b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b'\n ],\n [\n 'a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252',\n 'ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2'\n ],\n [\n '4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5',\n 'cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c'\n ],\n [\n 'd24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b',\n '6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3'\n ],\n [\n 'ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4',\n '322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d'\n ],\n [\n 'af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f',\n '6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700'\n ],\n [\n 'e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889',\n '2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4'\n ],\n [\n '591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246',\n 'b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196'\n ],\n [\n '11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984',\n '998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4'\n ],\n [\n '3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a',\n 'b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257'\n ],\n [\n 'cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030',\n 'bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13'\n ],\n [\n 'c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197',\n '6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096'\n ],\n [\n 'c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593',\n 'c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38'\n ],\n [\n 'a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef',\n '21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f'\n ],\n [\n '347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38',\n '60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448'\n ],\n [\n 'da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a',\n '49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a'\n ],\n [\n 'c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111',\n '5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4'\n ],\n [\n '4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502',\n '7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437'\n ],\n [\n '3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea',\n 'be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7'\n ],\n [\n 'cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26',\n '8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d'\n ],\n [\n 'b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986',\n '39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a'\n ],\n [\n 'd4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e',\n '62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54'\n ],\n [\n '48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4',\n '25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77'\n ],\n [\n 'dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda',\n 'ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517'\n ],\n [\n '6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859',\n 'cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10'\n ],\n [\n 'e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f',\n 'f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125'\n ],\n [\n 'eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c',\n '6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e'\n ],\n [\n '13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942',\n 'fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1'\n ],\n [\n 'ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a',\n '1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2'\n ],\n [\n 'b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80',\n '5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423'\n ],\n [\n 'ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d',\n '438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8'\n ],\n [\n '8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1',\n 'cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758'\n ],\n [\n '52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63',\n 'c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375'\n ],\n [\n 'e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352',\n '6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d'\n ],\n [\n '7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193',\n 'ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec'\n ],\n [\n '5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00',\n '9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0'\n ],\n [\n '32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58',\n 'ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c'\n ],\n [\n 'e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7',\n 'd3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4'\n ],\n [\n '8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8',\n 'c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f'\n ],\n [\n '4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e',\n '67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649'\n ],\n [\n '3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d',\n 'cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826'\n ],\n [\n '674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b',\n '299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5'\n ],\n [\n 'd32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f',\n 'f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87'\n ],\n [\n '30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6',\n '462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b'\n ],\n [\n 'be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297',\n '62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc'\n ],\n [\n '93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a',\n '7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c'\n ],\n [\n 'b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c',\n 'ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f'\n ],\n [\n 'd5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52',\n '4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a'\n ],\n [\n 'd3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb',\n 'bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46'\n ],\n [\n '463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065',\n 'bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f'\n ],\n [\n '7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917',\n '603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03'\n ],\n [\n '74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9',\n 'cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08'\n ],\n [\n '30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3',\n '553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8'\n ],\n [\n '9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57',\n '712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373'\n ],\n [\n '176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66',\n 'ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3'\n ],\n [\n '75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8',\n '9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8'\n ],\n [\n '809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721',\n '9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1'\n ],\n [\n '1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180',\n '4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9'\n ]\n ]\n }\n};\n","'use strict';\n\nvar utils = exports;\nvar BN = require('bn.js');\nvar minAssert = require('minimalistic-assert');\nvar minUtils = require('minimalistic-crypto-utils');\n\nutils.assert = minAssert;\nutils.toArray = minUtils.toArray;\nutils.zero2 = minUtils.zero2;\nutils.toHex = minUtils.toHex;\nutils.encode = minUtils.encode;\n\n// Represent num in a w-NAF form\nfunction getNAF(num, w) {\n var naf = [];\n var ws = 1 << (w + 1);\n var k = num.clone();\n while (k.cmpn(1) >= 0) {\n var z;\n if (k.isOdd()) {\n var mod = k.andln(ws - 1);\n if (mod > (ws >> 1) - 1)\n z = (ws >> 1) - mod;\n else\n z = mod;\n k.isubn(z);\n } else {\n z = 0;\n }\n naf.push(z);\n\n // Optimization, shift by word if possible\n var shift = (k.cmpn(0) !== 0 && k.andln(ws - 1) === 0) ? (w + 1) : 1;\n for (var i = 1; i < shift; i++)\n naf.push(0);\n k.iushrn(shift);\n }\n\n return naf;\n}\nutils.getNAF = getNAF;\n\n// Represent k1, k2 in a Joint Sparse Form\nfunction getJSF(k1, k2) {\n var jsf = [\n [],\n []\n ];\n\n k1 = k1.clone();\n k2 = k2.clone();\n var d1 = 0;\n var d2 = 0;\n while (k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0) {\n\n // First phase\n var m14 = (k1.andln(3) + d1) & 3;\n var m24 = (k2.andln(3) + d2) & 3;\n if (m14 === 3)\n m14 = -1;\n if (m24 === 3)\n m24 = -1;\n var u1;\n if ((m14 & 1) === 0) {\n u1 = 0;\n } else {\n var m8 = (k1.andln(7) + d1) & 7;\n if ((m8 === 3 || m8 === 5) && m24 === 2)\n u1 = -m14;\n else\n u1 = m14;\n }\n jsf[0].push(u1);\n\n var u2;\n if ((m24 & 1) === 0) {\n u2 = 0;\n } else {\n var m8 = (k2.andln(7) + d2) & 7;\n if ((m8 === 3 || m8 === 5) && m14 === 2)\n u2 = -m24;\n else\n u2 = m24;\n }\n jsf[1].push(u2);\n\n // Second phase\n if (2 * d1 === u1 + 1)\n d1 = 1 - d1;\n if (2 * d2 === u2 + 1)\n d2 = 1 - d2;\n k1.iushrn(1);\n k2.iushrn(1);\n }\n\n return jsf;\n}\nutils.getJSF = getJSF;\n\nfunction cachedProperty(obj, name, computer) {\n var key = '_' + name;\n obj.prototype[name] = function cachedProperty() {\n return this[key] !== undefined ? this[key] :\n this[key] = computer.call(this);\n };\n}\nutils.cachedProperty = cachedProperty;\n\nfunction parseBytes(bytes) {\n return typeof bytes === 'string' ? utils.toArray(bytes, 'hex') :\n bytes;\n}\nutils.parseBytes = parseBytes;\n\nfunction intFromLE(bytes) {\n return new BN(bytes, 'hex', 'le');\n}\nutils.intFromLE = intFromLE;\n\n","var generate = function generate(num, fn) {\n var a = [];\n for (var i = 0; i < num; ++i) {\n a.push(fn(i));\n }return a;\n};\n\nvar replicate = function replicate(num, val) {\n return generate(num, function () {\n return val;\n });\n};\n\nvar concat = function concat(a, b) {\n return a.concat(b);\n};\n\nvar flatten = function flatten(a) {\n var r = [];\n for (var j = 0, J = a.length; j < J; ++j) {\n for (var i = 0, I = a[j].length; i < I; ++i) {\n r.push(a[j][i]);\n }\n }return r;\n};\n\nvar chunksOf = function chunksOf(n, a) {\n var b = [];\n for (var i = 0, l = a.length; i < l; i += n) {\n b.push(a.slice(i, i + n));\n }return b;\n};\n\nmodule.exports = {\n generate: generate,\n replicate: replicate,\n concat: concat,\n flatten: flatten,\n chunksOf: chunksOf\n};","var A = require(\"./array.js\");\n\nvar at = function at(bytes, index) {\n return parseInt(bytes.slice(index * 2 + 2, index * 2 + 4), 16);\n};\n\nvar random = function random(bytes) {\n var rnd = void 0;\n if (typeof window !== \"undefined\" && window.crypto && window.crypto.getRandomValues) rnd = window.crypto.getRandomValues(new Uint8Array(bytes));else if (typeof require !== \"undefined\") rnd = require(\"c\" + \"rypto\").randomBytes(bytes);else throw \"Safe random numbers not available.\";\n var hex = \"0x\";\n for (var i = 0; i < bytes; ++i) {\n hex += (\"00\" + rnd[i].toString(16)).slice(-2);\n }return hex;\n};\n\nvar length = function length(a) {\n return (a.length - 2) / 2;\n};\n\nvar flatten = function flatten(a) {\n return \"0x\" + a.reduce(function (r, s) {\n return r + s.slice(2);\n }, \"\");\n};\n\nvar slice = function slice(i, j, bs) {\n return \"0x\" + bs.slice(i * 2 + 2, j * 2 + 2);\n};\n\nvar reverse = function reverse(hex) {\n var rev = \"0x\";\n for (var i = 0, l = length(hex); i < l; ++i) {\n rev += hex.slice((l - i) * 2, (l - i + 1) * 2);\n }\n return rev;\n};\n\nvar pad = function pad(l, hex) {\n return hex.length === l * 2 + 2 ? hex : pad(l, \"0x\" + \"0\" + hex.slice(2));\n};\n\nvar padRight = function padRight(l, hex) {\n return hex.length === l * 2 + 2 ? hex : padRight(l, hex + \"0\");\n};\n\nvar toArray = function toArray(hex) {\n var arr = [];\n for (var i = 2, l = hex.length; i < l; i += 2) {\n arr.push(parseInt(hex.slice(i, i + 2), 16));\n }return arr;\n};\n\nvar fromArray = function fromArray(arr) {\n var hex = \"0x\";\n for (var i = 0, l = arr.length; i < l; ++i) {\n var b = arr[i];\n hex += (b < 16 ? \"0\" : \"\") + b.toString(16);\n }\n return hex;\n};\n\nvar toUint8Array = function toUint8Array(hex) {\n return new Uint8Array(toArray(hex));\n};\n\nvar fromUint8Array = function fromUint8Array(arr) {\n return fromArray([].slice.call(arr, 0));\n};\n\nvar fromNumber = function fromNumber(num) {\n var hex = num.toString(16);\n return hex.length % 2 === 0 ? \"0x\" + hex : \"0x0\" + hex;\n};\n\nvar toNumber = function toNumber(hex) {\n return parseInt(hex.slice(2), 16);\n};\n\nvar concat = function concat(a, b) {\n return a.concat(b.slice(2));\n};\n\nvar fromNat = function fromNat(bn) {\n return bn === \"0x0\" ? \"0x\" : bn.length % 2 === 0 ? bn : \"0x0\" + bn.slice(2);\n};\n\nvar toNat = function toNat(bn) {\n return bn[2] === \"0\" ? \"0x\" + bn.slice(3) : bn;\n};\n\nvar fromAscii = function fromAscii(ascii) {\n var hex = \"0x\";\n for (var i = 0; i < ascii.length; ++i) {\n hex += (\"00\" + ascii.charCodeAt(i).toString(16)).slice(-2);\n }return hex;\n};\n\nvar toAscii = function toAscii(hex) {\n var ascii = \"\";\n for (var i = 2; i < hex.length; i += 2) {\n ascii += String.fromCharCode(parseInt(hex.slice(i, i + 2), 16));\n }return ascii;\n};\n\n// From https://gist.github.com/pascaldekloe/62546103a1576803dade9269ccf76330\nvar fromString = function fromString(s) {\n var makeByte = function makeByte(uint8) {\n var b = uint8.toString(16);\n return b.length < 2 ? \"0\" + b : b;\n };\n var bytes = \"0x\";\n for (var ci = 0; ci != s.length; ci++) {\n var c = s.charCodeAt(ci);\n if (c < 128) {\n bytes += makeByte(c);\n continue;\n }\n if (c < 2048) {\n bytes += makeByte(c >> 6 | 192);\n } else {\n if (c > 0xd7ff && c < 0xdc00) {\n if (++ci == s.length) return null;\n var c2 = s.charCodeAt(ci);\n if (c2 < 0xdc00 || c2 > 0xdfff) return null;\n c = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff);\n bytes += makeByte(c >> 18 | 240);\n bytes += makeByte(c >> 12 & 63 | 128);\n } else {\n // c <= 0xffff\n bytes += makeByte(c >> 12 | 224);\n }\n bytes += makeByte(c >> 6 & 63 | 128);\n }\n bytes += makeByte(c & 63 | 128);\n }\n return bytes;\n};\n\nvar toString = function toString(bytes) {\n var s = '';\n var i = 0;\n var l = length(bytes);\n while (i < l) {\n var c = at(bytes, i++);\n if (c > 127) {\n if (c > 191 && c < 224) {\n if (i >= l) return null;\n c = (c & 31) << 6 | at(bytes, i) & 63;\n } else if (c > 223 && c < 240) {\n if (i + 1 >= l) return null;\n c = (c & 15) << 12 | (at(bytes, i) & 63) << 6 | at(bytes, ++i) & 63;\n } else if (c > 239 && c < 248) {\n if (i + 2 >= l) return null;\n c = (c & 7) << 18 | (at(bytes, i) & 63) << 12 | (at(bytes, ++i) & 63) << 6 | at(bytes, ++i) & 63;\n } else return null;\n ++i;\n }\n if (c <= 0xffff) s += String.fromCharCode(c);else if (c <= 0x10ffff) {\n c -= 0x10000;\n s += String.fromCharCode(c >> 10 | 0xd800);\n s += String.fromCharCode(c & 0x3FF | 0xdc00);\n } else return null;\n }\n return s;\n};\n\nmodule.exports = {\n random: random,\n length: length,\n concat: concat,\n flatten: flatten,\n slice: slice,\n reverse: reverse,\n pad: pad,\n padRight: padRight,\n fromAscii: fromAscii,\n toAscii: toAscii,\n fromString: fromString,\n toString: toString,\n fromNumber: fromNumber,\n toNumber: toNumber,\n fromNat: fromNat,\n toNat: toNat,\n fromArray: fromArray,\n toArray: toArray,\n fromUint8Array: fromUint8Array,\n toUint8Array: toUint8Array\n};","// This was ported from https://github.com/emn178/js-sha3, with some minor\n// modifications and pruning. It is licensed under MIT:\n//\n// Copyright 2015-2016 Chen, Yi-Cyuan\n// \n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar HEX_CHARS = '0123456789abcdef'.split('');\nvar KECCAK_PADDING = [1, 256, 65536, 16777216];\nvar SHIFT = [0, 8, 16, 24];\nvar RC = [1, 0, 32898, 0, 32906, 2147483648, 2147516416, 2147483648, 32907, 0, 2147483649, 0, 2147516545, 2147483648, 32777, 2147483648, 138, 0, 136, 0, 2147516425, 0, 2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, 2147483648, 32771, 2147483648, 32770, 2147483648, 128, 2147483648, 32778, 0, 2147483658, 2147483648, 2147516545, 2147483648, 32896, 2147483648, 2147483649, 0, 2147516424, 2147483648];\n\nvar Keccak = function Keccak(bits) {\n return {\n blocks: [],\n reset: true,\n block: 0,\n start: 0,\n blockCount: 1600 - (bits << 1) >> 5,\n outputBlocks: bits >> 5,\n s: function (s) {\n return [].concat(s, s, s, s, s);\n }([0, 0, 0, 0, 0, 0, 0, 0, 0, 0])\n };\n};\n\nvar update = function update(state, message) {\n var length = message.length,\n blocks = state.blocks,\n byteCount = state.blockCount << 2,\n blockCount = state.blockCount,\n outputBlocks = state.outputBlocks,\n s = state.s,\n index = 0,\n i,\n code;\n\n // update\n while (index < length) {\n if (state.reset) {\n state.reset = false;\n blocks[0] = state.block;\n for (i = 1; i < blockCount + 1; ++i) {\n blocks[i] = 0;\n }\n }\n if (typeof message !== \"string\") {\n for (i = state.start; index < length && i < byteCount; ++index) {\n blocks[i >> 2] |= message[index] << SHIFT[i++ & 3];\n }\n } else {\n for (i = state.start; index < length && i < byteCount; ++index) {\n code = message.charCodeAt(index);\n if (code < 0x80) {\n blocks[i >> 2] |= code << SHIFT[i++ & 3];\n } else if (code < 0x800) {\n blocks[i >> 2] |= (0xc0 | code >> 6) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | code & 0x3f) << SHIFT[i++ & 3];\n } else if (code < 0xd800 || code >= 0xe000) {\n blocks[i >> 2] |= (0xe0 | code >> 12) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | code >> 6 & 0x3f) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | code & 0x3f) << SHIFT[i++ & 3];\n } else {\n code = 0x10000 + ((code & 0x3ff) << 10 | message.charCodeAt(++index) & 0x3ff);\n blocks[i >> 2] |= (0xf0 | code >> 18) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | code >> 12 & 0x3f) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | code >> 6 & 0x3f) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | code & 0x3f) << SHIFT[i++ & 3];\n }\n }\n }\n state.lastByteIndex = i;\n if (i >= byteCount) {\n state.start = i - byteCount;\n state.block = blocks[blockCount];\n for (i = 0; i < blockCount; ++i) {\n s[i] ^= blocks[i];\n }\n f(s);\n state.reset = true;\n } else {\n state.start = i;\n }\n }\n\n // finalize\n i = state.lastByteIndex;\n blocks[i >> 2] |= KECCAK_PADDING[i & 3];\n if (state.lastByteIndex === byteCount) {\n blocks[0] = blocks[blockCount];\n for (i = 1; i < blockCount + 1; ++i) {\n blocks[i] = 0;\n }\n }\n blocks[blockCount - 1] |= 0x80000000;\n for (i = 0; i < blockCount; ++i) {\n s[i] ^= blocks[i];\n }\n f(s);\n\n // toString\n var hex = '',\n i = 0,\n j = 0,\n block;\n while (j < outputBlocks) {\n for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {\n block = s[i];\n hex += HEX_CHARS[block >> 4 & 0x0F] + HEX_CHARS[block & 0x0F] + HEX_CHARS[block >> 12 & 0x0F] + HEX_CHARS[block >> 8 & 0x0F] + HEX_CHARS[block >> 20 & 0x0F] + HEX_CHARS[block >> 16 & 0x0F] + HEX_CHARS[block >> 28 & 0x0F] + HEX_CHARS[block >> 24 & 0x0F];\n }\n if (j % blockCount === 0) {\n f(s);\n i = 0;\n }\n }\n return \"0x\" + hex;\n};\n\nvar f = function f(s) {\n var h, l, n, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16, b17, b18, b19, b20, b21, b22, b23, b24, b25, b26, b27, b28, b29, b30, b31, b32, b33, b34, b35, b36, b37, b38, b39, b40, b41, b42, b43, b44, b45, b46, b47, b48, b49;\n\n for (n = 0; n < 48; n += 2) {\n c0 = s[0] ^ s[10] ^ s[20] ^ s[30] ^ s[40];\n c1 = s[1] ^ s[11] ^ s[21] ^ s[31] ^ s[41];\n c2 = s[2] ^ s[12] ^ s[22] ^ s[32] ^ s[42];\n c3 = s[3] ^ s[13] ^ s[23] ^ s[33] ^ s[43];\n c4 = s[4] ^ s[14] ^ s[24] ^ s[34] ^ s[44];\n c5 = s[5] ^ s[15] ^ s[25] ^ s[35] ^ s[45];\n c6 = s[6] ^ s[16] ^ s[26] ^ s[36] ^ s[46];\n c7 = s[7] ^ s[17] ^ s[27] ^ s[37] ^ s[47];\n c8 = s[8] ^ s[18] ^ s[28] ^ s[38] ^ s[48];\n c9 = s[9] ^ s[19] ^ s[29] ^ s[39] ^ s[49];\n\n h = c8 ^ (c2 << 1 | c3 >>> 31);\n l = c9 ^ (c3 << 1 | c2 >>> 31);\n s[0] ^= h;\n s[1] ^= l;\n s[10] ^= h;\n s[11] ^= l;\n s[20] ^= h;\n s[21] ^= l;\n s[30] ^= h;\n s[31] ^= l;\n s[40] ^= h;\n s[41] ^= l;\n h = c0 ^ (c4 << 1 | c5 >>> 31);\n l = c1 ^ (c5 << 1 | c4 >>> 31);\n s[2] ^= h;\n s[3] ^= l;\n s[12] ^= h;\n s[13] ^= l;\n s[22] ^= h;\n s[23] ^= l;\n s[32] ^= h;\n s[33] ^= l;\n s[42] ^= h;\n s[43] ^= l;\n h = c2 ^ (c6 << 1 | c7 >>> 31);\n l = c3 ^ (c7 << 1 | c6 >>> 31);\n s[4] ^= h;\n s[5] ^= l;\n s[14] ^= h;\n s[15] ^= l;\n s[24] ^= h;\n s[25] ^= l;\n s[34] ^= h;\n s[35] ^= l;\n s[44] ^= h;\n s[45] ^= l;\n h = c4 ^ (c8 << 1 | c9 >>> 31);\n l = c5 ^ (c9 << 1 | c8 >>> 31);\n s[6] ^= h;\n s[7] ^= l;\n s[16] ^= h;\n s[17] ^= l;\n s[26] ^= h;\n s[27] ^= l;\n s[36] ^= h;\n s[37] ^= l;\n s[46] ^= h;\n s[47] ^= l;\n h = c6 ^ (c0 << 1 | c1 >>> 31);\n l = c7 ^ (c1 << 1 | c0 >>> 31);\n s[8] ^= h;\n s[9] ^= l;\n s[18] ^= h;\n s[19] ^= l;\n s[28] ^= h;\n s[29] ^= l;\n s[38] ^= h;\n s[39] ^= l;\n s[48] ^= h;\n s[49] ^= l;\n\n b0 = s[0];\n b1 = s[1];\n b32 = s[11] << 4 | s[10] >>> 28;\n b33 = s[10] << 4 | s[11] >>> 28;\n b14 = s[20] << 3 | s[21] >>> 29;\n b15 = s[21] << 3 | s[20] >>> 29;\n b46 = s[31] << 9 | s[30] >>> 23;\n b47 = s[30] << 9 | s[31] >>> 23;\n b28 = s[40] << 18 | s[41] >>> 14;\n b29 = s[41] << 18 | s[40] >>> 14;\n b20 = s[2] << 1 | s[3] >>> 31;\n b21 = s[3] << 1 | s[2] >>> 31;\n b2 = s[13] << 12 | s[12] >>> 20;\n b3 = s[12] << 12 | s[13] >>> 20;\n b34 = s[22] << 10 | s[23] >>> 22;\n b35 = s[23] << 10 | s[22] >>> 22;\n b16 = s[33] << 13 | s[32] >>> 19;\n b17 = s[32] << 13 | s[33] >>> 19;\n b48 = s[42] << 2 | s[43] >>> 30;\n b49 = s[43] << 2 | s[42] >>> 30;\n b40 = s[5] << 30 | s[4] >>> 2;\n b41 = s[4] << 30 | s[5] >>> 2;\n b22 = s[14] << 6 | s[15] >>> 26;\n b23 = s[15] << 6 | s[14] >>> 26;\n b4 = s[25] << 11 | s[24] >>> 21;\n b5 = s[24] << 11 | s[25] >>> 21;\n b36 = s[34] << 15 | s[35] >>> 17;\n b37 = s[35] << 15 | s[34] >>> 17;\n b18 = s[45] << 29 | s[44] >>> 3;\n b19 = s[44] << 29 | s[45] >>> 3;\n b10 = s[6] << 28 | s[7] >>> 4;\n b11 = s[7] << 28 | s[6] >>> 4;\n b42 = s[17] << 23 | s[16] >>> 9;\n b43 = s[16] << 23 | s[17] >>> 9;\n b24 = s[26] << 25 | s[27] >>> 7;\n b25 = s[27] << 25 | s[26] >>> 7;\n b6 = s[36] << 21 | s[37] >>> 11;\n b7 = s[37] << 21 | s[36] >>> 11;\n b38 = s[47] << 24 | s[46] >>> 8;\n b39 = s[46] << 24 | s[47] >>> 8;\n b30 = s[8] << 27 | s[9] >>> 5;\n b31 = s[9] << 27 | s[8] >>> 5;\n b12 = s[18] << 20 | s[19] >>> 12;\n b13 = s[19] << 20 | s[18] >>> 12;\n b44 = s[29] << 7 | s[28] >>> 25;\n b45 = s[28] << 7 | s[29] >>> 25;\n b26 = s[38] << 8 | s[39] >>> 24;\n b27 = s[39] << 8 | s[38] >>> 24;\n b8 = s[48] << 14 | s[49] >>> 18;\n b9 = s[49] << 14 | s[48] >>> 18;\n\n s[0] = b0 ^ ~b2 & b4;\n s[1] = b1 ^ ~b3 & b5;\n s[10] = b10 ^ ~b12 & b14;\n s[11] = b11 ^ ~b13 & b15;\n s[20] = b20 ^ ~b22 & b24;\n s[21] = b21 ^ ~b23 & b25;\n s[30] = b30 ^ ~b32 & b34;\n s[31] = b31 ^ ~b33 & b35;\n s[40] = b40 ^ ~b42 & b44;\n s[41] = b41 ^ ~b43 & b45;\n s[2] = b2 ^ ~b4 & b6;\n s[3] = b3 ^ ~b5 & b7;\n s[12] = b12 ^ ~b14 & b16;\n s[13] = b13 ^ ~b15 & b17;\n s[22] = b22 ^ ~b24 & b26;\n s[23] = b23 ^ ~b25 & b27;\n s[32] = b32 ^ ~b34 & b36;\n s[33] = b33 ^ ~b35 & b37;\n s[42] = b42 ^ ~b44 & b46;\n s[43] = b43 ^ ~b45 & b47;\n s[4] = b4 ^ ~b6 & b8;\n s[5] = b5 ^ ~b7 & b9;\n s[14] = b14 ^ ~b16 & b18;\n s[15] = b15 ^ ~b17 & b19;\n s[24] = b24 ^ ~b26 & b28;\n s[25] = b25 ^ ~b27 & b29;\n s[34] = b34 ^ ~b36 & b38;\n s[35] = b35 ^ ~b37 & b39;\n s[44] = b44 ^ ~b46 & b48;\n s[45] = b45 ^ ~b47 & b49;\n s[6] = b6 ^ ~b8 & b0;\n s[7] = b7 ^ ~b9 & b1;\n s[16] = b16 ^ ~b18 & b10;\n s[17] = b17 ^ ~b19 & b11;\n s[26] = b26 ^ ~b28 & b20;\n s[27] = b27 ^ ~b29 & b21;\n s[36] = b36 ^ ~b38 & b30;\n s[37] = b37 ^ ~b39 & b31;\n s[46] = b46 ^ ~b48 & b40;\n s[47] = b47 ^ ~b49 & b41;\n s[8] = b8 ^ ~b0 & b2;\n s[9] = b9 ^ ~b1 & b3;\n s[18] = b18 ^ ~b10 & b12;\n s[19] = b19 ^ ~b11 & b13;\n s[28] = b28 ^ ~b20 & b22;\n s[29] = b29 ^ ~b21 & b23;\n s[38] = b38 ^ ~b30 & b32;\n s[39] = b39 ^ ~b31 & b33;\n s[48] = b48 ^ ~b40 & b42;\n s[49] = b49 ^ ~b41 & b43;\n\n s[0] ^= RC[n];\n s[1] ^= RC[n + 1];\n }\n};\n\nvar keccak = function keccak(bits) {\n return function (str) {\n var msg;\n if (str.slice(0, 2) === \"0x\") {\n msg = [];\n for (var i = 2, l = str.length; i < l; i += 2) {\n msg.push(parseInt(str.slice(i, i + 2), 16));\n }\n } else {\n msg = str;\n }\n return update(Keccak(bits, bits), msg);\n };\n};\n\nmodule.exports = {\n keccak256: keccak(256),\n keccak512: keccak(512),\n keccak256s: keccak(256),\n keccak512s: keccak(512)\n};","'use strict';\n\n/* eslint-disable */\n\nvar utils = require('./utils/index.js');\nvar uint256Coder = utils.uint256Coder;\nvar coderBoolean = utils.coderBoolean;\nvar coderFixedBytes = utils.coderFixedBytes;\nvar coderAddress = utils.coderAddress;\nvar coderDynamicBytes = utils.coderDynamicBytes;\nvar coderString = utils.coderString;\nvar coderArray = utils.coderArray;\nvar paramTypePart = utils.paramTypePart;\nvar getParamCoder = utils.getParamCoder;\n\nfunction Result() {}\n\nfunction encodeParams(types, values) {\n if (types.length !== values.length) {\n throw new Error('[ethjs-abi] while encoding params, types/values mismatch, types length ' + types.length + ' should be ' + values.length);\n }\n\n var parts = [];\n\n types.forEach(function (type, index) {\n var coder = getParamCoder(type);\n parts.push({ dynamic: coder.dynamic, value: coder.encode(values[index]) });\n });\n\n function alignSize(size) {\n return parseInt(32 * Math.ceil(size / 32));\n }\n\n var staticSize = 0,\n dynamicSize = 0;\n parts.forEach(function (part) {\n if (part.dynamic) {\n staticSize += 32;\n dynamicSize += alignSize(part.value.length);\n } else {\n staticSize += alignSize(part.value.length);\n }\n });\n\n var offset = 0,\n dynamicOffset = staticSize;\n var data = new Buffer(staticSize + dynamicSize);\n\n parts.forEach(function (part, index) {\n if (part.dynamic) {\n uint256Coder.encode(dynamicOffset).copy(data, offset);\n offset += 32;\n\n part.value.copy(data, dynamicOffset);\n dynamicOffset += alignSize(part.value.length);\n } else {\n part.value.copy(data, offset);\n offset += alignSize(part.value.length);\n }\n });\n\n return '0x' + data.toString('hex');\n}\n\n// decode bytecode data from output names and types\nfunction decodeParams(names, types, data) {\n // Names is optional, so shift over all the parameters if not provided\n if (arguments.length < 3) {\n data = types;\n types = names;\n names = [];\n }\n\n data = utils.hexOrBuffer(data);\n var values = new Result();\n\n var offset = 0;\n types.forEach(function (type, index) {\n var coder = getParamCoder(type);\n if (coder.dynamic) {\n var dynamicOffset = uint256Coder.decode(data, offset);\n var result = coder.decode(data, dynamicOffset.value.toNumber());\n offset += dynamicOffset.consumed;\n } else {\n var result = coder.decode(data, offset);\n offset += result.consumed;\n }\n values[index] = result.value;\n if (names[index]) {\n values[names[index]] = result.value;\n }\n });\n return values;\n}\n\n// encode method ABI object with values in an array, output bytecode\nfunction encodeMethod(method, values) {\n var signature = method.name + '(' + utils.getKeys(method.inputs, 'type').join(',') + ')';\n var signatureEncoded = '0x' + new Buffer(utils.keccak256(signature), 'hex').slice(0, 4).toString('hex');\n var paramsEncoded = encodeParams(utils.getKeys(method.inputs, 'type'), values).substring(2);\n\n return '' + signatureEncoded + paramsEncoded;\n}\n\n// decode method data bytecode, from method ABI object\nfunction decodeMethod(method, data) {\n var outputNames = utils.getKeys(method.outputs, 'name', true);\n var outputTypes = utils.getKeys(method.outputs, 'type');\n\n return decodeParams(outputNames, outputTypes, utils.hexOrBuffer(data));\n}\n\n// decode method data bytecode, from method ABI object\nfunction encodeEvent(eventObject, values) {\n return encodeMethod(eventObject, values);\n}\n\n// decode method data bytecode, from method ABI object\nfunction decodeEvent(eventObject, data) {\n var inputNames = utils.getKeys(eventObject.inputs, 'name', true);\n var inputTypes = utils.getKeys(eventObject.inputs, 'type');\n\n return decodeParams(inputNames, inputTypes, utils.hexOrBuffer(data));\n}\n\nmodule.exports = {\n encodeParams: encodeParams,\n decodeParams: decodeParams,\n encodeMethod: encodeMethod,\n decodeMethod: decodeMethod,\n encodeEvent: encodeEvent,\n decodeEvent: decodeEvent\n};","'use strict';\n\nvar BN = require('bn.js');\nvar numberToBN = require('number-to-bn');\nvar keccak256 = require('js-sha3').keccak_256;\n\n// from ethereumjs-util\nfunction stripZeros(aInput) {\n var a = aInput; // eslint-disable-line\n var first = a[0]; // eslint-disable-line\n while (a.length > 0 && first.toString() === '0') {\n a = a.slice(1);\n first = a[0];\n }\n return a;\n}\n\nfunction bnToBuffer(bnInput) {\n var bn = bnInput; // eslint-disable-line\n var hex = bn.toString(16); // eslint-disable-line\n if (hex.length % 2) {\n hex = '0' + hex;\n }\n return stripZeros(new Buffer(hex, 'hex'));\n}\n\nfunction isHexString(value, length) {\n if (typeof value !== 'string' || !value.match(/^0x[0-9A-Fa-f]*$/)) {\n return false;\n }\n if (length && value.length !== 2 + 2 * length) {\n return false;\n }\n return true;\n}\n\nfunction hexOrBuffer(valueInput, name) {\n var value = valueInput; // eslint-disable-line\n if (!Buffer.isBuffer(value)) {\n if (!isHexString(value)) {\n var error = new Error(name ? '[ethjs-abi] invalid ' + name : '[ethjs-abi] invalid hex or buffer, must be a prefixed alphanumeric even length hex string');\n error.reason = '[ethjs-abi] invalid hex string, hex must be prefixed and alphanumeric (e.g. 0x023..)';\n error.value = value;\n throw error;\n }\n\n value = value.substring(2);\n if (value.length % 2) {\n value = '0' + value;\n }\n value = new Buffer(value, 'hex');\n }\n\n return value;\n}\n\nfunction hexlify(value) {\n if (typeof value === 'number') {\n return '0x' + bnToBuffer(new BN(value)).toString('hex');\n } else if (value.mod || value.modulo) {\n return '0x' + bnToBuffer(value).toString('hex');\n } else {\n // eslint-disable-line\n return '0x' + hexOrBuffer(value).toString('hex');\n }\n}\n\n// getKeys([{a: 1, b: 2}, {a: 3, b: 4}], 'a') => [1, 3]\nfunction getKeys(params, key, allowEmpty) {\n var result = []; // eslint-disable-line\n\n if (!Array.isArray(params)) {\n throw new Error('[ethjs-abi] while getting keys, invalid params value ' + JSON.stringify(params));\n }\n\n for (var i = 0; i < params.length; i++) {\n // eslint-disable-line\n var value = params[i][key]; // eslint-disable-line\n if (allowEmpty && !value) {\n value = '';\n } else if (typeof value !== 'string') {\n throw new Error('[ethjs-abi] while getKeys found invalid ABI data structure, type value not string');\n }\n result.push(value);\n }\n\n return result;\n}\n\nfunction coderNumber(size, signed) {\n return {\n encode: function encodeNumber(valueInput) {\n var value = valueInput; // eslint-disable-line\n\n if (typeof value === 'object' && value.toString && (value.toTwos || value.dividedToIntegerBy)) {\n value = value.toString(10).split('.')[0];\n }\n\n if (typeof value === 'string' || typeof value === 'number') {\n value = String(value).split('.')[0];\n }\n\n value = numberToBN(value);\n value = value.toTwos(size * 8).maskn(size * 8);\n if (signed) {\n value = value.fromTwos(size * 8).toTwos(256);\n }\n return value.toArrayLike(Buffer, 'be', 32);\n },\n decode: function decodeNumber(data, offset) {\n var junkLength = 32 - size; // eslint-disable-line\n var value = new BN(data.slice(offset + junkLength, offset + 32)); // eslint-disable-line\n if (signed) {\n value = value.fromTwos(size * 8);\n } else {\n value = value.maskn(size * 8);\n }\n return {\n consumed: 32,\n value: new BN(value.toString(10))\n };\n }\n };\n}\nvar uint256Coder = coderNumber(32, false);\n\nvar coderBoolean = {\n encode: function encodeBoolean(value) {\n return uint256Coder.encode(value ? 1 : 0);\n },\n decode: function decodeBoolean(data, offset) {\n var result = uint256Coder.decode(data, offset); // eslint-disable-line\n return {\n consumed: result.consumed,\n value: !result.value.isZero()\n };\n }\n};\n\nfunction coderFixedBytes(length) {\n return {\n encode: function encodeFixedBytes(valueInput) {\n var value = valueInput; // eslint-disable-line\n value = hexOrBuffer(value);\n\n if (value.length === 32) {\n return value;\n }\n\n var result = new Buffer(32); // eslint-disable-line\n result.fill(0);\n value.copy(result);\n return result;\n },\n decode: function decodeFixedBytes(data, offset) {\n if (data.length < offset + 32) {\n throw new Error('[ethjs-abi] while decoding fixed bytes, invalid bytes data length: ' + length);\n }\n\n return {\n consumed: 32,\n value: '0x' + data.slice(offset, offset + length).toString('hex')\n };\n }\n };\n}\n\nvar coderAddress = {\n encode: function encodeAddress(valueInput) {\n var value = valueInput; // eslint-disable-line\n var result = new Buffer(32); // eslint-disable-line\n if (!isHexString(value, 20)) {\n throw new Error('[ethjs-abi] while encoding address, invalid address value, not alphanumeric 20 byte hex string');\n }\n value = hexOrBuffer(value);\n result.fill(0);\n value.copy(result, 12);\n return result;\n },\n decode: function decodeAddress(data, offset) {\n if (data.length === 0) {\n return {\n consumed: 32,\n value: '0x'\n };\n }\n if (data.length < offset + 32) {\n throw new Error('[ethjs-abi] while decoding address data, invalid address data, invalid byte length ' + data.length);\n }\n return {\n consumed: 32,\n value: '0x' + data.slice(offset + 12, offset + 32).toString('hex')\n };\n }\n};\n\nfunction encodeDynamicBytesHelper(value) {\n var dataLength = parseInt(32 * Math.ceil(value.length / 32)); // eslint-disable-line\n var padding = new Buffer(dataLength - value.length); // eslint-disable-line\n padding.fill(0);\n\n return Buffer.concat([uint256Coder.encode(value.length), value, padding]);\n}\n\nfunction decodeDynamicBytesHelper(data, offset) {\n if (data.length < offset + 32) {\n throw new Error('[ethjs-abi] while decoding dynamic bytes data, invalid bytes length: ' + data.length + ' should be less than ' + (offset + 32));\n }\n\n var length = uint256Coder.decode(data, offset).value; // eslint-disable-line\n length = length.toNumber();\n if (data.length < offset + 32 + length) {\n throw new Error('[ethjs-abi] while decoding dynamic bytes data, invalid bytes length: ' + data.length + ' should be less than ' + (offset + 32 + length));\n }\n\n return {\n consumed: parseInt(32 + 32 * Math.ceil(length / 32), 10),\n value: data.slice(offset + 32, offset + 32 + length)\n };\n}\n\nvar coderDynamicBytes = {\n encode: function encodeDynamicBytes(value) {\n return encodeDynamicBytesHelper(hexOrBuffer(value));\n },\n decode: function decodeDynamicBytes(data, offset) {\n var result = decodeDynamicBytesHelper(data, offset); // eslint-disable-line\n result.value = '0x' + result.value.toString('hex');\n return result;\n },\n dynamic: true\n};\n\nvar coderString = {\n encode: function encodeString(value) {\n return encodeDynamicBytesHelper(new Buffer(value, 'utf8'));\n },\n decode: function decodeString(data, offset) {\n var result = decodeDynamicBytesHelper(data, offset); // eslint-disable-line\n result.value = result.value.toString('utf8');\n return result;\n },\n dynamic: true\n};\n\nfunction coderArray(coder, lengthInput) {\n return {\n encode: function encodeArray(value) {\n var result = new Buffer(0); // eslint-disable-line\n var length = lengthInput; // eslint-disable-line\n\n if (!Array.isArray(value)) {\n throw new Error('[ethjs-abi] while encoding array, invalid array data, not type Object (Array)');\n }\n\n if (length === -1) {\n length = value.length;\n result = uint256Coder.encode(length);\n }\n\n if (length !== value.length) {\n throw new Error('[ethjs-abi] while encoding array, size mismatch array length ' + length + ' does not equal ' + value.length);\n }\n\n value.forEach(function (resultValue) {\n result = Buffer.concat([result, coder.encode(resultValue)]);\n });\n\n return result;\n },\n decode: function decodeArray(data, offsetInput) {\n var length = lengthInput; // eslint-disable-line\n var offset = offsetInput; // eslint-disable-line\n // @TODO:\n // if (data.length < offset + length * 32) { throw new Error('invalid array'); }\n\n var consumed = 0; // eslint-disable-line\n var decodeResult; // eslint-disable-line\n\n if (length === -1) {\n decodeResult = uint256Coder.decode(data, offset);\n length = decodeResult.value.toNumber();\n consumed += decodeResult.consumed;\n offset += decodeResult.consumed;\n }\n\n var value = []; // eslint-disable-line\n\n for (var i = 0; i < length; i++) {\n // eslint-disable-line\n var loopResult = coder.decode(data, offset);\n consumed += loopResult.consumed;\n offset += loopResult.consumed;\n value.push(loopResult.value);\n }\n\n return {\n consumed: consumed,\n value: value\n };\n },\n dynamic: lengthInput === -1\n };\n}\n\n// Break the type up into [staticType][staticArray]*[dynamicArray]? | [dynamicType] and\n// build the coder up from its parts\nvar paramTypePart = new RegExp(/^((u?int|bytes)([0-9]*)|(address|bool|string)|(\\[([0-9]*)\\]))/);\n\nfunction getParamCoder(typeInput) {\n var type = typeInput; // eslint-disable-line\n var coder = null; // eslint-disable-line\n var invalidTypeErrorMessage = '[ethjs-abi] while getting param coder (getParamCoder) type value ' + JSON.stringify(type) + ' is either invalid or unsupported by ethjs-abi.';\n\n while (type) {\n var part = type.match(paramTypePart); // eslint-disable-line\n if (!part) {\n throw new Error(invalidTypeErrorMessage);\n }\n type = type.substring(part[0].length);\n\n var prefix = part[2] || part[4] || part[5]; // eslint-disable-line\n switch (prefix) {\n case 'int':case 'uint':\n if (coder) {\n throw new Error(invalidTypeErrorMessage);\n }\n var intSize = parseInt(part[3] || 256); // eslint-disable-line\n if (intSize === 0 || intSize > 256 || intSize % 8 !== 0) {\n throw new Error('[ethjs-abi] while getting param coder for type ' + type + ', invalid ' + prefix + ' width: ' + type);\n }\n\n coder = coderNumber(intSize / 8, prefix === 'int');\n break;\n\n case 'bool':\n if (coder) {\n throw new Error(invalidTypeErrorMessage);\n }\n coder = coderBoolean;\n break;\n\n case 'string':\n if (coder) {\n throw new Error(invalidTypeErrorMessage);\n }\n coder = coderString;\n break;\n\n case 'bytes':\n if (coder) {\n throw new Error(invalidTypeErrorMessage);\n }\n if (part[3]) {\n var size = parseInt(part[3]); // eslint-disable-line\n if (size === 0 || size > 32) {\n throw new Error('[ethjs-abi] while getting param coder for prefix bytes, invalid type ' + type + ', size ' + size + ' should be 0 or greater than 32');\n }\n coder = coderFixedBytes(size);\n } else {\n coder = coderDynamicBytes;\n }\n break;\n\n case 'address':\n if (coder) {\n throw new Error(invalidTypeErrorMessage);\n }\n coder = coderAddress;\n break;\n\n case '[]':\n if (!coder || coder.dynamic) {\n throw new Error(invalidTypeErrorMessage);\n }\n coder = coderArray(coder, -1);\n break;\n\n // \"[0-9+]\"\n default:\n if (!coder || coder.dynamic) {\n throw new Error(invalidTypeErrorMessage);\n }\n var defaultSize = parseInt(part[6]); // eslint-disable-line\n coder = coderArray(coder, defaultSize);\n }\n }\n\n if (!coder) {\n throw new Error(invalidTypeErrorMessage);\n }\n return coder;\n}\n\nmodule.exports = {\n BN: BN,\n bnToBuffer: bnToBuffer,\n isHexString: isHexString,\n hexOrBuffer: hexOrBuffer,\n hexlify: hexlify,\n stripZeros: stripZeros,\n\n keccak256: keccak256,\n\n getKeys: getKeys,\n numberToBN: numberToBN,\n coderNumber: coderNumber,\n uint256Coder: uint256Coder,\n coderBoolean: coderBoolean,\n coderFixedBytes: coderFixedBytes,\n coderAddress: coderAddress,\n coderDynamicBytes: coderDynamicBytes,\n coderString: coderString,\n coderArray: coderArray,\n paramTypePart: paramTypePart,\n getParamCoder: getParamCoder\n};","(function (module, exports) {\n 'use strict';\n\n // Utils\n function assert (val, msg) {\n if (!val) throw new Error(msg || 'Assertion failed');\n }\n\n // Could use `inherits` module, but don't want to move from single file\n // architecture yet.\n function inherits (ctor, superCtor) {\n ctor.super_ = superCtor;\n var TempCtor = function () {};\n TempCtor.prototype = superCtor.prototype;\n ctor.prototype = new TempCtor();\n ctor.prototype.constructor = ctor;\n }\n\n // BN\n\n function BN (number, base, endian) {\n if (BN.isBN(number)) {\n return number;\n }\n\n this.negative = 0;\n this.words = null;\n this.length = 0;\n\n // Reduction context\n this.red = null;\n\n if (number !== null) {\n if (base === 'le' || base === 'be') {\n endian = base;\n base = 10;\n }\n\n this._init(number || 0, base || 10, endian || 'be');\n }\n }\n if (typeof module === 'object') {\n module.exports = BN;\n } else {\n exports.BN = BN;\n }\n\n BN.BN = BN;\n BN.wordSize = 26;\n\n var Buffer;\n try {\n Buffer = require('buf' + 'fer').Buffer;\n } catch (e) {\n }\n\n BN.isBN = function isBN (num) {\n if (num instanceof BN) {\n return true;\n }\n\n return num !== null && typeof num === 'object' &&\n num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);\n };\n\n BN.max = function max (left, right) {\n if (left.cmp(right) > 0) return left;\n return right;\n };\n\n BN.min = function min (left, right) {\n if (left.cmp(right) < 0) return left;\n return right;\n };\n\n BN.prototype._init = function init (number, base, endian) {\n if (typeof number === 'number') {\n return this._initNumber(number, base, endian);\n }\n\n if (typeof number === 'object') {\n return this._initArray(number, base, endian);\n }\n\n if (base === 'hex') {\n base = 16;\n }\n assert(base === (base | 0) && base >= 2 && base <= 36);\n\n number = number.toString().replace(/\\s+/g, '');\n var start = 0;\n if (number[0] === '-') {\n start++;\n }\n\n if (base === 16) {\n this._parseHex(number, start);\n } else {\n this._parseBase(number, base, start);\n }\n\n if (number[0] === '-') {\n this.negative = 1;\n }\n\n this.strip();\n\n if (endian !== 'le') return;\n\n this._initArray(this.toArray(), base, endian);\n };\n\n BN.prototype._initNumber = function _initNumber (number, base, endian) {\n if (number < 0) {\n this.negative = 1;\n number = -number;\n }\n if (number < 0x4000000) {\n this.words = [ number & 0x3ffffff ];\n this.length = 1;\n } else if (number < 0x10000000000000) {\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff\n ];\n this.length = 2;\n } else {\n assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff,\n 1\n ];\n this.length = 3;\n }\n\n if (endian !== 'le') return;\n\n // Reverse the bytes\n this._initArray(this.toArray(), base, endian);\n };\n\n BN.prototype._initArray = function _initArray (number, base, endian) {\n // Perhaps a Uint8Array\n assert(typeof number.length === 'number');\n if (number.length <= 0) {\n this.words = [ 0 ];\n this.length = 1;\n return this;\n }\n\n this.length = Math.ceil(number.length / 3);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n var j, w;\n var off = 0;\n if (endian === 'be') {\n for (i = number.length - 1, j = 0; i >= 0; i -= 3) {\n w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n } else if (endian === 'le') {\n for (i = 0, j = 0; i < number.length; i += 3) {\n w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n }\n return this.strip();\n };\n\n function parseHex (str, start, end) {\n var r = 0;\n var len = Math.min(str.length, end);\n for (var i = start; i < len; i++) {\n var c = str.charCodeAt(i) - 48;\n\n r <<= 4;\n\n // 'a' - 'f'\n if (c >= 49 && c <= 54) {\n r |= c - 49 + 0xa;\n\n // 'A' - 'F'\n } else if (c >= 17 && c <= 22) {\n r |= c - 17 + 0xa;\n\n // '0' - '9'\n } else {\n r |= c & 0xf;\n }\n }\n return r;\n }\n\n BN.prototype._parseHex = function _parseHex (number, start) {\n // Create possibly bigger array to ensure that it fits the number\n this.length = Math.ceil((number.length - start) / 6);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n var j, w;\n // Scan 24-bit chunks and add them to the number\n var off = 0;\n for (i = number.length - 6, j = 0; i >= start; i -= 6) {\n w = parseHex(number, i, i + 6);\n this.words[j] |= (w << off) & 0x3ffffff;\n // NOTE: `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb\n this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n if (i + 6 !== start) {\n w = parseHex(number, start, i + 6);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;\n }\n this.strip();\n };\n\n function parseBase (str, start, end, mul) {\n var r = 0;\n var len = Math.min(str.length, end);\n for (var i = start; i < len; i++) {\n var c = str.charCodeAt(i) - 48;\n\n r *= mul;\n\n // 'a'\n if (c >= 49) {\n r += c - 49 + 0xa;\n\n // 'A'\n } else if (c >= 17) {\n r += c - 17 + 0xa;\n\n // '0' - '9'\n } else {\n r += c;\n }\n }\n return r;\n }\n\n BN.prototype._parseBase = function _parseBase (number, base, start) {\n // Initialize as zero\n this.words = [ 0 ];\n this.length = 1;\n\n // Find length of limb in base\n for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {\n limbLen++;\n }\n limbLen--;\n limbPow = (limbPow / base) | 0;\n\n var total = number.length - start;\n var mod = total % limbLen;\n var end = Math.min(total, total - mod) + start;\n\n var word = 0;\n for (var i = start; i < end; i += limbLen) {\n word = parseBase(number, i, i + limbLen, base);\n\n this.imuln(limbPow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n if (mod !== 0) {\n var pow = 1;\n word = parseBase(number, i, number.length, base);\n\n for (i = 0; i < mod; i++) {\n pow *= base;\n }\n\n this.imuln(pow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n };\n\n BN.prototype.copy = function copy (dest) {\n dest.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n dest.words[i] = this.words[i];\n }\n dest.length = this.length;\n dest.negative = this.negative;\n dest.red = this.red;\n };\n\n BN.prototype.clone = function clone () {\n var r = new BN(null);\n this.copy(r);\n return r;\n };\n\n BN.prototype._expand = function _expand (size) {\n while (this.length < size) {\n this.words[this.length++] = 0;\n }\n return this;\n };\n\n // Remove leading `0` from `this`\n BN.prototype.strip = function strip () {\n while (this.length > 1 && this.words[this.length - 1] === 0) {\n this.length--;\n }\n return this._normSign();\n };\n\n BN.prototype._normSign = function _normSign () {\n // -0 = 0\n if (this.length === 1 && this.words[0] === 0) {\n this.negative = 0;\n }\n return this;\n };\n\n BN.prototype.inspect = function inspect () {\n return (this.red ? '';\n };\n\n /*\n\n var zeros = [];\n var groupSizes = [];\n var groupBases = [];\n\n var s = '';\n var i = -1;\n while (++i < BN.wordSize) {\n zeros[i] = s;\n s += '0';\n }\n groupSizes[0] = 0;\n groupSizes[1] = 0;\n groupBases[0] = 0;\n groupBases[1] = 0;\n var base = 2 - 1;\n while (++base < 36 + 1) {\n var groupSize = 0;\n var groupBase = 1;\n while (groupBase < (1 << BN.wordSize) / base) {\n groupBase *= base;\n groupSize += 1;\n }\n groupSizes[base] = groupSize;\n groupBases[base] = groupBase;\n }\n\n */\n\n var zeros = [\n '',\n '0',\n '00',\n '000',\n '0000',\n '00000',\n '000000',\n '0000000',\n '00000000',\n '000000000',\n '0000000000',\n '00000000000',\n '000000000000',\n '0000000000000',\n '00000000000000',\n '000000000000000',\n '0000000000000000',\n '00000000000000000',\n '000000000000000000',\n '0000000000000000000',\n '00000000000000000000',\n '000000000000000000000',\n '0000000000000000000000',\n '00000000000000000000000',\n '000000000000000000000000',\n '0000000000000000000000000'\n ];\n\n var groupSizes = [\n 0, 0,\n 25, 16, 12, 11, 10, 9, 8,\n 8, 7, 7, 7, 7, 6, 6,\n 6, 6, 6, 6, 6, 5, 5,\n 5, 5, 5, 5, 5, 5, 5,\n 5, 5, 5, 5, 5, 5, 5\n ];\n\n var groupBases = [\n 0, 0,\n 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,\n 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,\n 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,\n 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,\n 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176\n ];\n\n BN.prototype.toString = function toString (base, padding) {\n base = base || 10;\n padding = padding | 0 || 1;\n\n var out;\n if (base === 16 || base === 'hex') {\n out = '';\n var off = 0;\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = this.words[i];\n var word = (((w << off) | carry) & 0xffffff).toString(16);\n carry = (w >>> (24 - off)) & 0xffffff;\n if (carry !== 0 || i !== this.length - 1) {\n out = zeros[6 - word.length] + word + out;\n } else {\n out = word + out;\n }\n off += 2;\n if (off >= 26) {\n off -= 26;\n i--;\n }\n }\n if (carry !== 0) {\n out = carry.toString(16) + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n if (base === (base | 0) && base >= 2 && base <= 36) {\n // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));\n var groupSize = groupSizes[base];\n // var groupBase = Math.pow(base, groupSize);\n var groupBase = groupBases[base];\n out = '';\n var c = this.clone();\n c.negative = 0;\n while (!c.isZero()) {\n var r = c.modn(groupBase).toString(base);\n c = c.idivn(groupBase);\n\n if (!c.isZero()) {\n out = zeros[groupSize - r.length] + r + out;\n } else {\n out = r + out;\n }\n }\n if (this.isZero()) {\n out = '0' + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n assert(false, 'Base should be between 2 and 36');\n };\n\n BN.prototype.toNumber = function toNumber () {\n var ret = this.words[0];\n if (this.length === 2) {\n ret += this.words[1] * 0x4000000;\n } else if (this.length === 3 && this.words[2] === 0x01) {\n // NOTE: at this stage it is known that the top bit is set\n ret += 0x10000000000000 + (this.words[1] * 0x4000000);\n } else if (this.length > 2) {\n assert(false, 'Number can only safely store up to 53 bits');\n }\n return (this.negative !== 0) ? -ret : ret;\n };\n\n BN.prototype.toJSON = function toJSON () {\n return this.toString(16);\n };\n\n BN.prototype.toBuffer = function toBuffer (endian, length) {\n assert(typeof Buffer !== 'undefined');\n return this.toArrayLike(Buffer, endian, length);\n };\n\n BN.prototype.toArray = function toArray (endian, length) {\n return this.toArrayLike(Array, endian, length);\n };\n\n BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {\n var byteLength = this.byteLength();\n var reqLength = length || Math.max(1, byteLength);\n assert(byteLength <= reqLength, 'byte array longer than desired length');\n assert(reqLength > 0, 'Requested array length <= 0');\n\n this.strip();\n var littleEndian = endian === 'le';\n var res = new ArrayType(reqLength);\n\n var b, i;\n var q = this.clone();\n if (!littleEndian) {\n // Assume big-endian\n for (i = 0; i < reqLength - byteLength; i++) {\n res[i] = 0;\n }\n\n for (i = 0; !q.isZero(); i++) {\n b = q.andln(0xff);\n q.iushrn(8);\n\n res[reqLength - i - 1] = b;\n }\n } else {\n for (i = 0; !q.isZero(); i++) {\n b = q.andln(0xff);\n q.iushrn(8);\n\n res[i] = b;\n }\n\n for (; i < reqLength; i++) {\n res[i] = 0;\n }\n }\n\n return res;\n };\n\n if (Math.clz32) {\n BN.prototype._countBits = function _countBits (w) {\n return 32 - Math.clz32(w);\n };\n } else {\n BN.prototype._countBits = function _countBits (w) {\n var t = w;\n var r = 0;\n if (t >= 0x1000) {\n r += 13;\n t >>>= 13;\n }\n if (t >= 0x40) {\n r += 7;\n t >>>= 7;\n }\n if (t >= 0x8) {\n r += 4;\n t >>>= 4;\n }\n if (t >= 0x02) {\n r += 2;\n t >>>= 2;\n }\n return r + t;\n };\n }\n\n BN.prototype._zeroBits = function _zeroBits (w) {\n // Short-cut\n if (w === 0) return 26;\n\n var t = w;\n var r = 0;\n if ((t & 0x1fff) === 0) {\n r += 13;\n t >>>= 13;\n }\n if ((t & 0x7f) === 0) {\n r += 7;\n t >>>= 7;\n }\n if ((t & 0xf) === 0) {\n r += 4;\n t >>>= 4;\n }\n if ((t & 0x3) === 0) {\n r += 2;\n t >>>= 2;\n }\n if ((t & 0x1) === 0) {\n r++;\n }\n return r;\n };\n\n // Return number of used bits in a BN\n BN.prototype.bitLength = function bitLength () {\n var w = this.words[this.length - 1];\n var hi = this._countBits(w);\n return (this.length - 1) * 26 + hi;\n };\n\n function toBitArray (num) {\n var w = new Array(num.bitLength());\n\n for (var bit = 0; bit < w.length; bit++) {\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n w[bit] = (num.words[off] & (1 << wbit)) >>> wbit;\n }\n\n return w;\n }\n\n // Number of trailing zero bits\n BN.prototype.zeroBits = function zeroBits () {\n if (this.isZero()) return 0;\n\n var r = 0;\n for (var i = 0; i < this.length; i++) {\n var b = this._zeroBits(this.words[i]);\n r += b;\n if (b !== 26) break;\n }\n return r;\n };\n\n BN.prototype.byteLength = function byteLength () {\n return Math.ceil(this.bitLength() / 8);\n };\n\n BN.prototype.toTwos = function toTwos (width) {\n if (this.negative !== 0) {\n return this.abs().inotn(width).iaddn(1);\n }\n return this.clone();\n };\n\n BN.prototype.fromTwos = function fromTwos (width) {\n if (this.testn(width - 1)) {\n return this.notn(width).iaddn(1).ineg();\n }\n return this.clone();\n };\n\n BN.prototype.isNeg = function isNeg () {\n return this.negative !== 0;\n };\n\n // Return negative clone of `this`\n BN.prototype.neg = function neg () {\n return this.clone().ineg();\n };\n\n BN.prototype.ineg = function ineg () {\n if (!this.isZero()) {\n this.negative ^= 1;\n }\n\n return this;\n };\n\n // Or `num` with `this` in-place\n BN.prototype.iuor = function iuor (num) {\n while (this.length < num.length) {\n this.words[this.length++] = 0;\n }\n\n for (var i = 0; i < num.length; i++) {\n this.words[i] = this.words[i] | num.words[i];\n }\n\n return this.strip();\n };\n\n BN.prototype.ior = function ior (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuor(num);\n };\n\n // Or `num` with `this`\n BN.prototype.or = function or (num) {\n if (this.length > num.length) return this.clone().ior(num);\n return num.clone().ior(this);\n };\n\n BN.prototype.uor = function uor (num) {\n if (this.length > num.length) return this.clone().iuor(num);\n return num.clone().iuor(this);\n };\n\n // And `num` with `this` in-place\n BN.prototype.iuand = function iuand (num) {\n // b = min-length(num, this)\n var b;\n if (this.length > num.length) {\n b = num;\n } else {\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = this.words[i] & num.words[i];\n }\n\n this.length = b.length;\n\n return this.strip();\n };\n\n BN.prototype.iand = function iand (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuand(num);\n };\n\n // And `num` with `this`\n BN.prototype.and = function and (num) {\n if (this.length > num.length) return this.clone().iand(num);\n return num.clone().iand(this);\n };\n\n BN.prototype.uand = function uand (num) {\n if (this.length > num.length) return this.clone().iuand(num);\n return num.clone().iuand(this);\n };\n\n // Xor `num` with `this` in-place\n BN.prototype.iuxor = function iuxor (num) {\n // a.length > b.length\n var a;\n var b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = a.words[i] ^ b.words[i];\n }\n\n if (this !== a) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = a.length;\n\n return this.strip();\n };\n\n BN.prototype.ixor = function ixor (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuxor(num);\n };\n\n // Xor `num` with `this`\n BN.prototype.xor = function xor (num) {\n if (this.length > num.length) return this.clone().ixor(num);\n return num.clone().ixor(this);\n };\n\n BN.prototype.uxor = function uxor (num) {\n if (this.length > num.length) return this.clone().iuxor(num);\n return num.clone().iuxor(this);\n };\n\n // Not ``this`` with ``width`` bitwidth\n BN.prototype.inotn = function inotn (width) {\n assert(typeof width === 'number' && width >= 0);\n\n var bytesNeeded = Math.ceil(width / 26) | 0;\n var bitsLeft = width % 26;\n\n // Extend the buffer with leading zeroes\n this._expand(bytesNeeded);\n\n if (bitsLeft > 0) {\n bytesNeeded--;\n }\n\n // Handle complete words\n for (var i = 0; i < bytesNeeded; i++) {\n this.words[i] = ~this.words[i] & 0x3ffffff;\n }\n\n // Handle the residue\n if (bitsLeft > 0) {\n this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));\n }\n\n // And remove leading zeroes\n return this.strip();\n };\n\n BN.prototype.notn = function notn (width) {\n return this.clone().inotn(width);\n };\n\n // Set `bit` of `this`\n BN.prototype.setn = function setn (bit, val) {\n assert(typeof bit === 'number' && bit >= 0);\n\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n this._expand(off + 1);\n\n if (val) {\n this.words[off] = this.words[off] | (1 << wbit);\n } else {\n this.words[off] = this.words[off] & ~(1 << wbit);\n }\n\n return this.strip();\n };\n\n // Add `num` to `this` in-place\n BN.prototype.iadd = function iadd (num) {\n var r;\n\n // negative + positive\n if (this.negative !== 0 && num.negative === 0) {\n this.negative = 0;\n r = this.isub(num);\n this.negative ^= 1;\n return this._normSign();\n\n // positive + negative\n } else if (this.negative === 0 && num.negative !== 0) {\n num.negative = 0;\n r = this.isub(num);\n num.negative = 1;\n return r._normSign();\n }\n\n // a.length > b.length\n var a, b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n\n this.length = a.length;\n if (carry !== 0) {\n this.words[this.length] = carry;\n this.length++;\n // Copy the rest of the words\n } else if (a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n return this;\n };\n\n // Add `num` to `this`\n BN.prototype.add = function add (num) {\n var res;\n if (num.negative !== 0 && this.negative === 0) {\n num.negative = 0;\n res = this.sub(num);\n num.negative ^= 1;\n return res;\n } else if (num.negative === 0 && this.negative !== 0) {\n this.negative = 0;\n res = num.sub(this);\n this.negative = 1;\n return res;\n }\n\n if (this.length > num.length) return this.clone().iadd(num);\n\n return num.clone().iadd(this);\n };\n\n // Subtract `num` from `this` in-place\n BN.prototype.isub = function isub (num) {\n // this - (-num) = this + num\n if (num.negative !== 0) {\n num.negative = 0;\n var r = this.iadd(num);\n num.negative = 1;\n return r._normSign();\n\n // -this - num = -(this + num)\n } else if (this.negative !== 0) {\n this.negative = 0;\n this.iadd(num);\n this.negative = 1;\n return this._normSign();\n }\n\n // At this point both numbers are positive\n var cmp = this.cmp(num);\n\n // Optimization - zeroify\n if (cmp === 0) {\n this.negative = 0;\n this.length = 1;\n this.words[0] = 0;\n return this;\n }\n\n // a > b\n var a, b;\n if (cmp > 0) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n\n // Copy rest of the words\n if (carry === 0 && i < a.length && a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = Math.max(this.length, i);\n\n if (a !== this) {\n this.negative = 1;\n }\n\n return this.strip();\n };\n\n // Subtract `num` from `this`\n BN.prototype.sub = function sub (num) {\n return this.clone().isub(num);\n };\n\n function smallMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n var len = (self.length + num.length) | 0;\n out.length = len;\n len = (len - 1) | 0;\n\n // Peel one iteration (compiler can't do it, because of code complexity)\n var a = self.words[0] | 0;\n var b = num.words[0] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n var carry = (r / 0x4000000) | 0;\n out.words[0] = lo;\n\n for (var k = 1; k < len; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = carry >>> 26;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = (k - j) | 0;\n a = self.words[i] | 0;\n b = num.words[j] | 0;\n r = a * b + rword;\n ncarry += (r / 0x4000000) | 0;\n rword = r & 0x3ffffff;\n }\n out.words[k] = rword | 0;\n carry = ncarry | 0;\n }\n if (carry !== 0) {\n out.words[k] = carry | 0;\n } else {\n out.length--;\n }\n\n return out.strip();\n }\n\n // TODO(indutny): it may be reasonable to omit it for users who don't need\n // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit\n // multiplication (like elliptic secp256k1).\n var comb10MulTo = function comb10MulTo (self, num, out) {\n var a = self.words;\n var b = num.words;\n var o = out.words;\n var c = 0;\n var lo;\n var mid;\n var hi;\n var a0 = a[0] | 0;\n var al0 = a0 & 0x1fff;\n var ah0 = a0 >>> 13;\n var a1 = a[1] | 0;\n var al1 = a1 & 0x1fff;\n var ah1 = a1 >>> 13;\n var a2 = a[2] | 0;\n var al2 = a2 & 0x1fff;\n var ah2 = a2 >>> 13;\n var a3 = a[3] | 0;\n var al3 = a3 & 0x1fff;\n var ah3 = a3 >>> 13;\n var a4 = a[4] | 0;\n var al4 = a4 & 0x1fff;\n var ah4 = a4 >>> 13;\n var a5 = a[5] | 0;\n var al5 = a5 & 0x1fff;\n var ah5 = a5 >>> 13;\n var a6 = a[6] | 0;\n var al6 = a6 & 0x1fff;\n var ah6 = a6 >>> 13;\n var a7 = a[7] | 0;\n var al7 = a7 & 0x1fff;\n var ah7 = a7 >>> 13;\n var a8 = a[8] | 0;\n var al8 = a8 & 0x1fff;\n var ah8 = a8 >>> 13;\n var a9 = a[9] | 0;\n var al9 = a9 & 0x1fff;\n var ah9 = a9 >>> 13;\n var b0 = b[0] | 0;\n var bl0 = b0 & 0x1fff;\n var bh0 = b0 >>> 13;\n var b1 = b[1] | 0;\n var bl1 = b1 & 0x1fff;\n var bh1 = b1 >>> 13;\n var b2 = b[2] | 0;\n var bl2 = b2 & 0x1fff;\n var bh2 = b2 >>> 13;\n var b3 = b[3] | 0;\n var bl3 = b3 & 0x1fff;\n var bh3 = b3 >>> 13;\n var b4 = b[4] | 0;\n var bl4 = b4 & 0x1fff;\n var bh4 = b4 >>> 13;\n var b5 = b[5] | 0;\n var bl5 = b5 & 0x1fff;\n var bh5 = b5 >>> 13;\n var b6 = b[6] | 0;\n var bl6 = b6 & 0x1fff;\n var bh6 = b6 >>> 13;\n var b7 = b[7] | 0;\n var bl7 = b7 & 0x1fff;\n var bh7 = b7 >>> 13;\n var b8 = b[8] | 0;\n var bl8 = b8 & 0x1fff;\n var bh8 = b8 >>> 13;\n var b9 = b[9] | 0;\n var bl9 = b9 & 0x1fff;\n var bh9 = b9 >>> 13;\n\n out.negative = self.negative ^ num.negative;\n out.length = 19;\n /* k = 0 */\n lo = Math.imul(al0, bl0);\n mid = Math.imul(al0, bh0);\n mid = (mid + Math.imul(ah0, bl0)) | 0;\n hi = Math.imul(ah0, bh0);\n var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\n w0 &= 0x3ffffff;\n /* k = 1 */\n lo = Math.imul(al1, bl0);\n mid = Math.imul(al1, bh0);\n mid = (mid + Math.imul(ah1, bl0)) | 0;\n hi = Math.imul(ah1, bh0);\n lo = (lo + Math.imul(al0, bl1)) | 0;\n mid = (mid + Math.imul(al0, bh1)) | 0;\n mid = (mid + Math.imul(ah0, bl1)) | 0;\n hi = (hi + Math.imul(ah0, bh1)) | 0;\n var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\n w1 &= 0x3ffffff;\n /* k = 2 */\n lo = Math.imul(al2, bl0);\n mid = Math.imul(al2, bh0);\n mid = (mid + Math.imul(ah2, bl0)) | 0;\n hi = Math.imul(ah2, bh0);\n lo = (lo + Math.imul(al1, bl1)) | 0;\n mid = (mid + Math.imul(al1, bh1)) | 0;\n mid = (mid + Math.imul(ah1, bl1)) | 0;\n hi = (hi + Math.imul(ah1, bh1)) | 0;\n lo = (lo + Math.imul(al0, bl2)) | 0;\n mid = (mid + Math.imul(al0, bh2)) | 0;\n mid = (mid + Math.imul(ah0, bl2)) | 0;\n hi = (hi + Math.imul(ah0, bh2)) | 0;\n var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\n w2 &= 0x3ffffff;\n /* k = 3 */\n lo = Math.imul(al3, bl0);\n mid = Math.imul(al3, bh0);\n mid = (mid + Math.imul(ah3, bl0)) | 0;\n hi = Math.imul(ah3, bh0);\n lo = (lo + Math.imul(al2, bl1)) | 0;\n mid = (mid + Math.imul(al2, bh1)) | 0;\n mid = (mid + Math.imul(ah2, bl1)) | 0;\n hi = (hi + Math.imul(ah2, bh1)) | 0;\n lo = (lo + Math.imul(al1, bl2)) | 0;\n mid = (mid + Math.imul(al1, bh2)) | 0;\n mid = (mid + Math.imul(ah1, bl2)) | 0;\n hi = (hi + Math.imul(ah1, bh2)) | 0;\n lo = (lo + Math.imul(al0, bl3)) | 0;\n mid = (mid + Math.imul(al0, bh3)) | 0;\n mid = (mid + Math.imul(ah0, bl3)) | 0;\n hi = (hi + Math.imul(ah0, bh3)) | 0;\n var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\n w3 &= 0x3ffffff;\n /* k = 4 */\n lo = Math.imul(al4, bl0);\n mid = Math.imul(al4, bh0);\n mid = (mid + Math.imul(ah4, bl0)) | 0;\n hi = Math.imul(ah4, bh0);\n lo = (lo + Math.imul(al3, bl1)) | 0;\n mid = (mid + Math.imul(al3, bh1)) | 0;\n mid = (mid + Math.imul(ah3, bl1)) | 0;\n hi = (hi + Math.imul(ah3, bh1)) | 0;\n lo = (lo + Math.imul(al2, bl2)) | 0;\n mid = (mid + Math.imul(al2, bh2)) | 0;\n mid = (mid + Math.imul(ah2, bl2)) | 0;\n hi = (hi + Math.imul(ah2, bh2)) | 0;\n lo = (lo + Math.imul(al1, bl3)) | 0;\n mid = (mid + Math.imul(al1, bh3)) | 0;\n mid = (mid + Math.imul(ah1, bl3)) | 0;\n hi = (hi + Math.imul(ah1, bh3)) | 0;\n lo = (lo + Math.imul(al0, bl4)) | 0;\n mid = (mid + Math.imul(al0, bh4)) | 0;\n mid = (mid + Math.imul(ah0, bl4)) | 0;\n hi = (hi + Math.imul(ah0, bh4)) | 0;\n var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\n w4 &= 0x3ffffff;\n /* k = 5 */\n lo = Math.imul(al5, bl0);\n mid = Math.imul(al5, bh0);\n mid = (mid + Math.imul(ah5, bl0)) | 0;\n hi = Math.imul(ah5, bh0);\n lo = (lo + Math.imul(al4, bl1)) | 0;\n mid = (mid + Math.imul(al4, bh1)) | 0;\n mid = (mid + Math.imul(ah4, bl1)) | 0;\n hi = (hi + Math.imul(ah4, bh1)) | 0;\n lo = (lo + Math.imul(al3, bl2)) | 0;\n mid = (mid + Math.imul(al3, bh2)) | 0;\n mid = (mid + Math.imul(ah3, bl2)) | 0;\n hi = (hi + Math.imul(ah3, bh2)) | 0;\n lo = (lo + Math.imul(al2, bl3)) | 0;\n mid = (mid + Math.imul(al2, bh3)) | 0;\n mid = (mid + Math.imul(ah2, bl3)) | 0;\n hi = (hi + Math.imul(ah2, bh3)) | 0;\n lo = (lo + Math.imul(al1, bl4)) | 0;\n mid = (mid + Math.imul(al1, bh4)) | 0;\n mid = (mid + Math.imul(ah1, bl4)) | 0;\n hi = (hi + Math.imul(ah1, bh4)) | 0;\n lo = (lo + Math.imul(al0, bl5)) | 0;\n mid = (mid + Math.imul(al0, bh5)) | 0;\n mid = (mid + Math.imul(ah0, bl5)) | 0;\n hi = (hi + Math.imul(ah0, bh5)) | 0;\n var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\n w5 &= 0x3ffffff;\n /* k = 6 */\n lo = Math.imul(al6, bl0);\n mid = Math.imul(al6, bh0);\n mid = (mid + Math.imul(ah6, bl0)) | 0;\n hi = Math.imul(ah6, bh0);\n lo = (lo + Math.imul(al5, bl1)) | 0;\n mid = (mid + Math.imul(al5, bh1)) | 0;\n mid = (mid + Math.imul(ah5, bl1)) | 0;\n hi = (hi + Math.imul(ah5, bh1)) | 0;\n lo = (lo + Math.imul(al4, bl2)) | 0;\n mid = (mid + Math.imul(al4, bh2)) | 0;\n mid = (mid + Math.imul(ah4, bl2)) | 0;\n hi = (hi + Math.imul(ah4, bh2)) | 0;\n lo = (lo + Math.imul(al3, bl3)) | 0;\n mid = (mid + Math.imul(al3, bh3)) | 0;\n mid = (mid + Math.imul(ah3, bl3)) | 0;\n hi = (hi + Math.imul(ah3, bh3)) | 0;\n lo = (lo + Math.imul(al2, bl4)) | 0;\n mid = (mid + Math.imul(al2, bh4)) | 0;\n mid = (mid + Math.imul(ah2, bl4)) | 0;\n hi = (hi + Math.imul(ah2, bh4)) | 0;\n lo = (lo + Math.imul(al1, bl5)) | 0;\n mid = (mid + Math.imul(al1, bh5)) | 0;\n mid = (mid + Math.imul(ah1, bl5)) | 0;\n hi = (hi + Math.imul(ah1, bh5)) | 0;\n lo = (lo + Math.imul(al0, bl6)) | 0;\n mid = (mid + Math.imul(al0, bh6)) | 0;\n mid = (mid + Math.imul(ah0, bl6)) | 0;\n hi = (hi + Math.imul(ah0, bh6)) | 0;\n var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\n w6 &= 0x3ffffff;\n /* k = 7 */\n lo = Math.imul(al7, bl0);\n mid = Math.imul(al7, bh0);\n mid = (mid + Math.imul(ah7, bl0)) | 0;\n hi = Math.imul(ah7, bh0);\n lo = (lo + Math.imul(al6, bl1)) | 0;\n mid = (mid + Math.imul(al6, bh1)) | 0;\n mid = (mid + Math.imul(ah6, bl1)) | 0;\n hi = (hi + Math.imul(ah6, bh1)) | 0;\n lo = (lo + Math.imul(al5, bl2)) | 0;\n mid = (mid + Math.imul(al5, bh2)) | 0;\n mid = (mid + Math.imul(ah5, bl2)) | 0;\n hi = (hi + Math.imul(ah5, bh2)) | 0;\n lo = (lo + Math.imul(al4, bl3)) | 0;\n mid = (mid + Math.imul(al4, bh3)) | 0;\n mid = (mid + Math.imul(ah4, bl3)) | 0;\n hi = (hi + Math.imul(ah4, bh3)) | 0;\n lo = (lo + Math.imul(al3, bl4)) | 0;\n mid = (mid + Math.imul(al3, bh4)) | 0;\n mid = (mid + Math.imul(ah3, bl4)) | 0;\n hi = (hi + Math.imul(ah3, bh4)) | 0;\n lo = (lo + Math.imul(al2, bl5)) | 0;\n mid = (mid + Math.imul(al2, bh5)) | 0;\n mid = (mid + Math.imul(ah2, bl5)) | 0;\n hi = (hi + Math.imul(ah2, bh5)) | 0;\n lo = (lo + Math.imul(al1, bl6)) | 0;\n mid = (mid + Math.imul(al1, bh6)) | 0;\n mid = (mid + Math.imul(ah1, bl6)) | 0;\n hi = (hi + Math.imul(ah1, bh6)) | 0;\n lo = (lo + Math.imul(al0, bl7)) | 0;\n mid = (mid + Math.imul(al0, bh7)) | 0;\n mid = (mid + Math.imul(ah0, bl7)) | 0;\n hi = (hi + Math.imul(ah0, bh7)) | 0;\n var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\n w7 &= 0x3ffffff;\n /* k = 8 */\n lo = Math.imul(al8, bl0);\n mid = Math.imul(al8, bh0);\n mid = (mid + Math.imul(ah8, bl0)) | 0;\n hi = Math.imul(ah8, bh0);\n lo = (lo + Math.imul(al7, bl1)) | 0;\n mid = (mid + Math.imul(al7, bh1)) | 0;\n mid = (mid + Math.imul(ah7, bl1)) | 0;\n hi = (hi + Math.imul(ah7, bh1)) | 0;\n lo = (lo + Math.imul(al6, bl2)) | 0;\n mid = (mid + Math.imul(al6, bh2)) | 0;\n mid = (mid + Math.imul(ah6, bl2)) | 0;\n hi = (hi + Math.imul(ah6, bh2)) | 0;\n lo = (lo + Math.imul(al5, bl3)) | 0;\n mid = (mid + Math.imul(al5, bh3)) | 0;\n mid = (mid + Math.imul(ah5, bl3)) | 0;\n hi = (hi + Math.imul(ah5, bh3)) | 0;\n lo = (lo + Math.imul(al4, bl4)) | 0;\n mid = (mid + Math.imul(al4, bh4)) | 0;\n mid = (mid + Math.imul(ah4, bl4)) | 0;\n hi = (hi + Math.imul(ah4, bh4)) | 0;\n lo = (lo + Math.imul(al3, bl5)) | 0;\n mid = (mid + Math.imul(al3, bh5)) | 0;\n mid = (mid + Math.imul(ah3, bl5)) | 0;\n hi = (hi + Math.imul(ah3, bh5)) | 0;\n lo = (lo + Math.imul(al2, bl6)) | 0;\n mid = (mid + Math.imul(al2, bh6)) | 0;\n mid = (mid + Math.imul(ah2, bl6)) | 0;\n hi = (hi + Math.imul(ah2, bh6)) | 0;\n lo = (lo + Math.imul(al1, bl7)) | 0;\n mid = (mid + Math.imul(al1, bh7)) | 0;\n mid = (mid + Math.imul(ah1, bl7)) | 0;\n hi = (hi + Math.imul(ah1, bh7)) | 0;\n lo = (lo + Math.imul(al0, bl8)) | 0;\n mid = (mid + Math.imul(al0, bh8)) | 0;\n mid = (mid + Math.imul(ah0, bl8)) | 0;\n hi = (hi + Math.imul(ah0, bh8)) | 0;\n var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\n w8 &= 0x3ffffff;\n /* k = 9 */\n lo = Math.imul(al9, bl0);\n mid = Math.imul(al9, bh0);\n mid = (mid + Math.imul(ah9, bl0)) | 0;\n hi = Math.imul(ah9, bh0);\n lo = (lo + Math.imul(al8, bl1)) | 0;\n mid = (mid + Math.imul(al8, bh1)) | 0;\n mid = (mid + Math.imul(ah8, bl1)) | 0;\n hi = (hi + Math.imul(ah8, bh1)) | 0;\n lo = (lo + Math.imul(al7, bl2)) | 0;\n mid = (mid + Math.imul(al7, bh2)) | 0;\n mid = (mid + Math.imul(ah7, bl2)) | 0;\n hi = (hi + Math.imul(ah7, bh2)) | 0;\n lo = (lo + Math.imul(al6, bl3)) | 0;\n mid = (mid + Math.imul(al6, bh3)) | 0;\n mid = (mid + Math.imul(ah6, bl3)) | 0;\n hi = (hi + Math.imul(ah6, bh3)) | 0;\n lo = (lo + Math.imul(al5, bl4)) | 0;\n mid = (mid + Math.imul(al5, bh4)) | 0;\n mid = (mid + Math.imul(ah5, bl4)) | 0;\n hi = (hi + Math.imul(ah5, bh4)) | 0;\n lo = (lo + Math.imul(al4, bl5)) | 0;\n mid = (mid + Math.imul(al4, bh5)) | 0;\n mid = (mid + Math.imul(ah4, bl5)) | 0;\n hi = (hi + Math.imul(ah4, bh5)) | 0;\n lo = (lo + Math.imul(al3, bl6)) | 0;\n mid = (mid + Math.imul(al3, bh6)) | 0;\n mid = (mid + Math.imul(ah3, bl6)) | 0;\n hi = (hi + Math.imul(ah3, bh6)) | 0;\n lo = (lo + Math.imul(al2, bl7)) | 0;\n mid = (mid + Math.imul(al2, bh7)) | 0;\n mid = (mid + Math.imul(ah2, bl7)) | 0;\n hi = (hi + Math.imul(ah2, bh7)) | 0;\n lo = (lo + Math.imul(al1, bl8)) | 0;\n mid = (mid + Math.imul(al1, bh8)) | 0;\n mid = (mid + Math.imul(ah1, bl8)) | 0;\n hi = (hi + Math.imul(ah1, bh8)) | 0;\n lo = (lo + Math.imul(al0, bl9)) | 0;\n mid = (mid + Math.imul(al0, bh9)) | 0;\n mid = (mid + Math.imul(ah0, bl9)) | 0;\n hi = (hi + Math.imul(ah0, bh9)) | 0;\n var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\n w9 &= 0x3ffffff;\n /* k = 10 */\n lo = Math.imul(al9, bl1);\n mid = Math.imul(al9, bh1);\n mid = (mid + Math.imul(ah9, bl1)) | 0;\n hi = Math.imul(ah9, bh1);\n lo = (lo + Math.imul(al8, bl2)) | 0;\n mid = (mid + Math.imul(al8, bh2)) | 0;\n mid = (mid + Math.imul(ah8, bl2)) | 0;\n hi = (hi + Math.imul(ah8, bh2)) | 0;\n lo = (lo + Math.imul(al7, bl3)) | 0;\n mid = (mid + Math.imul(al7, bh3)) | 0;\n mid = (mid + Math.imul(ah7, bl3)) | 0;\n hi = (hi + Math.imul(ah7, bh3)) | 0;\n lo = (lo + Math.imul(al6, bl4)) | 0;\n mid = (mid + Math.imul(al6, bh4)) | 0;\n mid = (mid + Math.imul(ah6, bl4)) | 0;\n hi = (hi + Math.imul(ah6, bh4)) | 0;\n lo = (lo + Math.imul(al5, bl5)) | 0;\n mid = (mid + Math.imul(al5, bh5)) | 0;\n mid = (mid + Math.imul(ah5, bl5)) | 0;\n hi = (hi + Math.imul(ah5, bh5)) | 0;\n lo = (lo + Math.imul(al4, bl6)) | 0;\n mid = (mid + Math.imul(al4, bh6)) | 0;\n mid = (mid + Math.imul(ah4, bl6)) | 0;\n hi = (hi + Math.imul(ah4, bh6)) | 0;\n lo = (lo + Math.imul(al3, bl7)) | 0;\n mid = (mid + Math.imul(al3, bh7)) | 0;\n mid = (mid + Math.imul(ah3, bl7)) | 0;\n hi = (hi + Math.imul(ah3, bh7)) | 0;\n lo = (lo + Math.imul(al2, bl8)) | 0;\n mid = (mid + Math.imul(al2, bh8)) | 0;\n mid = (mid + Math.imul(ah2, bl8)) | 0;\n hi = (hi + Math.imul(ah2, bh8)) | 0;\n lo = (lo + Math.imul(al1, bl9)) | 0;\n mid = (mid + Math.imul(al1, bh9)) | 0;\n mid = (mid + Math.imul(ah1, bl9)) | 0;\n hi = (hi + Math.imul(ah1, bh9)) | 0;\n var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\n w10 &= 0x3ffffff;\n /* k = 11 */\n lo = Math.imul(al9, bl2);\n mid = Math.imul(al9, bh2);\n mid = (mid + Math.imul(ah9, bl2)) | 0;\n hi = Math.imul(ah9, bh2);\n lo = (lo + Math.imul(al8, bl3)) | 0;\n mid = (mid + Math.imul(al8, bh3)) | 0;\n mid = (mid + Math.imul(ah8, bl3)) | 0;\n hi = (hi + Math.imul(ah8, bh3)) | 0;\n lo = (lo + Math.imul(al7, bl4)) | 0;\n mid = (mid + Math.imul(al7, bh4)) | 0;\n mid = (mid + Math.imul(ah7, bl4)) | 0;\n hi = (hi + Math.imul(ah7, bh4)) | 0;\n lo = (lo + Math.imul(al6, bl5)) | 0;\n mid = (mid + Math.imul(al6, bh5)) | 0;\n mid = (mid + Math.imul(ah6, bl5)) | 0;\n hi = (hi + Math.imul(ah6, bh5)) | 0;\n lo = (lo + Math.imul(al5, bl6)) | 0;\n mid = (mid + Math.imul(al5, bh6)) | 0;\n mid = (mid + Math.imul(ah5, bl6)) | 0;\n hi = (hi + Math.imul(ah5, bh6)) | 0;\n lo = (lo + Math.imul(al4, bl7)) | 0;\n mid = (mid + Math.imul(al4, bh7)) | 0;\n mid = (mid + Math.imul(ah4, bl7)) | 0;\n hi = (hi + Math.imul(ah4, bh7)) | 0;\n lo = (lo + Math.imul(al3, bl8)) | 0;\n mid = (mid + Math.imul(al3, bh8)) | 0;\n mid = (mid + Math.imul(ah3, bl8)) | 0;\n hi = (hi + Math.imul(ah3, bh8)) | 0;\n lo = (lo + Math.imul(al2, bl9)) | 0;\n mid = (mid + Math.imul(al2, bh9)) | 0;\n mid = (mid + Math.imul(ah2, bl9)) | 0;\n hi = (hi + Math.imul(ah2, bh9)) | 0;\n var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\n w11 &= 0x3ffffff;\n /* k = 12 */\n lo = Math.imul(al9, bl3);\n mid = Math.imul(al9, bh3);\n mid = (mid + Math.imul(ah9, bl3)) | 0;\n hi = Math.imul(ah9, bh3);\n lo = (lo + Math.imul(al8, bl4)) | 0;\n mid = (mid + Math.imul(al8, bh4)) | 0;\n mid = (mid + Math.imul(ah8, bl4)) | 0;\n hi = (hi + Math.imul(ah8, bh4)) | 0;\n lo = (lo + Math.imul(al7, bl5)) | 0;\n mid = (mid + Math.imul(al7, bh5)) | 0;\n mid = (mid + Math.imul(ah7, bl5)) | 0;\n hi = (hi + Math.imul(ah7, bh5)) | 0;\n lo = (lo + Math.imul(al6, bl6)) | 0;\n mid = (mid + Math.imul(al6, bh6)) | 0;\n mid = (mid + Math.imul(ah6, bl6)) | 0;\n hi = (hi + Math.imul(ah6, bh6)) | 0;\n lo = (lo + Math.imul(al5, bl7)) | 0;\n mid = (mid + Math.imul(al5, bh7)) | 0;\n mid = (mid + Math.imul(ah5, bl7)) | 0;\n hi = (hi + Math.imul(ah5, bh7)) | 0;\n lo = (lo + Math.imul(al4, bl8)) | 0;\n mid = (mid + Math.imul(al4, bh8)) | 0;\n mid = (mid + Math.imul(ah4, bl8)) | 0;\n hi = (hi + Math.imul(ah4, bh8)) | 0;\n lo = (lo + Math.imul(al3, bl9)) | 0;\n mid = (mid + Math.imul(al3, bh9)) | 0;\n mid = (mid + Math.imul(ah3, bl9)) | 0;\n hi = (hi + Math.imul(ah3, bh9)) | 0;\n var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\n w12 &= 0x3ffffff;\n /* k = 13 */\n lo = Math.imul(al9, bl4);\n mid = Math.imul(al9, bh4);\n mid = (mid + Math.imul(ah9, bl4)) | 0;\n hi = Math.imul(ah9, bh4);\n lo = (lo + Math.imul(al8, bl5)) | 0;\n mid = (mid + Math.imul(al8, bh5)) | 0;\n mid = (mid + Math.imul(ah8, bl5)) | 0;\n hi = (hi + Math.imul(ah8, bh5)) | 0;\n lo = (lo + Math.imul(al7, bl6)) | 0;\n mid = (mid + Math.imul(al7, bh6)) | 0;\n mid = (mid + Math.imul(ah7, bl6)) | 0;\n hi = (hi + Math.imul(ah7, bh6)) | 0;\n lo = (lo + Math.imul(al6, bl7)) | 0;\n mid = (mid + Math.imul(al6, bh7)) | 0;\n mid = (mid + Math.imul(ah6, bl7)) | 0;\n hi = (hi + Math.imul(ah6, bh7)) | 0;\n lo = (lo + Math.imul(al5, bl8)) | 0;\n mid = (mid + Math.imul(al5, bh8)) | 0;\n mid = (mid + Math.imul(ah5, bl8)) | 0;\n hi = (hi + Math.imul(ah5, bh8)) | 0;\n lo = (lo + Math.imul(al4, bl9)) | 0;\n mid = (mid + Math.imul(al4, bh9)) | 0;\n mid = (mid + Math.imul(ah4, bl9)) | 0;\n hi = (hi + Math.imul(ah4, bh9)) | 0;\n var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\n w13 &= 0x3ffffff;\n /* k = 14 */\n lo = Math.imul(al9, bl5);\n mid = Math.imul(al9, bh5);\n mid = (mid + Math.imul(ah9, bl5)) | 0;\n hi = Math.imul(ah9, bh5);\n lo = (lo + Math.imul(al8, bl6)) | 0;\n mid = (mid + Math.imul(al8, bh6)) | 0;\n mid = (mid + Math.imul(ah8, bl6)) | 0;\n hi = (hi + Math.imul(ah8, bh6)) | 0;\n lo = (lo + Math.imul(al7, bl7)) | 0;\n mid = (mid + Math.imul(al7, bh7)) | 0;\n mid = (mid + Math.imul(ah7, bl7)) | 0;\n hi = (hi + Math.imul(ah7, bh7)) | 0;\n lo = (lo + Math.imul(al6, bl8)) | 0;\n mid = (mid + Math.imul(al6, bh8)) | 0;\n mid = (mid + Math.imul(ah6, bl8)) | 0;\n hi = (hi + Math.imul(ah6, bh8)) | 0;\n lo = (lo + Math.imul(al5, bl9)) | 0;\n mid = (mid + Math.imul(al5, bh9)) | 0;\n mid = (mid + Math.imul(ah5, bl9)) | 0;\n hi = (hi + Math.imul(ah5, bh9)) | 0;\n var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\n w14 &= 0x3ffffff;\n /* k = 15 */\n lo = Math.imul(al9, bl6);\n mid = Math.imul(al9, bh6);\n mid = (mid + Math.imul(ah9, bl6)) | 0;\n hi = Math.imul(ah9, bh6);\n lo = (lo + Math.imul(al8, bl7)) | 0;\n mid = (mid + Math.imul(al8, bh7)) | 0;\n mid = (mid + Math.imul(ah8, bl7)) | 0;\n hi = (hi + Math.imul(ah8, bh7)) | 0;\n lo = (lo + Math.imul(al7, bl8)) | 0;\n mid = (mid + Math.imul(al7, bh8)) | 0;\n mid = (mid + Math.imul(ah7, bl8)) | 0;\n hi = (hi + Math.imul(ah7, bh8)) | 0;\n lo = (lo + Math.imul(al6, bl9)) | 0;\n mid = (mid + Math.imul(al6, bh9)) | 0;\n mid = (mid + Math.imul(ah6, bl9)) | 0;\n hi = (hi + Math.imul(ah6, bh9)) | 0;\n var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\n w15 &= 0x3ffffff;\n /* k = 16 */\n lo = Math.imul(al9, bl7);\n mid = Math.imul(al9, bh7);\n mid = (mid + Math.imul(ah9, bl7)) | 0;\n hi = Math.imul(ah9, bh7);\n lo = (lo + Math.imul(al8, bl8)) | 0;\n mid = (mid + Math.imul(al8, bh8)) | 0;\n mid = (mid + Math.imul(ah8, bl8)) | 0;\n hi = (hi + Math.imul(ah8, bh8)) | 0;\n lo = (lo + Math.imul(al7, bl9)) | 0;\n mid = (mid + Math.imul(al7, bh9)) | 0;\n mid = (mid + Math.imul(ah7, bl9)) | 0;\n hi = (hi + Math.imul(ah7, bh9)) | 0;\n var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\n w16 &= 0x3ffffff;\n /* k = 17 */\n lo = Math.imul(al9, bl8);\n mid = Math.imul(al9, bh8);\n mid = (mid + Math.imul(ah9, bl8)) | 0;\n hi = Math.imul(ah9, bh8);\n lo = (lo + Math.imul(al8, bl9)) | 0;\n mid = (mid + Math.imul(al8, bh9)) | 0;\n mid = (mid + Math.imul(ah8, bl9)) | 0;\n hi = (hi + Math.imul(ah8, bh9)) | 0;\n var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\n w17 &= 0x3ffffff;\n /* k = 18 */\n lo = Math.imul(al9, bl9);\n mid = Math.imul(al9, bh9);\n mid = (mid + Math.imul(ah9, bl9)) | 0;\n hi = Math.imul(ah9, bh9);\n var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\n w18 &= 0x3ffffff;\n o[0] = w0;\n o[1] = w1;\n o[2] = w2;\n o[3] = w3;\n o[4] = w4;\n o[5] = w5;\n o[6] = w6;\n o[7] = w7;\n o[8] = w8;\n o[9] = w9;\n o[10] = w10;\n o[11] = w11;\n o[12] = w12;\n o[13] = w13;\n o[14] = w14;\n o[15] = w15;\n o[16] = w16;\n o[17] = w17;\n o[18] = w18;\n if (c !== 0) {\n o[19] = c;\n out.length++;\n }\n return out;\n };\n\n // Polyfill comb\n if (!Math.imul) {\n comb10MulTo = smallMulTo;\n }\n\n function bigMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n out.length = self.length + num.length;\n\n var carry = 0;\n var hncarry = 0;\n for (var k = 0; k < out.length - 1; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = hncarry;\n hncarry = 0;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = k - j;\n var a = self.words[i] | 0;\n var b = num.words[j] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\n lo = (lo + rword) | 0;\n rword = lo & 0x3ffffff;\n ncarry = (ncarry + (lo >>> 26)) | 0;\n\n hncarry += ncarry >>> 26;\n ncarry &= 0x3ffffff;\n }\n out.words[k] = rword;\n carry = ncarry;\n ncarry = hncarry;\n }\n if (carry !== 0) {\n out.words[k] = carry;\n } else {\n out.length--;\n }\n\n return out.strip();\n }\n\n function jumboMulTo (self, num, out) {\n var fftm = new FFTM();\n return fftm.mulp(self, num, out);\n }\n\n BN.prototype.mulTo = function mulTo (num, out) {\n var res;\n var len = this.length + num.length;\n if (this.length === 10 && num.length === 10) {\n res = comb10MulTo(this, num, out);\n } else if (len < 63) {\n res = smallMulTo(this, num, out);\n } else if (len < 1024) {\n res = bigMulTo(this, num, out);\n } else {\n res = jumboMulTo(this, num, out);\n }\n\n return res;\n };\n\n // Cooley-Tukey algorithm for FFT\n // slightly revisited to rely on looping instead of recursion\n\n function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }\n\n FFTM.prototype.makeRBT = function makeRBT (N) {\n var t = new Array(N);\n var l = BN.prototype._countBits(N) - 1;\n for (var i = 0; i < N; i++) {\n t[i] = this.revBin(i, l, N);\n }\n\n return t;\n };\n\n // Returns binary-reversed representation of `x`\n FFTM.prototype.revBin = function revBin (x, l, N) {\n if (x === 0 || x === N - 1) return x;\n\n var rb = 0;\n for (var i = 0; i < l; i++) {\n rb |= (x & 1) << (l - i - 1);\n x >>= 1;\n }\n\n return rb;\n };\n\n // Performs \"tweedling\" phase, therefore 'emulating'\n // behaviour of the recursive algorithm\n FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {\n for (var i = 0; i < N; i++) {\n rtws[i] = rws[rbt[i]];\n itws[i] = iws[rbt[i]];\n }\n };\n\n FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {\n this.permute(rbt, rws, iws, rtws, itws, N);\n\n for (var s = 1; s < N; s <<= 1) {\n var l = s << 1;\n\n var rtwdf = Math.cos(2 * Math.PI / l);\n var itwdf = Math.sin(2 * Math.PI / l);\n\n for (var p = 0; p < N; p += l) {\n var rtwdf_ = rtwdf;\n var itwdf_ = itwdf;\n\n for (var j = 0; j < s; j++) {\n var re = rtws[p + j];\n var ie = itws[p + j];\n\n var ro = rtws[p + j + s];\n var io = itws[p + j + s];\n\n var rx = rtwdf_ * ro - itwdf_ * io;\n\n io = rtwdf_ * io + itwdf_ * ro;\n ro = rx;\n\n rtws[p + j] = re + ro;\n itws[p + j] = ie + io;\n\n rtws[p + j + s] = re - ro;\n itws[p + j + s] = ie - io;\n\n /* jshint maxdepth : false */\n if (j !== l) {\n rx = rtwdf * rtwdf_ - itwdf * itwdf_;\n\n itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;\n rtwdf_ = rx;\n }\n }\n }\n }\n };\n\n FFTM.prototype.guessLen13b = function guessLen13b (n, m) {\n var N = Math.max(m, n) | 1;\n var odd = N & 1;\n var i = 0;\n for (N = N / 2 | 0; N; N = N >>> 1) {\n i++;\n }\n\n return 1 << i + 1 + odd;\n };\n\n FFTM.prototype.conjugate = function conjugate (rws, iws, N) {\n if (N <= 1) return;\n\n for (var i = 0; i < N / 2; i++) {\n var t = rws[i];\n\n rws[i] = rws[N - i - 1];\n rws[N - i - 1] = t;\n\n t = iws[i];\n\n iws[i] = -iws[N - i - 1];\n iws[N - i - 1] = -t;\n }\n };\n\n FFTM.prototype.normalize13b = function normalize13b (ws, N) {\n var carry = 0;\n for (var i = 0; i < N / 2; i++) {\n var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +\n Math.round(ws[2 * i] / N) +\n carry;\n\n ws[i] = w & 0x3ffffff;\n\n if (w < 0x4000000) {\n carry = 0;\n } else {\n carry = w / 0x4000000 | 0;\n }\n }\n\n return ws;\n };\n\n FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {\n var carry = 0;\n for (var i = 0; i < len; i++) {\n carry = carry + (ws[i] | 0);\n\n rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;\n rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;\n }\n\n // Pad with zeroes\n for (i = 2 * len; i < N; ++i) {\n rws[i] = 0;\n }\n\n assert(carry === 0);\n assert((carry & ~0x1fff) === 0);\n };\n\n FFTM.prototype.stub = function stub (N) {\n var ph = new Array(N);\n for (var i = 0; i < N; i++) {\n ph[i] = 0;\n }\n\n return ph;\n };\n\n FFTM.prototype.mulp = function mulp (x, y, out) {\n var N = 2 * this.guessLen13b(x.length, y.length);\n\n var rbt = this.makeRBT(N);\n\n var _ = this.stub(N);\n\n var rws = new Array(N);\n var rwst = new Array(N);\n var iwst = new Array(N);\n\n var nrws = new Array(N);\n var nrwst = new Array(N);\n var niwst = new Array(N);\n\n var rmws = out.words;\n rmws.length = N;\n\n this.convert13b(x.words, x.length, rws, N);\n this.convert13b(y.words, y.length, nrws, N);\n\n this.transform(rws, _, rwst, iwst, N, rbt);\n this.transform(nrws, _, nrwst, niwst, N, rbt);\n\n for (var i = 0; i < N; i++) {\n var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\n iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];\n rwst[i] = rx;\n }\n\n this.conjugate(rwst, iwst, N);\n this.transform(rwst, iwst, rmws, _, N, rbt);\n this.conjugate(rmws, _, N);\n this.normalize13b(rmws, N);\n\n out.negative = x.negative ^ y.negative;\n out.length = x.length + y.length;\n return out.strip();\n };\n\n // Multiply `this` by `num`\n BN.prototype.mul = function mul (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return this.mulTo(num, out);\n };\n\n // Multiply employing FFT\n BN.prototype.mulf = function mulf (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return jumboMulTo(this, num, out);\n };\n\n // In-place Multiplication\n BN.prototype.imul = function imul (num) {\n return this.clone().mulTo(num, this);\n };\n\n BN.prototype.imuln = function imuln (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n\n // Carry\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = (this.words[i] | 0) * num;\n var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\n carry >>= 26;\n carry += (w / 0x4000000) | 0;\n // NOTE: lo is 27bit maximum\n carry += lo >>> 26;\n this.words[i] = lo & 0x3ffffff;\n }\n\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n\n return this;\n };\n\n BN.prototype.muln = function muln (num) {\n return this.clone().imuln(num);\n };\n\n // `this` * `this`\n BN.prototype.sqr = function sqr () {\n return this.mul(this);\n };\n\n // `this` * `this` in-place\n BN.prototype.isqr = function isqr () {\n return this.imul(this.clone());\n };\n\n // Math.pow(`this`, `num`)\n BN.prototype.pow = function pow (num) {\n var w = toBitArray(num);\n if (w.length === 0) return new BN(1);\n\n // Skip leading zeroes\n var res = this;\n for (var i = 0; i < w.length; i++, res = res.sqr()) {\n if (w[i] !== 0) break;\n }\n\n if (++i < w.length) {\n for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {\n if (w[i] === 0) continue;\n\n res = res.mul(q);\n }\n }\n\n return res;\n };\n\n // Shift-left in-place\n BN.prototype.iushln = function iushln (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);\n var i;\n\n if (r !== 0) {\n var carry = 0;\n\n for (i = 0; i < this.length; i++) {\n var newCarry = this.words[i] & carryMask;\n var c = ((this.words[i] | 0) - newCarry) << r;\n this.words[i] = c | carry;\n carry = newCarry >>> (26 - r);\n }\n\n if (carry) {\n this.words[i] = carry;\n this.length++;\n }\n }\n\n if (s !== 0) {\n for (i = this.length - 1; i >= 0; i--) {\n this.words[i + s] = this.words[i];\n }\n\n for (i = 0; i < s; i++) {\n this.words[i] = 0;\n }\n\n this.length += s;\n }\n\n return this.strip();\n };\n\n BN.prototype.ishln = function ishln (bits) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushln(bits);\n };\n\n // Shift-right in-place\n // NOTE: `hint` is a lowest bit before trailing zeroes\n // NOTE: if `extended` is present - it will be filled with destroyed bits\n BN.prototype.iushrn = function iushrn (bits, hint, extended) {\n assert(typeof bits === 'number' && bits >= 0);\n var h;\n if (hint) {\n h = (hint - (hint % 26)) / 26;\n } else {\n h = 0;\n }\n\n var r = bits % 26;\n var s = Math.min((bits - r) / 26, this.length);\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n var maskedWords = extended;\n\n h -= s;\n h = Math.max(0, h);\n\n // Extended mode, copy masked part\n if (maskedWords) {\n for (var i = 0; i < s; i++) {\n maskedWords.words[i] = this.words[i];\n }\n maskedWords.length = s;\n }\n\n if (s === 0) {\n // No-op, we should not move anything at all\n } else if (this.length > s) {\n this.length -= s;\n for (i = 0; i < this.length; i++) {\n this.words[i] = this.words[i + s];\n }\n } else {\n this.words[0] = 0;\n this.length = 1;\n }\n\n var carry = 0;\n for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {\n var word = this.words[i] | 0;\n this.words[i] = (carry << (26 - r)) | (word >>> r);\n carry = word & mask;\n }\n\n // Push carried bits as a mask\n if (maskedWords && carry !== 0) {\n maskedWords.words[maskedWords.length++] = carry;\n }\n\n if (this.length === 0) {\n this.words[0] = 0;\n this.length = 1;\n }\n\n return this.strip();\n };\n\n BN.prototype.ishrn = function ishrn (bits, hint, extended) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushrn(bits, hint, extended);\n };\n\n // Shift-left\n BN.prototype.shln = function shln (bits) {\n return this.clone().ishln(bits);\n };\n\n BN.prototype.ushln = function ushln (bits) {\n return this.clone().iushln(bits);\n };\n\n // Shift-right\n BN.prototype.shrn = function shrn (bits) {\n return this.clone().ishrn(bits);\n };\n\n BN.prototype.ushrn = function ushrn (bits) {\n return this.clone().iushrn(bits);\n };\n\n // Test if n bit is set\n BN.prototype.testn = function testn (bit) {\n assert(typeof bit === 'number' && bit >= 0);\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) return false;\n\n // Check bit and return\n var w = this.words[s];\n\n return !!(w & q);\n };\n\n // Return only lowers bits of number (in-place)\n BN.prototype.imaskn = function imaskn (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n\n assert(this.negative === 0, 'imaskn works only with positive numbers');\n\n if (this.length <= s) {\n return this;\n }\n\n if (r !== 0) {\n s++;\n }\n this.length = Math.min(s, this.length);\n\n if (r !== 0) {\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n this.words[this.length - 1] &= mask;\n }\n\n return this.strip();\n };\n\n // Return only lowers bits of number\n BN.prototype.maskn = function maskn (bits) {\n return this.clone().imaskn(bits);\n };\n\n // Add plain number `num` to `this`\n BN.prototype.iaddn = function iaddn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.isubn(-num);\n\n // Possible sign change\n if (this.negative !== 0) {\n if (this.length === 1 && (this.words[0] | 0) < num) {\n this.words[0] = num - (this.words[0] | 0);\n this.negative = 0;\n return this;\n }\n\n this.negative = 0;\n this.isubn(num);\n this.negative = 1;\n return this;\n }\n\n // Add without checks\n return this._iaddn(num);\n };\n\n BN.prototype._iaddn = function _iaddn (num) {\n this.words[0] += num;\n\n // Carry\n for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {\n this.words[i] -= 0x4000000;\n if (i === this.length - 1) {\n this.words[i + 1] = 1;\n } else {\n this.words[i + 1]++;\n }\n }\n this.length = Math.max(this.length, i + 1);\n\n return this;\n };\n\n // Subtract plain number `num` from `this`\n BN.prototype.isubn = function isubn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.iaddn(-num);\n\n if (this.negative !== 0) {\n this.negative = 0;\n this.iaddn(num);\n this.negative = 1;\n return this;\n }\n\n this.words[0] -= num;\n\n if (this.length === 1 && this.words[0] < 0) {\n this.words[0] = -this.words[0];\n this.negative = 1;\n } else {\n // Carry\n for (var i = 0; i < this.length && this.words[i] < 0; i++) {\n this.words[i] += 0x4000000;\n this.words[i + 1] -= 1;\n }\n }\n\n return this.strip();\n };\n\n BN.prototype.addn = function addn (num) {\n return this.clone().iaddn(num);\n };\n\n BN.prototype.subn = function subn (num) {\n return this.clone().isubn(num);\n };\n\n BN.prototype.iabs = function iabs () {\n this.negative = 0;\n\n return this;\n };\n\n BN.prototype.abs = function abs () {\n return this.clone().iabs();\n };\n\n BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {\n var len = num.length + shift;\n var i;\n\n this._expand(len);\n\n var w;\n var carry = 0;\n for (i = 0; i < num.length; i++) {\n w = (this.words[i + shift] | 0) + carry;\n var right = (num.words[i] | 0) * mul;\n w -= right & 0x3ffffff;\n carry = (w >> 26) - ((right / 0x4000000) | 0);\n this.words[i + shift] = w & 0x3ffffff;\n }\n for (; i < this.length - shift; i++) {\n w = (this.words[i + shift] | 0) + carry;\n carry = w >> 26;\n this.words[i + shift] = w & 0x3ffffff;\n }\n\n if (carry === 0) return this.strip();\n\n // Subtraction overflow\n assert(carry === -1);\n carry = 0;\n for (i = 0; i < this.length; i++) {\n w = -(this.words[i] | 0) + carry;\n carry = w >> 26;\n this.words[i] = w & 0x3ffffff;\n }\n this.negative = 1;\n\n return this.strip();\n };\n\n BN.prototype._wordDiv = function _wordDiv (num, mode) {\n var shift = this.length - num.length;\n\n var a = this.clone();\n var b = num;\n\n // Normalize\n var bhi = b.words[b.length - 1] | 0;\n var bhiBits = this._countBits(bhi);\n shift = 26 - bhiBits;\n if (shift !== 0) {\n b = b.ushln(shift);\n a.iushln(shift);\n bhi = b.words[b.length - 1] | 0;\n }\n\n // Initialize quotient\n var m = a.length - b.length;\n var q;\n\n if (mode !== 'mod') {\n q = new BN(null);\n q.length = m + 1;\n q.words = new Array(q.length);\n for (var i = 0; i < q.length; i++) {\n q.words[i] = 0;\n }\n }\n\n var diff = a.clone()._ishlnsubmul(b, 1, m);\n if (diff.negative === 0) {\n a = diff;\n if (q) {\n q.words[m] = 1;\n }\n }\n\n for (var j = m - 1; j >= 0; j--) {\n var qj = (a.words[b.length + j] | 0) * 0x4000000 +\n (a.words[b.length + j - 1] | 0);\n\n // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max\n // (0x7ffffff)\n qj = Math.min((qj / bhi) | 0, 0x3ffffff);\n\n a._ishlnsubmul(b, qj, j);\n while (a.negative !== 0) {\n qj--;\n a.negative = 0;\n a._ishlnsubmul(b, 1, j);\n if (!a.isZero()) {\n a.negative ^= 1;\n }\n }\n if (q) {\n q.words[j] = qj;\n }\n }\n if (q) {\n q.strip();\n }\n a.strip();\n\n // Denormalize\n if (mode !== 'div' && shift !== 0) {\n a.iushrn(shift);\n }\n\n return {\n div: q || null,\n mod: a\n };\n };\n\n // NOTE: 1) `mode` can be set to `mod` to request mod only,\n // to `div` to request div only, or be absent to\n // request both div & mod\n // 2) `positive` is true if unsigned mod is requested\n BN.prototype.divmod = function divmod (num, mode, positive) {\n assert(!num.isZero());\n\n if (this.isZero()) {\n return {\n div: new BN(0),\n mod: new BN(0)\n };\n }\n\n var div, mod, res;\n if (this.negative !== 0 && num.negative === 0) {\n res = this.neg().divmod(num, mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.iadd(num);\n }\n }\n\n return {\n div: div,\n mod: mod\n };\n }\n\n if (this.negative === 0 && num.negative !== 0) {\n res = this.divmod(num.neg(), mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n return {\n div: div,\n mod: res.mod\n };\n }\n\n if ((this.negative & num.negative) !== 0) {\n res = this.neg().divmod(num.neg(), mode);\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.isub(num);\n }\n }\n\n return {\n div: res.div,\n mod: mod\n };\n }\n\n // Both numbers are positive at this point\n\n // Strip both numbers to approximate shift value\n if (num.length > this.length || this.cmp(num) < 0) {\n return {\n div: new BN(0),\n mod: this\n };\n }\n\n // Very short reduction\n if (num.length === 1) {\n if (mode === 'div') {\n return {\n div: this.divn(num.words[0]),\n mod: null\n };\n }\n\n if (mode === 'mod') {\n return {\n div: null,\n mod: new BN(this.modn(num.words[0]))\n };\n }\n\n return {\n div: this.divn(num.words[0]),\n mod: new BN(this.modn(num.words[0]))\n };\n }\n\n return this._wordDiv(num, mode);\n };\n\n // Find `this` / `num`\n BN.prototype.div = function div (num) {\n return this.divmod(num, 'div', false).div;\n };\n\n // Find `this` % `num`\n BN.prototype.mod = function mod (num) {\n return this.divmod(num, 'mod', false).mod;\n };\n\n BN.prototype.umod = function umod (num) {\n return this.divmod(num, 'mod', true).mod;\n };\n\n // Find Round(`this` / `num`)\n BN.prototype.divRound = function divRound (num) {\n var dm = this.divmod(num);\n\n // Fast case - exact division\n if (dm.mod.isZero()) return dm.div;\n\n var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;\n\n var half = num.ushrn(1);\n var r2 = num.andln(1);\n var cmp = mod.cmp(half);\n\n // Round down\n if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;\n\n // Round up\n return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);\n };\n\n BN.prototype.modn = function modn (num) {\n assert(num <= 0x3ffffff);\n var p = (1 << 26) % num;\n\n var acc = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n acc = (p * acc + (this.words[i] | 0)) % num;\n }\n\n return acc;\n };\n\n // In-place division by number\n BN.prototype.idivn = function idivn (num) {\n assert(num <= 0x3ffffff);\n\n var carry = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var w = (this.words[i] | 0) + carry * 0x4000000;\n this.words[i] = (w / num) | 0;\n carry = w % num;\n }\n\n return this.strip();\n };\n\n BN.prototype.divn = function divn (num) {\n return this.clone().idivn(num);\n };\n\n BN.prototype.egcd = function egcd (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var x = this;\n var y = p.clone();\n\n if (x.negative !== 0) {\n x = x.umod(p);\n } else {\n x = x.clone();\n }\n\n // A * x + B * y = x\n var A = new BN(1);\n var B = new BN(0);\n\n // C * x + D * y = y\n var C = new BN(0);\n var D = new BN(1);\n\n var g = 0;\n\n while (x.isEven() && y.isEven()) {\n x.iushrn(1);\n y.iushrn(1);\n ++g;\n }\n\n var yp = y.clone();\n var xp = x.clone();\n\n while (!x.isZero()) {\n for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n x.iushrn(i);\n while (i-- > 0) {\n if (A.isOdd() || B.isOdd()) {\n A.iadd(yp);\n B.isub(xp);\n }\n\n A.iushrn(1);\n B.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n y.iushrn(j);\n while (j-- > 0) {\n if (C.isOdd() || D.isOdd()) {\n C.iadd(yp);\n D.isub(xp);\n }\n\n C.iushrn(1);\n D.iushrn(1);\n }\n }\n\n if (x.cmp(y) >= 0) {\n x.isub(y);\n A.isub(C);\n B.isub(D);\n } else {\n y.isub(x);\n C.isub(A);\n D.isub(B);\n }\n }\n\n return {\n a: C,\n b: D,\n gcd: y.iushln(g)\n };\n };\n\n // This is reduced incarnation of the binary EEA\n // above, designated to invert members of the\n // _prime_ fields F(p) at a maximal speed\n BN.prototype._invmp = function _invmp (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var a = this;\n var b = p.clone();\n\n if (a.negative !== 0) {\n a = a.umod(p);\n } else {\n a = a.clone();\n }\n\n var x1 = new BN(1);\n var x2 = new BN(0);\n\n var delta = b.clone();\n\n while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {\n for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n a.iushrn(i);\n while (i-- > 0) {\n if (x1.isOdd()) {\n x1.iadd(delta);\n }\n\n x1.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n b.iushrn(j);\n while (j-- > 0) {\n if (x2.isOdd()) {\n x2.iadd(delta);\n }\n\n x2.iushrn(1);\n }\n }\n\n if (a.cmp(b) >= 0) {\n a.isub(b);\n x1.isub(x2);\n } else {\n b.isub(a);\n x2.isub(x1);\n }\n }\n\n var res;\n if (a.cmpn(1) === 0) {\n res = x1;\n } else {\n res = x2;\n }\n\n if (res.cmpn(0) < 0) {\n res.iadd(p);\n }\n\n return res;\n };\n\n BN.prototype.gcd = function gcd (num) {\n if (this.isZero()) return num.abs();\n if (num.isZero()) return this.abs();\n\n var a = this.clone();\n var b = num.clone();\n a.negative = 0;\n b.negative = 0;\n\n // Remove common factor of two\n for (var shift = 0; a.isEven() && b.isEven(); shift++) {\n a.iushrn(1);\n b.iushrn(1);\n }\n\n do {\n while (a.isEven()) {\n a.iushrn(1);\n }\n while (b.isEven()) {\n b.iushrn(1);\n }\n\n var r = a.cmp(b);\n if (r < 0) {\n // Swap `a` and `b` to make `a` always bigger than `b`\n var t = a;\n a = b;\n b = t;\n } else if (r === 0 || b.cmpn(1) === 0) {\n break;\n }\n\n a.isub(b);\n } while (true);\n\n return b.iushln(shift);\n };\n\n // Invert number in the field F(num)\n BN.prototype.invm = function invm (num) {\n return this.egcd(num).a.umod(num);\n };\n\n BN.prototype.isEven = function isEven () {\n return (this.words[0] & 1) === 0;\n };\n\n BN.prototype.isOdd = function isOdd () {\n return (this.words[0] & 1) === 1;\n };\n\n // And first word and num\n BN.prototype.andln = function andln (num) {\n return this.words[0] & num;\n };\n\n // Increment at the bit position in-line\n BN.prototype.bincn = function bincn (bit) {\n assert(typeof bit === 'number');\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) {\n this._expand(s + 1);\n this.words[s] |= q;\n return this;\n }\n\n // Add bit and propagate, if needed\n var carry = q;\n for (var i = s; carry !== 0 && i < this.length; i++) {\n var w = this.words[i] | 0;\n w += carry;\n carry = w >>> 26;\n w &= 0x3ffffff;\n this.words[i] = w;\n }\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n return this;\n };\n\n BN.prototype.isZero = function isZero () {\n return this.length === 1 && this.words[0] === 0;\n };\n\n BN.prototype.cmpn = function cmpn (num) {\n var negative = num < 0;\n\n if (this.negative !== 0 && !negative) return -1;\n if (this.negative === 0 && negative) return 1;\n\n this.strip();\n\n var res;\n if (this.length > 1) {\n res = 1;\n } else {\n if (negative) {\n num = -num;\n }\n\n assert(num <= 0x3ffffff, 'Number is too big');\n\n var w = this.words[0] | 0;\n res = w === num ? 0 : w < num ? -1 : 1;\n }\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Compare two numbers and return:\n // 1 - if `this` > `num`\n // 0 - if `this` == `num`\n // -1 - if `this` < `num`\n BN.prototype.cmp = function cmp (num) {\n if (this.negative !== 0 && num.negative === 0) return -1;\n if (this.negative === 0 && num.negative !== 0) return 1;\n\n var res = this.ucmp(num);\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Unsigned comparison\n BN.prototype.ucmp = function ucmp (num) {\n // At this point both numbers have the same sign\n if (this.length > num.length) return 1;\n if (this.length < num.length) return -1;\n\n var res = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var a = this.words[i] | 0;\n var b = num.words[i] | 0;\n\n if (a === b) continue;\n if (a < b) {\n res = -1;\n } else if (a > b) {\n res = 1;\n }\n break;\n }\n return res;\n };\n\n BN.prototype.gtn = function gtn (num) {\n return this.cmpn(num) === 1;\n };\n\n BN.prototype.gt = function gt (num) {\n return this.cmp(num) === 1;\n };\n\n BN.prototype.gten = function gten (num) {\n return this.cmpn(num) >= 0;\n };\n\n BN.prototype.gte = function gte (num) {\n return this.cmp(num) >= 0;\n };\n\n BN.prototype.ltn = function ltn (num) {\n return this.cmpn(num) === -1;\n };\n\n BN.prototype.lt = function lt (num) {\n return this.cmp(num) === -1;\n };\n\n BN.prototype.lten = function lten (num) {\n return this.cmpn(num) <= 0;\n };\n\n BN.prototype.lte = function lte (num) {\n return this.cmp(num) <= 0;\n };\n\n BN.prototype.eqn = function eqn (num) {\n return this.cmpn(num) === 0;\n };\n\n BN.prototype.eq = function eq (num) {\n return this.cmp(num) === 0;\n };\n\n //\n // A reduce context, could be using montgomery or something better, depending\n // on the `m` itself.\n //\n BN.red = function red (num) {\n return new Red(num);\n };\n\n BN.prototype.toRed = function toRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n assert(this.negative === 0, 'red works only with positives');\n return ctx.convertTo(this)._forceRed(ctx);\n };\n\n BN.prototype.fromRed = function fromRed () {\n assert(this.red, 'fromRed works only with numbers in reduction context');\n return this.red.convertFrom(this);\n };\n\n BN.prototype._forceRed = function _forceRed (ctx) {\n this.red = ctx;\n return this;\n };\n\n BN.prototype.forceRed = function forceRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n return this._forceRed(ctx);\n };\n\n BN.prototype.redAdd = function redAdd (num) {\n assert(this.red, 'redAdd works only with red numbers');\n return this.red.add(this, num);\n };\n\n BN.prototype.redIAdd = function redIAdd (num) {\n assert(this.red, 'redIAdd works only with red numbers');\n return this.red.iadd(this, num);\n };\n\n BN.prototype.redSub = function redSub (num) {\n assert(this.red, 'redSub works only with red numbers');\n return this.red.sub(this, num);\n };\n\n BN.prototype.redISub = function redISub (num) {\n assert(this.red, 'redISub works only with red numbers');\n return this.red.isub(this, num);\n };\n\n BN.prototype.redShl = function redShl (num) {\n assert(this.red, 'redShl works only with red numbers');\n return this.red.shl(this, num);\n };\n\n BN.prototype.redMul = function redMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.mul(this, num);\n };\n\n BN.prototype.redIMul = function redIMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.imul(this, num);\n };\n\n BN.prototype.redSqr = function redSqr () {\n assert(this.red, 'redSqr works only with red numbers');\n this.red._verify1(this);\n return this.red.sqr(this);\n };\n\n BN.prototype.redISqr = function redISqr () {\n assert(this.red, 'redISqr works only with red numbers');\n this.red._verify1(this);\n return this.red.isqr(this);\n };\n\n // Square root over p\n BN.prototype.redSqrt = function redSqrt () {\n assert(this.red, 'redSqrt works only with red numbers');\n this.red._verify1(this);\n return this.red.sqrt(this);\n };\n\n BN.prototype.redInvm = function redInvm () {\n assert(this.red, 'redInvm works only with red numbers');\n this.red._verify1(this);\n return this.red.invm(this);\n };\n\n // Return negative clone of `this` % `red modulo`\n BN.prototype.redNeg = function redNeg () {\n assert(this.red, 'redNeg works only with red numbers');\n this.red._verify1(this);\n return this.red.neg(this);\n };\n\n BN.prototype.redPow = function redPow (num) {\n assert(this.red && !num.red, 'redPow(normalNum)');\n this.red._verify1(this);\n return this.red.pow(this, num);\n };\n\n // Prime numbers with efficient reduction\n var primes = {\n k256: null,\n p224: null,\n p192: null,\n p25519: null\n };\n\n // Pseudo-Mersenne prime\n function MPrime (name, p) {\n // P = 2 ^ N - K\n this.name = name;\n this.p = new BN(p, 16);\n this.n = this.p.bitLength();\n this.k = new BN(1).iushln(this.n).isub(this.p);\n\n this.tmp = this._tmp();\n }\n\n MPrime.prototype._tmp = function _tmp () {\n var tmp = new BN(null);\n tmp.words = new Array(Math.ceil(this.n / 13));\n return tmp;\n };\n\n MPrime.prototype.ireduce = function ireduce (num) {\n // Assumes that `num` is less than `P^2`\n // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)\n var r = num;\n var rlen;\n\n do {\n this.split(r, this.tmp);\n r = this.imulK(r);\n r = r.iadd(this.tmp);\n rlen = r.bitLength();\n } while (rlen > this.n);\n\n var cmp = rlen < this.n ? -1 : r.ucmp(this.p);\n if (cmp === 0) {\n r.words[0] = 0;\n r.length = 1;\n } else if (cmp > 0) {\n r.isub(this.p);\n } else {\n r.strip();\n }\n\n return r;\n };\n\n MPrime.prototype.split = function split (input, out) {\n input.iushrn(this.n, 0, out);\n };\n\n MPrime.prototype.imulK = function imulK (num) {\n return num.imul(this.k);\n };\n\n function K256 () {\n MPrime.call(\n this,\n 'k256',\n 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');\n }\n inherits(K256, MPrime);\n\n K256.prototype.split = function split (input, output) {\n // 256 = 9 * 26 + 22\n var mask = 0x3fffff;\n\n var outLen = Math.min(input.length, 9);\n for (var i = 0; i < outLen; i++) {\n output.words[i] = input.words[i];\n }\n output.length = outLen;\n\n if (input.length <= 9) {\n input.words[0] = 0;\n input.length = 1;\n return;\n }\n\n // Shift by 9 limbs\n var prev = input.words[9];\n output.words[output.length++] = prev & mask;\n\n for (i = 10; i < input.length; i++) {\n var next = input.words[i] | 0;\n input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\n prev = next;\n }\n prev >>>= 22;\n input.words[i - 10] = prev;\n if (prev === 0 && input.length > 10) {\n input.length -= 10;\n } else {\n input.length -= 9;\n }\n };\n\n K256.prototype.imulK = function imulK (num) {\n // K = 0x1000003d1 = [ 0x40, 0x3d1 ]\n num.words[num.length] = 0;\n num.words[num.length + 1] = 0;\n num.length += 2;\n\n // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\n var lo = 0;\n for (var i = 0; i < num.length; i++) {\n var w = num.words[i] | 0;\n lo += w * 0x3d1;\n num.words[i] = lo & 0x3ffffff;\n lo = w * 0x40 + ((lo / 0x4000000) | 0);\n }\n\n // Fast length reduction\n if (num.words[num.length - 1] === 0) {\n num.length--;\n if (num.words[num.length - 1] === 0) {\n num.length--;\n }\n }\n return num;\n };\n\n function P224 () {\n MPrime.call(\n this,\n 'p224',\n 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');\n }\n inherits(P224, MPrime);\n\n function P192 () {\n MPrime.call(\n this,\n 'p192',\n 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');\n }\n inherits(P192, MPrime);\n\n function P25519 () {\n // 2 ^ 255 - 19\n MPrime.call(\n this,\n '25519',\n '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');\n }\n inherits(P25519, MPrime);\n\n P25519.prototype.imulK = function imulK (num) {\n // K = 0x13\n var carry = 0;\n for (var i = 0; i < num.length; i++) {\n var hi = (num.words[i] | 0) * 0x13 + carry;\n var lo = hi & 0x3ffffff;\n hi >>>= 26;\n\n num.words[i] = lo;\n carry = hi;\n }\n if (carry !== 0) {\n num.words[num.length++] = carry;\n }\n return num;\n };\n\n // Exported mostly for testing purposes, use plain name instead\n BN._prime = function prime (name) {\n // Cached version of prime\n if (primes[name]) return primes[name];\n\n var prime;\n if (name === 'k256') {\n prime = new K256();\n } else if (name === 'p224') {\n prime = new P224();\n } else if (name === 'p192') {\n prime = new P192();\n } else if (name === 'p25519') {\n prime = new P25519();\n } else {\n throw new Error('Unknown prime ' + name);\n }\n primes[name] = prime;\n\n return prime;\n };\n\n //\n // Base reduction engine\n //\n function Red (m) {\n if (typeof m === 'string') {\n var prime = BN._prime(m);\n this.m = prime.p;\n this.prime = prime;\n } else {\n assert(m.gtn(1), 'modulus must be greater than 1');\n this.m = m;\n this.prime = null;\n }\n }\n\n Red.prototype._verify1 = function _verify1 (a) {\n assert(a.negative === 0, 'red works only with positives');\n assert(a.red, 'red works only with red numbers');\n };\n\n Red.prototype._verify2 = function _verify2 (a, b) {\n assert((a.negative | b.negative) === 0, 'red works only with positives');\n assert(a.red && a.red === b.red,\n 'red works only with red numbers');\n };\n\n Red.prototype.imod = function imod (a) {\n if (this.prime) return this.prime.ireduce(a)._forceRed(this);\n return a.umod(this.m)._forceRed(this);\n };\n\n Red.prototype.neg = function neg (a) {\n if (a.isZero()) {\n return a.clone();\n }\n\n return this.m.sub(a)._forceRed(this);\n };\n\n Red.prototype.add = function add (a, b) {\n this._verify2(a, b);\n\n var res = a.add(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.iadd = function iadd (a, b) {\n this._verify2(a, b);\n\n var res = a.iadd(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res;\n };\n\n Red.prototype.sub = function sub (a, b) {\n this._verify2(a, b);\n\n var res = a.sub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.isub = function isub (a, b) {\n this._verify2(a, b);\n\n var res = a.isub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res;\n };\n\n Red.prototype.shl = function shl (a, num) {\n this._verify1(a);\n return this.imod(a.ushln(num));\n };\n\n Red.prototype.imul = function imul (a, b) {\n this._verify2(a, b);\n return this.imod(a.imul(b));\n };\n\n Red.prototype.mul = function mul (a, b) {\n this._verify2(a, b);\n return this.imod(a.mul(b));\n };\n\n Red.prototype.isqr = function isqr (a) {\n return this.imul(a, a.clone());\n };\n\n Red.prototype.sqr = function sqr (a) {\n return this.mul(a, a);\n };\n\n Red.prototype.sqrt = function sqrt (a) {\n if (a.isZero()) return a.clone();\n\n var mod3 = this.m.andln(3);\n assert(mod3 % 2 === 1);\n\n // Fast case\n if (mod3 === 3) {\n var pow = this.m.add(new BN(1)).iushrn(2);\n return this.pow(a, pow);\n }\n\n // Tonelli-Shanks algorithm (Totally unoptimized and slow)\n //\n // Find Q and S, that Q * 2 ^ S = (P - 1)\n var q = this.m.subn(1);\n var s = 0;\n while (!q.isZero() && q.andln(1) === 0) {\n s++;\n q.iushrn(1);\n }\n assert(!q.isZero());\n\n var one = new BN(1).toRed(this);\n var nOne = one.redNeg();\n\n // Find quadratic non-residue\n // NOTE: Max is such because of generalized Riemann hypothesis.\n var lpow = this.m.subn(1).iushrn(1);\n var z = this.m.bitLength();\n z = new BN(2 * z * z).toRed(this);\n\n while (this.pow(z, lpow).cmp(nOne) !== 0) {\n z.redIAdd(nOne);\n }\n\n var c = this.pow(z, q);\n var r = this.pow(a, q.addn(1).iushrn(1));\n var t = this.pow(a, q);\n var m = s;\n while (t.cmp(one) !== 0) {\n var tmp = t;\n for (var i = 0; tmp.cmp(one) !== 0; i++) {\n tmp = tmp.redSqr();\n }\n assert(i < m);\n var b = this.pow(c, new BN(1).iushln(m - i - 1));\n\n r = r.redMul(b);\n c = b.redSqr();\n t = t.redMul(c);\n m = i;\n }\n\n return r;\n };\n\n Red.prototype.invm = function invm (a) {\n var inv = a._invmp(this.m);\n if (inv.negative !== 0) {\n inv.negative = 0;\n return this.imod(inv).redNeg();\n } else {\n return this.imod(inv);\n }\n };\n\n Red.prototype.pow = function pow (a, num) {\n if (num.isZero()) return new BN(1);\n if (num.cmpn(1) === 0) return a.clone();\n\n var windowSize = 4;\n var wnd = new Array(1 << windowSize);\n wnd[0] = new BN(1).toRed(this);\n wnd[1] = a;\n for (var i = 2; i < wnd.length; i++) {\n wnd[i] = this.mul(wnd[i - 1], a);\n }\n\n var res = wnd[0];\n var current = 0;\n var currentLen = 0;\n var start = num.bitLength() % 26;\n if (start === 0) {\n start = 26;\n }\n\n for (i = num.length - 1; i >= 0; i--) {\n var word = num.words[i];\n for (var j = start - 1; j >= 0; j--) {\n var bit = (word >> j) & 1;\n if (res !== wnd[0]) {\n res = this.sqr(res);\n }\n\n if (bit === 0 && current === 0) {\n currentLen = 0;\n continue;\n }\n\n current <<= 1;\n current |= bit;\n currentLen++;\n if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;\n\n res = this.mul(res, wnd[current]);\n currentLen = 0;\n current = 0;\n }\n start = 26;\n }\n\n return res;\n };\n\n Red.prototype.convertTo = function convertTo (num) {\n var r = num.umod(this.m);\n\n return r === num ? r.clone() : r;\n };\n\n Red.prototype.convertFrom = function convertFrom (num) {\n var res = num.clone();\n res.red = null;\n return res;\n };\n\n //\n // Montgomery method engine\n //\n\n BN.mont = function mont (num) {\n return new Mont(num);\n };\n\n function Mont (m) {\n Red.call(this, m);\n\n this.shift = this.m.bitLength();\n if (this.shift % 26 !== 0) {\n this.shift += 26 - (this.shift % 26);\n }\n\n this.r = new BN(1).iushln(this.shift);\n this.r2 = this.imod(this.r.sqr());\n this.rinv = this.r._invmp(this.m);\n\n this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);\n this.minv = this.minv.umod(this.r);\n this.minv = this.r.sub(this.minv);\n }\n inherits(Mont, Red);\n\n Mont.prototype.convertTo = function convertTo (num) {\n return this.imod(num.ushln(this.shift));\n };\n\n Mont.prototype.convertFrom = function convertFrom (num) {\n var r = this.imod(num.mul(this.rinv));\n r.red = null;\n return r;\n };\n\n Mont.prototype.imul = function imul (a, b) {\n if (a.isZero() || b.isZero()) {\n a.words[0] = 0;\n a.length = 1;\n return a;\n }\n\n var t = a.imul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.mul = function mul (a, b) {\n if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);\n\n var t = a.mul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.invm = function invm (a) {\n // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\n var res = this.imod(a._invmp(this.m).mul(this.r2));\n return res._forceRed(this);\n };\n})(typeof module === 'undefined' || module, this);\n","/**\r\n * [js-sha3]{@link https://github.com/emn178/js-sha3}\r\n *\r\n * @version 0.5.5\r\n * @author Chen, Yi-Cyuan [emn178@gmail.com]\r\n * @copyright Chen, Yi-Cyuan 2015-2016\r\n * @license MIT\r\n */\r\n(function (root) {\r\n 'use strict';\r\n\r\n var NODE_JS = typeof process == 'object' && process.versions && process.versions.node;\r\n if (NODE_JS) {\r\n root = global;\r\n }\r\n var COMMON_JS = !root.JS_SHA3_TEST && typeof module == 'object' && module.exports;\r\n var HEX_CHARS = '0123456789abcdef'.split('');\r\n var SHAKE_PADDING = [31, 7936, 2031616, 520093696];\r\n var KECCAK_PADDING = [1, 256, 65536, 16777216];\r\n var PADDING = [6, 1536, 393216, 100663296];\r\n var SHIFT = [0, 8, 16, 24];\r\n var RC = [1, 0, 32898, 0, 32906, 2147483648, 2147516416, 2147483648, 32907, 0, 2147483649,\r\n 0, 2147516545, 2147483648, 32777, 2147483648, 138, 0, 136, 0, 2147516425, 0, \r\n 2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, 2147483648, 32771, \r\n 2147483648, 32770, 2147483648, 128, 2147483648, 32778, 0, 2147483658, 2147483648,\r\n 2147516545, 2147483648, 32896, 2147483648, 2147483649, 0, 2147516424, 2147483648];\r\n var BITS = [224, 256, 384, 512];\r\n var SHAKE_BITS = [128, 256];\r\n var OUTPUT_TYPES = ['hex', 'buffer', 'arrayBuffer', 'array'];\r\n\r\n var createOutputMethod = function (bits, padding, outputType) {\r\n return function (message) {\r\n return new Keccak(bits, padding, bits).update(message)[outputType]();\r\n }\r\n };\r\n\r\n var createShakeOutputMethod = function (bits, padding, outputType) {\r\n return function (message, outputBits) {\r\n return new Keccak(bits, padding, outputBits).update(message)[outputType]();\r\n }\r\n };\r\n\r\n var createMethod = function (bits, padding) {\r\n var method = createOutputMethod(bits, padding, 'hex');\r\n method.create = function () {\r\n return new Keccak(bits, padding, bits);\r\n };\r\n method.update = function (message) {\r\n return method.create().update(message);\r\n };\r\n for (var i = 0;i < OUTPUT_TYPES.length;++i) {\r\n var type = OUTPUT_TYPES[i];\r\n method[type] = createOutputMethod(bits, padding, type);\r\n }\r\n return method;\r\n };\r\n\r\n var createShakeMethod = function (bits, padding) {\r\n var method = createShakeOutputMethod(bits, padding, 'hex');\r\n method.create = function (outputBits) {\r\n return new Keccak(bits, padding, outputBits);\r\n };\r\n method.update = function (message, outputBits) {\r\n return method.create(outputBits).update(message);\r\n };\r\n for (var i = 0;i < OUTPUT_TYPES.length;++i) {\r\n var type = OUTPUT_TYPES[i];\r\n method[type] = createShakeOutputMethod(bits, padding, type);\r\n }\r\n return method;\r\n };\r\n\r\n var algorithms = [\r\n {name: 'keccak', padding: KECCAK_PADDING, bits: BITS, createMethod: createMethod},\r\n {name: 'sha3', padding: PADDING, bits: BITS, createMethod: createMethod},\r\n {name: 'shake', padding: SHAKE_PADDING, bits: SHAKE_BITS, createMethod: createShakeMethod}\r\n ];\r\n\r\n var methods = {};\r\n\r\n for (var i = 0;i < algorithms.length;++i) {\r\n var algorithm = algorithms[i];\r\n var bits = algorithm.bits;\r\n for (var j = 0;j < bits.length;++j) {\r\n methods[algorithm.name +'_' + bits[j]] = algorithm.createMethod(bits[j], algorithm.padding);\r\n }\r\n }\r\n\r\n function Keccak(bits, padding, outputBits) {\r\n this.blocks = [];\r\n this.s = [];\r\n this.padding = padding;\r\n this.outputBits = outputBits;\r\n this.reset = true;\r\n this.block = 0;\r\n this.start = 0;\r\n this.blockCount = (1600 - (bits << 1)) >> 5;\r\n this.byteCount = this.blockCount << 2;\r\n this.outputBlocks = outputBits >> 5;\r\n this.extraBytes = (outputBits & 31) >> 3;\r\n\r\n for (var i = 0;i < 50;++i) {\r\n this.s[i] = 0;\r\n }\r\n };\r\n\r\n Keccak.prototype.update = function (message) {\r\n var notString = typeof message != 'string';\r\n if (notString && message.constructor == root.ArrayBuffer) {\r\n message = new Uint8Array(message);\r\n }\r\n var length = message.length, blocks = this.blocks, byteCount = this.byteCount, \r\n blockCount = this.blockCount, index = 0, s = this.s, i, code;\r\n \r\n while (index < length) {\r\n if (this.reset) {\r\n this.reset = false;\r\n blocks[0] = this.block;\r\n for (i = 1;i < blockCount + 1;++i) {\r\n blocks[i] = 0;\r\n }\r\n }\r\n if (notString) {\r\n for (i = this.start;index < length && i < byteCount;++index) {\r\n blocks[i >> 2] |= message[index] << SHIFT[i++ & 3];\r\n }\r\n } else {\r\n for (i = this.start;index < length && i < byteCount;++index) {\r\n code = message.charCodeAt(index);\r\n if (code < 0x80) {\r\n blocks[i >> 2] |= code << SHIFT[i++ & 3];\r\n } else if (code < 0x800) {\r\n blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3];\r\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\r\n } else if (code < 0xd800 || code >= 0xe000) {\r\n blocks[i >> 2] |= (0xe0 | (code >> 12)) << SHIFT[i++ & 3];\r\n blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];\r\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\r\n } else {\r\n code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));\r\n blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3];\r\n blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3];\r\n blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];\r\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\r\n }\r\n }\r\n }\r\n this.lastByteIndex = i;\r\n if (i >= byteCount) {\r\n this.start = i - byteCount;\r\n this.block = blocks[blockCount];\r\n for (i = 0;i < blockCount;++i) {\r\n s[i] ^= blocks[i];\r\n }\r\n f(s);\r\n this.reset = true;\r\n } else {\r\n this.start = i;\r\n }\r\n }\r\n return this;\r\n };\r\n\r\n Keccak.prototype.finalize = function () {\r\n var blocks = this.blocks, i = this.lastByteIndex, blockCount = this.blockCount, s = this.s;\r\n blocks[i >> 2] |= this.padding[i & 3];\r\n if (this.lastByteIndex == this.byteCount) {\r\n blocks[0] = blocks[blockCount];\r\n for (i = 1;i < blockCount + 1;++i) {\r\n blocks[i] = 0;\r\n }\r\n }\r\n blocks[blockCount - 1] |= 0x80000000;\r\n for (i = 0;i < blockCount;++i) {\r\n s[i] ^= blocks[i];\r\n }\r\n f(s);\r\n };\r\n\r\n Keccak.prototype.toString = Keccak.prototype.hex = function () {\r\n this.finalize();\r\n\r\n var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks, \r\n extraBytes = this.extraBytes, i = 0, j = 0;\r\n var hex = '', block;\r\n while (j < outputBlocks) {\r\n for (i = 0;i < blockCount && j < outputBlocks;++i, ++j) {\r\n block = s[i];\r\n hex += HEX_CHARS[(block >> 4) & 0x0F] + HEX_CHARS[block & 0x0F] +\r\n HEX_CHARS[(block >> 12) & 0x0F] + HEX_CHARS[(block >> 8) & 0x0F] +\r\n HEX_CHARS[(block >> 20) & 0x0F] + HEX_CHARS[(block >> 16) & 0x0F] +\r\n HEX_CHARS[(block >> 28) & 0x0F] + HEX_CHARS[(block >> 24) & 0x0F];\r\n }\r\n if (j % blockCount == 0) {\r\n f(s);\r\n i = 0;\r\n }\r\n }\r\n if (extraBytes) {\r\n block = s[i];\r\n if (extraBytes > 0) {\r\n hex += HEX_CHARS[(block >> 4) & 0x0F] + HEX_CHARS[block & 0x0F];\r\n }\r\n if (extraBytes > 1) {\r\n hex += HEX_CHARS[(block >> 12) & 0x0F] + HEX_CHARS[(block >> 8) & 0x0F];\r\n }\r\n if (extraBytes > 2) {\r\n hex += HEX_CHARS[(block >> 20) & 0x0F] + HEX_CHARS[(block >> 16) & 0x0F];\r\n }\r\n }\r\n return hex;\r\n };\r\n\r\n Keccak.prototype.arrayBuffer = function () {\r\n this.finalize();\r\n\r\n var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks, \r\n extraBytes = this.extraBytes, i = 0, j = 0;\r\n var bytes = this.outputBits >> 3;\r\n var buffer;\r\n if (extraBytes) {\r\n buffer = new ArrayBuffer((outputBlocks + 1) << 2);\r\n } else {\r\n buffer = new ArrayBuffer(bytes);\r\n }\r\n var array = new Uint32Array(buffer);\r\n while (j < outputBlocks) {\r\n for (i = 0;i < blockCount && j < outputBlocks;++i, ++j) {\r\n array[j] = s[i];\r\n }\r\n if (j % blockCount == 0) {\r\n f(s);\r\n }\r\n }\r\n if (extraBytes) {\r\n array[i] = s[i];\r\n buffer = buffer.slice(0, bytes);\r\n }\r\n return buffer;\r\n };\r\n\r\n Keccak.prototype.buffer = Keccak.prototype.arrayBuffer;\r\n\r\n Keccak.prototype.digest = Keccak.prototype.array = function () {\r\n this.finalize();\r\n\r\n var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks, \r\n extraBytes = this.extraBytes, i = 0, j = 0;\r\n var array = [], offset, block;\r\n while (j < outputBlocks) {\r\n for (i = 0;i < blockCount && j < outputBlocks;++i, ++j) {\r\n offset = j << 2;\r\n block = s[i];\r\n array[offset] = block & 0xFF;\r\n array[offset + 1] = (block >> 8) & 0xFF;\r\n array[offset + 2] = (block >> 16) & 0xFF;\r\n array[offset + 3] = (block >> 24) & 0xFF;\r\n }\r\n if (j % blockCount == 0) {\r\n f(s);\r\n }\r\n }\r\n if (extraBytes) {\r\n offset = j << 2;\r\n block = s[i];\r\n if (extraBytes > 0) {\r\n array[offset] = block & 0xFF;\r\n }\r\n if (extraBytes > 1) {\r\n array[offset + 1] = (block >> 8) & 0xFF;\r\n }\r\n if (extraBytes > 2) {\r\n array[offset + 2] = (block >> 16) & 0xFF;\r\n }\r\n }\r\n return array;\r\n };\r\n\r\n var f = function (s) {\r\n var h, l, n, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, \r\n b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16, b17, \r\n b18, b19, b20, b21, b22, b23, b24, b25, b26, b27, b28, b29, b30, b31, b32, b33, \r\n b34, b35, b36, b37, b38, b39, b40, b41, b42, b43, b44, b45, b46, b47, b48, b49;\r\n for (n = 0;n < 48;n += 2) {\r\n c0 = s[0] ^ s[10] ^ s[20] ^ s[30] ^ s[40];\r\n c1 = s[1] ^ s[11] ^ s[21] ^ s[31] ^ s[41];\r\n c2 = s[2] ^ s[12] ^ s[22] ^ s[32] ^ s[42];\r\n c3 = s[3] ^ s[13] ^ s[23] ^ s[33] ^ s[43];\r\n c4 = s[4] ^ s[14] ^ s[24] ^ s[34] ^ s[44];\r\n c5 = s[5] ^ s[15] ^ s[25] ^ s[35] ^ s[45];\r\n c6 = s[6] ^ s[16] ^ s[26] ^ s[36] ^ s[46];\r\n c7 = s[7] ^ s[17] ^ s[27] ^ s[37] ^ s[47];\r\n c8 = s[8] ^ s[18] ^ s[28] ^ s[38] ^ s[48];\r\n c9 = s[9] ^ s[19] ^ s[29] ^ s[39] ^ s[49];\r\n\r\n h = c8 ^ ((c2 << 1) | (c3 >>> 31));\r\n l = c9 ^ ((c3 << 1) | (c2 >>> 31));\r\n s[0] ^= h;\r\n s[1] ^= l;\r\n s[10] ^= h;\r\n s[11] ^= l;\r\n s[20] ^= h;\r\n s[21] ^= l;\r\n s[30] ^= h;\r\n s[31] ^= l;\r\n s[40] ^= h;\r\n s[41] ^= l;\r\n h = c0 ^ ((c4 << 1) | (c5 >>> 31));\r\n l = c1 ^ ((c5 << 1) | (c4 >>> 31));\r\n s[2] ^= h;\r\n s[3] ^= l;\r\n s[12] ^= h;\r\n s[13] ^= l;\r\n s[22] ^= h;\r\n s[23] ^= l;\r\n s[32] ^= h;\r\n s[33] ^= l;\r\n s[42] ^= h;\r\n s[43] ^= l;\r\n h = c2 ^ ((c6 << 1) | (c7 >>> 31));\r\n l = c3 ^ ((c7 << 1) | (c6 >>> 31));\r\n s[4] ^= h;\r\n s[5] ^= l;\r\n s[14] ^= h;\r\n s[15] ^= l;\r\n s[24] ^= h;\r\n s[25] ^= l;\r\n s[34] ^= h;\r\n s[35] ^= l;\r\n s[44] ^= h;\r\n s[45] ^= l;\r\n h = c4 ^ ((c8 << 1) | (c9 >>> 31));\r\n l = c5 ^ ((c9 << 1) | (c8 >>> 31));\r\n s[6] ^= h;\r\n s[7] ^= l;\r\n s[16] ^= h;\r\n s[17] ^= l;\r\n s[26] ^= h;\r\n s[27] ^= l;\r\n s[36] ^= h;\r\n s[37] ^= l;\r\n s[46] ^= h;\r\n s[47] ^= l;\r\n h = c6 ^ ((c0 << 1) | (c1 >>> 31));\r\n l = c7 ^ ((c1 << 1) | (c0 >>> 31));\r\n s[8] ^= h;\r\n s[9] ^= l;\r\n s[18] ^= h;\r\n s[19] ^= l;\r\n s[28] ^= h;\r\n s[29] ^= l;\r\n s[38] ^= h;\r\n s[39] ^= l;\r\n s[48] ^= h;\r\n s[49] ^= l;\r\n\r\n b0 = s[0];\r\n b1 = s[1];\r\n b32 = (s[11] << 4) | (s[10] >>> 28);\r\n b33 = (s[10] << 4) | (s[11] >>> 28);\r\n b14 = (s[20] << 3) | (s[21] >>> 29);\r\n b15 = (s[21] << 3) | (s[20] >>> 29);\r\n b46 = (s[31] << 9) | (s[30] >>> 23);\r\n b47 = (s[30] << 9) | (s[31] >>> 23);\r\n b28 = (s[40] << 18) | (s[41] >>> 14);\r\n b29 = (s[41] << 18) | (s[40] >>> 14);\r\n b20 = (s[2] << 1) | (s[3] >>> 31);\r\n b21 = (s[3] << 1) | (s[2] >>> 31);\r\n b2 = (s[13] << 12) | (s[12] >>> 20);\r\n b3 = (s[12] << 12) | (s[13] >>> 20);\r\n b34 = (s[22] << 10) | (s[23] >>> 22);\r\n b35 = (s[23] << 10) | (s[22] >>> 22);\r\n b16 = (s[33] << 13) | (s[32] >>> 19);\r\n b17 = (s[32] << 13) | (s[33] >>> 19);\r\n b48 = (s[42] << 2) | (s[43] >>> 30);\r\n b49 = (s[43] << 2) | (s[42] >>> 30);\r\n b40 = (s[5] << 30) | (s[4] >>> 2);\r\n b41 = (s[4] << 30) | (s[5] >>> 2);\r\n b22 = (s[14] << 6) | (s[15] >>> 26);\r\n b23 = (s[15] << 6) | (s[14] >>> 26);\r\n b4 = (s[25] << 11) | (s[24] >>> 21);\r\n b5 = (s[24] << 11) | (s[25] >>> 21);\r\n b36 = (s[34] << 15) | (s[35] >>> 17);\r\n b37 = (s[35] << 15) | (s[34] >>> 17);\r\n b18 = (s[45] << 29) | (s[44] >>> 3);\r\n b19 = (s[44] << 29) | (s[45] >>> 3);\r\n b10 = (s[6] << 28) | (s[7] >>> 4);\r\n b11 = (s[7] << 28) | (s[6] >>> 4);\r\n b42 = (s[17] << 23) | (s[16] >>> 9);\r\n b43 = (s[16] << 23) | (s[17] >>> 9);\r\n b24 = (s[26] << 25) | (s[27] >>> 7);\r\n b25 = (s[27] << 25) | (s[26] >>> 7);\r\n b6 = (s[36] << 21) | (s[37] >>> 11);\r\n b7 = (s[37] << 21) | (s[36] >>> 11);\r\n b38 = (s[47] << 24) | (s[46] >>> 8);\r\n b39 = (s[46] << 24) | (s[47] >>> 8);\r\n b30 = (s[8] << 27) | (s[9] >>> 5);\r\n b31 = (s[9] << 27) | (s[8] >>> 5);\r\n b12 = (s[18] << 20) | (s[19] >>> 12);\r\n b13 = (s[19] << 20) | (s[18] >>> 12);\r\n b44 = (s[29] << 7) | (s[28] >>> 25);\r\n b45 = (s[28] << 7) | (s[29] >>> 25);\r\n b26 = (s[38] << 8) | (s[39] >>> 24);\r\n b27 = (s[39] << 8) | (s[38] >>> 24);\r\n b8 = (s[48] << 14) | (s[49] >>> 18);\r\n b9 = (s[49] << 14) | (s[48] >>> 18);\r\n\r\n s[0] = b0 ^ (~b2 & b4);\r\n s[1] = b1 ^ (~b3 & b5);\r\n s[10] = b10 ^ (~b12 & b14);\r\n s[11] = b11 ^ (~b13 & b15);\r\n s[20] = b20 ^ (~b22 & b24);\r\n s[21] = b21 ^ (~b23 & b25);\r\n s[30] = b30 ^ (~b32 & b34);\r\n s[31] = b31 ^ (~b33 & b35);\r\n s[40] = b40 ^ (~b42 & b44);\r\n s[41] = b41 ^ (~b43 & b45);\r\n s[2] = b2 ^ (~b4 & b6);\r\n s[3] = b3 ^ (~b5 & b7);\r\n s[12] = b12 ^ (~b14 & b16);\r\n s[13] = b13 ^ (~b15 & b17);\r\n s[22] = b22 ^ (~b24 & b26);\r\n s[23] = b23 ^ (~b25 & b27);\r\n s[32] = b32 ^ (~b34 & b36);\r\n s[33] = b33 ^ (~b35 & b37);\r\n s[42] = b42 ^ (~b44 & b46);\r\n s[43] = b43 ^ (~b45 & b47);\r\n s[4] = b4 ^ (~b6 & b8);\r\n s[5] = b5 ^ (~b7 & b9);\r\n s[14] = b14 ^ (~b16 & b18);\r\n s[15] = b15 ^ (~b17 & b19);\r\n s[24] = b24 ^ (~b26 & b28);\r\n s[25] = b25 ^ (~b27 & b29);\r\n s[34] = b34 ^ (~b36 & b38);\r\n s[35] = b35 ^ (~b37 & b39);\r\n s[44] = b44 ^ (~b46 & b48);\r\n s[45] = b45 ^ (~b47 & b49);\r\n s[6] = b6 ^ (~b8 & b0);\r\n s[7] = b7 ^ (~b9 & b1);\r\n s[16] = b16 ^ (~b18 & b10);\r\n s[17] = b17 ^ (~b19 & b11);\r\n s[26] = b26 ^ (~b28 & b20);\r\n s[27] = b27 ^ (~b29 & b21);\r\n s[36] = b36 ^ (~b38 & b30);\r\n s[37] = b37 ^ (~b39 & b31);\r\n s[46] = b46 ^ (~b48 & b40);\r\n s[47] = b47 ^ (~b49 & b41);\r\n s[8] = b8 ^ (~b0 & b2);\r\n s[9] = b9 ^ (~b1 & b3);\r\n s[18] = b18 ^ (~b10 & b12);\r\n s[19] = b19 ^ (~b11 & b13);\r\n s[28] = b28 ^ (~b20 & b22);\r\n s[29] = b29 ^ (~b21 & b23);\r\n s[38] = b38 ^ (~b30 & b32);\r\n s[39] = b39 ^ (~b31 & b33);\r\n s[48] = b48 ^ (~b40 & b42);\r\n s[49] = b49 ^ (~b41 & b43);\r\n\r\n s[0] ^= RC[n];\r\n s[1] ^= RC[n + 1];\r\n }\r\n }\r\n\r\n if (COMMON_JS) {\r\n module.exports = methods;\r\n } else if (root) {\r\n for (var key in methods) {\r\n root[key] = methods[key];\r\n }\r\n }\r\n}(this));\r\n","'use strict';\n\nvar BN = require('bn.js');\nvar numberToBN = require('number-to-bn');\n\nvar zero = new BN(0);\nvar negative1 = new BN(-1);\n\n// complete ethereum unit map\nvar unitMap = {\n 'noether': '0', // eslint-disable-line\n 'wei': '1', // eslint-disable-line\n 'kwei': '1000', // eslint-disable-line\n 'Kwei': '1000', // eslint-disable-line\n 'babbage': '1000', // eslint-disable-line\n 'femtoether': '1000', // eslint-disable-line\n 'mwei': '1000000', // eslint-disable-line\n 'Mwei': '1000000', // eslint-disable-line\n 'lovelace': '1000000', // eslint-disable-line\n 'picoether': '1000000', // eslint-disable-line\n 'gwei': '1000000000', // eslint-disable-line\n 'Gwei': '1000000000', // eslint-disable-line\n 'shannon': '1000000000', // eslint-disable-line\n 'nanoether': '1000000000', // eslint-disable-line\n 'nano': '1000000000', // eslint-disable-line\n 'szabo': '1000000000000', // eslint-disable-line\n 'microether': '1000000000000', // eslint-disable-line\n 'micro': '1000000000000', // eslint-disable-line\n 'finney': '1000000000000000', // eslint-disable-line\n 'milliether': '1000000000000000', // eslint-disable-line\n 'milli': '1000000000000000', // eslint-disable-line\n 'ether': '1000000000000000000', // eslint-disable-line\n 'kether': '1000000000000000000000', // eslint-disable-line\n 'grand': '1000000000000000000000', // eslint-disable-line\n 'mether': '1000000000000000000000000', // eslint-disable-line\n 'gether': '1000000000000000000000000000', // eslint-disable-line\n 'tether': '1000000000000000000000000000000' };\n\n/**\n * Returns value of unit in Wei\n *\n * @method getValueOfUnit\n * @param {String} unit the unit to convert to, default ether\n * @returns {BigNumber} value of the unit (in Wei)\n * @throws error if the unit is not correct:w\n */\nfunction getValueOfUnit(unitInput) {\n var unit = unitInput ? unitInput.toLowerCase() : 'ether';\n var unitValue = unitMap[unit]; // eslint-disable-line\n\n if (typeof unitValue !== 'string') {\n throw new Error('[ethjs-unit] the unit provided ' + unitInput + ' doesn\\'t exists, please use the one of the following units ' + JSON.stringify(unitMap, null, 2));\n }\n\n return new BN(unitValue, 10);\n}\n\nfunction numberToString(arg) {\n if (typeof arg === 'string') {\n if (!arg.match(/^-?[0-9.]+$/)) {\n throw new Error('while converting number to string, invalid number value \\'' + arg + '\\', should be a number matching (^-?[0-9.]+).');\n }\n return arg;\n } else if (typeof arg === 'number') {\n return String(arg);\n } else if (typeof arg === 'object' && arg.toString && (arg.toTwos || arg.dividedToIntegerBy)) {\n if (arg.toPrecision) {\n return String(arg.toPrecision());\n } else {\n // eslint-disable-line\n return arg.toString(10);\n }\n }\n throw new Error('while converting number to string, invalid number value \\'' + arg + '\\' type ' + typeof arg + '.');\n}\n\nfunction fromWei(weiInput, unit, optionsInput) {\n var wei = numberToBN(weiInput); // eslint-disable-line\n var negative = wei.lt(zero); // eslint-disable-line\n var base = getValueOfUnit(unit);\n var baseLength = unitMap[unit].length - 1 || 1;\n var options = optionsInput || {};\n\n if (negative) {\n wei = wei.mul(negative1);\n }\n\n var fraction = wei.mod(base).toString(10); // eslint-disable-line\n\n while (fraction.length < baseLength) {\n fraction = '0' + fraction;\n }\n\n if (!options.pad) {\n fraction = fraction.match(/^([0-9]*[1-9]|0)(0*)/)[1];\n }\n\n var whole = wei.div(base).toString(10); // eslint-disable-line\n\n if (options.commify) {\n whole = whole.replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',');\n }\n\n var value = '' + whole + (fraction == '0' ? '' : '.' + fraction); // eslint-disable-line\n\n if (negative) {\n value = '-' + value;\n }\n\n return value;\n}\n\nfunction toWei(etherInput, unit) {\n var ether = numberToString(etherInput); // eslint-disable-line\n var base = getValueOfUnit(unit);\n var baseLength = unitMap[unit].length - 1 || 1;\n\n // Is it negative?\n var negative = ether.substring(0, 1) === '-'; // eslint-disable-line\n if (negative) {\n ether = ether.substring(1);\n }\n\n if (ether === '.') {\n throw new Error('[ethjs-unit] while converting number ' + etherInput + ' to wei, invalid value');\n }\n\n // Split it into a whole and fractional part\n var comps = ether.split('.'); // eslint-disable-line\n if (comps.length > 2) {\n throw new Error('[ethjs-unit] while converting number ' + etherInput + ' to wei, too many decimal points');\n }\n\n var whole = comps[0],\n fraction = comps[1]; // eslint-disable-line\n\n if (!whole) {\n whole = '0';\n }\n if (!fraction) {\n fraction = '0';\n }\n if (fraction.length > baseLength) {\n throw new Error('[ethjs-unit] while converting number ' + etherInput + ' to wei, too many decimal places');\n }\n\n while (fraction.length < baseLength) {\n fraction += '0';\n }\n\n whole = new BN(whole);\n fraction = new BN(fraction);\n var wei = whole.mul(base).add(fraction); // eslint-disable-line\n\n if (negative) {\n wei = wei.mul(negative1);\n }\n\n return new BN(wei.toString(10), 10);\n}\n\nmodule.exports = {\n unitMap: unitMap,\n numberToString: numberToString,\n getValueOfUnit: getValueOfUnit,\n fromWei: fromWei,\n toWei: toWei\n};","(function (module, exports) {\n 'use strict';\n\n // Utils\n function assert (val, msg) {\n if (!val) throw new Error(msg || 'Assertion failed');\n }\n\n // Could use `inherits` module, but don't want to move from single file\n // architecture yet.\n function inherits (ctor, superCtor) {\n ctor.super_ = superCtor;\n var TempCtor = function () {};\n TempCtor.prototype = superCtor.prototype;\n ctor.prototype = new TempCtor();\n ctor.prototype.constructor = ctor;\n }\n\n // BN\n\n function BN (number, base, endian) {\n if (BN.isBN(number)) {\n return number;\n }\n\n this.negative = 0;\n this.words = null;\n this.length = 0;\n\n // Reduction context\n this.red = null;\n\n if (number !== null) {\n if (base === 'le' || base === 'be') {\n endian = base;\n base = 10;\n }\n\n this._init(number || 0, base || 10, endian || 'be');\n }\n }\n if (typeof module === 'object') {\n module.exports = BN;\n } else {\n exports.BN = BN;\n }\n\n BN.BN = BN;\n BN.wordSize = 26;\n\n var Buffer;\n try {\n Buffer = require('buf' + 'fer').Buffer;\n } catch (e) {\n }\n\n BN.isBN = function isBN (num) {\n if (num instanceof BN) {\n return true;\n }\n\n return num !== null && typeof num === 'object' &&\n num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);\n };\n\n BN.max = function max (left, right) {\n if (left.cmp(right) > 0) return left;\n return right;\n };\n\n BN.min = function min (left, right) {\n if (left.cmp(right) < 0) return left;\n return right;\n };\n\n BN.prototype._init = function init (number, base, endian) {\n if (typeof number === 'number') {\n return this._initNumber(number, base, endian);\n }\n\n if (typeof number === 'object') {\n return this._initArray(number, base, endian);\n }\n\n if (base === 'hex') {\n base = 16;\n }\n assert(base === (base | 0) && base >= 2 && base <= 36);\n\n number = number.toString().replace(/\\s+/g, '');\n var start = 0;\n if (number[0] === '-') {\n start++;\n }\n\n if (base === 16) {\n this._parseHex(number, start);\n } else {\n this._parseBase(number, base, start);\n }\n\n if (number[0] === '-') {\n this.negative = 1;\n }\n\n this.strip();\n\n if (endian !== 'le') return;\n\n this._initArray(this.toArray(), base, endian);\n };\n\n BN.prototype._initNumber = function _initNumber (number, base, endian) {\n if (number < 0) {\n this.negative = 1;\n number = -number;\n }\n if (number < 0x4000000) {\n this.words = [ number & 0x3ffffff ];\n this.length = 1;\n } else if (number < 0x10000000000000) {\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff\n ];\n this.length = 2;\n } else {\n assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff,\n 1\n ];\n this.length = 3;\n }\n\n if (endian !== 'le') return;\n\n // Reverse the bytes\n this._initArray(this.toArray(), base, endian);\n };\n\n BN.prototype._initArray = function _initArray (number, base, endian) {\n // Perhaps a Uint8Array\n assert(typeof number.length === 'number');\n if (number.length <= 0) {\n this.words = [ 0 ];\n this.length = 1;\n return this;\n }\n\n this.length = Math.ceil(number.length / 3);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n var j, w;\n var off = 0;\n if (endian === 'be') {\n for (i = number.length - 1, j = 0; i >= 0; i -= 3) {\n w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n } else if (endian === 'le') {\n for (i = 0, j = 0; i < number.length; i += 3) {\n w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n }\n return this.strip();\n };\n\n function parseHex (str, start, end) {\n var r = 0;\n var len = Math.min(str.length, end);\n for (var i = start; i < len; i++) {\n var c = str.charCodeAt(i) - 48;\n\n r <<= 4;\n\n // 'a' - 'f'\n if (c >= 49 && c <= 54) {\n r |= c - 49 + 0xa;\n\n // 'A' - 'F'\n } else if (c >= 17 && c <= 22) {\n r |= c - 17 + 0xa;\n\n // '0' - '9'\n } else {\n r |= c & 0xf;\n }\n }\n return r;\n }\n\n BN.prototype._parseHex = function _parseHex (number, start) {\n // Create possibly bigger array to ensure that it fits the number\n this.length = Math.ceil((number.length - start) / 6);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n var j, w;\n // Scan 24-bit chunks and add them to the number\n var off = 0;\n for (i = number.length - 6, j = 0; i >= start; i -= 6) {\n w = parseHex(number, i, i + 6);\n this.words[j] |= (w << off) & 0x3ffffff;\n // NOTE: `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb\n this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n if (i + 6 !== start) {\n w = parseHex(number, start, i + 6);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;\n }\n this.strip();\n };\n\n function parseBase (str, start, end, mul) {\n var r = 0;\n var len = Math.min(str.length, end);\n for (var i = start; i < len; i++) {\n var c = str.charCodeAt(i) - 48;\n\n r *= mul;\n\n // 'a'\n if (c >= 49) {\n r += c - 49 + 0xa;\n\n // 'A'\n } else if (c >= 17) {\n r += c - 17 + 0xa;\n\n // '0' - '9'\n } else {\n r += c;\n }\n }\n return r;\n }\n\n BN.prototype._parseBase = function _parseBase (number, base, start) {\n // Initialize as zero\n this.words = [ 0 ];\n this.length = 1;\n\n // Find length of limb in base\n for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {\n limbLen++;\n }\n limbLen--;\n limbPow = (limbPow / base) | 0;\n\n var total = number.length - start;\n var mod = total % limbLen;\n var end = Math.min(total, total - mod) + start;\n\n var word = 0;\n for (var i = start; i < end; i += limbLen) {\n word = parseBase(number, i, i + limbLen, base);\n\n this.imuln(limbPow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n if (mod !== 0) {\n var pow = 1;\n word = parseBase(number, i, number.length, base);\n\n for (i = 0; i < mod; i++) {\n pow *= base;\n }\n\n this.imuln(pow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n };\n\n BN.prototype.copy = function copy (dest) {\n dest.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n dest.words[i] = this.words[i];\n }\n dest.length = this.length;\n dest.negative = this.negative;\n dest.red = this.red;\n };\n\n BN.prototype.clone = function clone () {\n var r = new BN(null);\n this.copy(r);\n return r;\n };\n\n BN.prototype._expand = function _expand (size) {\n while (this.length < size) {\n this.words[this.length++] = 0;\n }\n return this;\n };\n\n // Remove leading `0` from `this`\n BN.prototype.strip = function strip () {\n while (this.length > 1 && this.words[this.length - 1] === 0) {\n this.length--;\n }\n return this._normSign();\n };\n\n BN.prototype._normSign = function _normSign () {\n // -0 = 0\n if (this.length === 1 && this.words[0] === 0) {\n this.negative = 0;\n }\n return this;\n };\n\n BN.prototype.inspect = function inspect () {\n return (this.red ? '';\n };\n\n /*\n\n var zeros = [];\n var groupSizes = [];\n var groupBases = [];\n\n var s = '';\n var i = -1;\n while (++i < BN.wordSize) {\n zeros[i] = s;\n s += '0';\n }\n groupSizes[0] = 0;\n groupSizes[1] = 0;\n groupBases[0] = 0;\n groupBases[1] = 0;\n var base = 2 - 1;\n while (++base < 36 + 1) {\n var groupSize = 0;\n var groupBase = 1;\n while (groupBase < (1 << BN.wordSize) / base) {\n groupBase *= base;\n groupSize += 1;\n }\n groupSizes[base] = groupSize;\n groupBases[base] = groupBase;\n }\n\n */\n\n var zeros = [\n '',\n '0',\n '00',\n '000',\n '0000',\n '00000',\n '000000',\n '0000000',\n '00000000',\n '000000000',\n '0000000000',\n '00000000000',\n '000000000000',\n '0000000000000',\n '00000000000000',\n '000000000000000',\n '0000000000000000',\n '00000000000000000',\n '000000000000000000',\n '0000000000000000000',\n '00000000000000000000',\n '000000000000000000000',\n '0000000000000000000000',\n '00000000000000000000000',\n '000000000000000000000000',\n '0000000000000000000000000'\n ];\n\n var groupSizes = [\n 0, 0,\n 25, 16, 12, 11, 10, 9, 8,\n 8, 7, 7, 7, 7, 6, 6,\n 6, 6, 6, 6, 6, 5, 5,\n 5, 5, 5, 5, 5, 5, 5,\n 5, 5, 5, 5, 5, 5, 5\n ];\n\n var groupBases = [\n 0, 0,\n 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,\n 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,\n 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,\n 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,\n 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176\n ];\n\n BN.prototype.toString = function toString (base, padding) {\n base = base || 10;\n padding = padding | 0 || 1;\n\n var out;\n if (base === 16 || base === 'hex') {\n out = '';\n var off = 0;\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = this.words[i];\n var word = (((w << off) | carry) & 0xffffff).toString(16);\n carry = (w >>> (24 - off)) & 0xffffff;\n if (carry !== 0 || i !== this.length - 1) {\n out = zeros[6 - word.length] + word + out;\n } else {\n out = word + out;\n }\n off += 2;\n if (off >= 26) {\n off -= 26;\n i--;\n }\n }\n if (carry !== 0) {\n out = carry.toString(16) + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n if (base === (base | 0) && base >= 2 && base <= 36) {\n // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));\n var groupSize = groupSizes[base];\n // var groupBase = Math.pow(base, groupSize);\n var groupBase = groupBases[base];\n out = '';\n var c = this.clone();\n c.negative = 0;\n while (!c.isZero()) {\n var r = c.modn(groupBase).toString(base);\n c = c.idivn(groupBase);\n\n if (!c.isZero()) {\n out = zeros[groupSize - r.length] + r + out;\n } else {\n out = r + out;\n }\n }\n if (this.isZero()) {\n out = '0' + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n assert(false, 'Base should be between 2 and 36');\n };\n\n BN.prototype.toNumber = function toNumber () {\n var ret = this.words[0];\n if (this.length === 2) {\n ret += this.words[1] * 0x4000000;\n } else if (this.length === 3 && this.words[2] === 0x01) {\n // NOTE: at this stage it is known that the top bit is set\n ret += 0x10000000000000 + (this.words[1] * 0x4000000);\n } else if (this.length > 2) {\n assert(false, 'Number can only safely store up to 53 bits');\n }\n return (this.negative !== 0) ? -ret : ret;\n };\n\n BN.prototype.toJSON = function toJSON () {\n return this.toString(16);\n };\n\n BN.prototype.toBuffer = function toBuffer (endian, length) {\n assert(typeof Buffer !== 'undefined');\n return this.toArrayLike(Buffer, endian, length);\n };\n\n BN.prototype.toArray = function toArray (endian, length) {\n return this.toArrayLike(Array, endian, length);\n };\n\n BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {\n var byteLength = this.byteLength();\n var reqLength = length || Math.max(1, byteLength);\n assert(byteLength <= reqLength, 'byte array longer than desired length');\n assert(reqLength > 0, 'Requested array length <= 0');\n\n this.strip();\n var littleEndian = endian === 'le';\n var res = new ArrayType(reqLength);\n\n var b, i;\n var q = this.clone();\n if (!littleEndian) {\n // Assume big-endian\n for (i = 0; i < reqLength - byteLength; i++) {\n res[i] = 0;\n }\n\n for (i = 0; !q.isZero(); i++) {\n b = q.andln(0xff);\n q.iushrn(8);\n\n res[reqLength - i - 1] = b;\n }\n } else {\n for (i = 0; !q.isZero(); i++) {\n b = q.andln(0xff);\n q.iushrn(8);\n\n res[i] = b;\n }\n\n for (; i < reqLength; i++) {\n res[i] = 0;\n }\n }\n\n return res;\n };\n\n if (Math.clz32) {\n BN.prototype._countBits = function _countBits (w) {\n return 32 - Math.clz32(w);\n };\n } else {\n BN.prototype._countBits = function _countBits (w) {\n var t = w;\n var r = 0;\n if (t >= 0x1000) {\n r += 13;\n t >>>= 13;\n }\n if (t >= 0x40) {\n r += 7;\n t >>>= 7;\n }\n if (t >= 0x8) {\n r += 4;\n t >>>= 4;\n }\n if (t >= 0x02) {\n r += 2;\n t >>>= 2;\n }\n return r + t;\n };\n }\n\n BN.prototype._zeroBits = function _zeroBits (w) {\n // Short-cut\n if (w === 0) return 26;\n\n var t = w;\n var r = 0;\n if ((t & 0x1fff) === 0) {\n r += 13;\n t >>>= 13;\n }\n if ((t & 0x7f) === 0) {\n r += 7;\n t >>>= 7;\n }\n if ((t & 0xf) === 0) {\n r += 4;\n t >>>= 4;\n }\n if ((t & 0x3) === 0) {\n r += 2;\n t >>>= 2;\n }\n if ((t & 0x1) === 0) {\n r++;\n }\n return r;\n };\n\n // Return number of used bits in a BN\n BN.prototype.bitLength = function bitLength () {\n var w = this.words[this.length - 1];\n var hi = this._countBits(w);\n return (this.length - 1) * 26 + hi;\n };\n\n function toBitArray (num) {\n var w = new Array(num.bitLength());\n\n for (var bit = 0; bit < w.length; bit++) {\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n w[bit] = (num.words[off] & (1 << wbit)) >>> wbit;\n }\n\n return w;\n }\n\n // Number of trailing zero bits\n BN.prototype.zeroBits = function zeroBits () {\n if (this.isZero()) return 0;\n\n var r = 0;\n for (var i = 0; i < this.length; i++) {\n var b = this._zeroBits(this.words[i]);\n r += b;\n if (b !== 26) break;\n }\n return r;\n };\n\n BN.prototype.byteLength = function byteLength () {\n return Math.ceil(this.bitLength() / 8);\n };\n\n BN.prototype.toTwos = function toTwos (width) {\n if (this.negative !== 0) {\n return this.abs().inotn(width).iaddn(1);\n }\n return this.clone();\n };\n\n BN.prototype.fromTwos = function fromTwos (width) {\n if (this.testn(width - 1)) {\n return this.notn(width).iaddn(1).ineg();\n }\n return this.clone();\n };\n\n BN.prototype.isNeg = function isNeg () {\n return this.negative !== 0;\n };\n\n // Return negative clone of `this`\n BN.prototype.neg = function neg () {\n return this.clone().ineg();\n };\n\n BN.prototype.ineg = function ineg () {\n if (!this.isZero()) {\n this.negative ^= 1;\n }\n\n return this;\n };\n\n // Or `num` with `this` in-place\n BN.prototype.iuor = function iuor (num) {\n while (this.length < num.length) {\n this.words[this.length++] = 0;\n }\n\n for (var i = 0; i < num.length; i++) {\n this.words[i] = this.words[i] | num.words[i];\n }\n\n return this.strip();\n };\n\n BN.prototype.ior = function ior (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuor(num);\n };\n\n // Or `num` with `this`\n BN.prototype.or = function or (num) {\n if (this.length > num.length) return this.clone().ior(num);\n return num.clone().ior(this);\n };\n\n BN.prototype.uor = function uor (num) {\n if (this.length > num.length) return this.clone().iuor(num);\n return num.clone().iuor(this);\n };\n\n // And `num` with `this` in-place\n BN.prototype.iuand = function iuand (num) {\n // b = min-length(num, this)\n var b;\n if (this.length > num.length) {\n b = num;\n } else {\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = this.words[i] & num.words[i];\n }\n\n this.length = b.length;\n\n return this.strip();\n };\n\n BN.prototype.iand = function iand (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuand(num);\n };\n\n // And `num` with `this`\n BN.prototype.and = function and (num) {\n if (this.length > num.length) return this.clone().iand(num);\n return num.clone().iand(this);\n };\n\n BN.prototype.uand = function uand (num) {\n if (this.length > num.length) return this.clone().iuand(num);\n return num.clone().iuand(this);\n };\n\n // Xor `num` with `this` in-place\n BN.prototype.iuxor = function iuxor (num) {\n // a.length > b.length\n var a;\n var b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = a.words[i] ^ b.words[i];\n }\n\n if (this !== a) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = a.length;\n\n return this.strip();\n };\n\n BN.prototype.ixor = function ixor (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuxor(num);\n };\n\n // Xor `num` with `this`\n BN.prototype.xor = function xor (num) {\n if (this.length > num.length) return this.clone().ixor(num);\n return num.clone().ixor(this);\n };\n\n BN.prototype.uxor = function uxor (num) {\n if (this.length > num.length) return this.clone().iuxor(num);\n return num.clone().iuxor(this);\n };\n\n // Not ``this`` with ``width`` bitwidth\n BN.prototype.inotn = function inotn (width) {\n assert(typeof width === 'number' && width >= 0);\n\n var bytesNeeded = Math.ceil(width / 26) | 0;\n var bitsLeft = width % 26;\n\n // Extend the buffer with leading zeroes\n this._expand(bytesNeeded);\n\n if (bitsLeft > 0) {\n bytesNeeded--;\n }\n\n // Handle complete words\n for (var i = 0; i < bytesNeeded; i++) {\n this.words[i] = ~this.words[i] & 0x3ffffff;\n }\n\n // Handle the residue\n if (bitsLeft > 0) {\n this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));\n }\n\n // And remove leading zeroes\n return this.strip();\n };\n\n BN.prototype.notn = function notn (width) {\n return this.clone().inotn(width);\n };\n\n // Set `bit` of `this`\n BN.prototype.setn = function setn (bit, val) {\n assert(typeof bit === 'number' && bit >= 0);\n\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n this._expand(off + 1);\n\n if (val) {\n this.words[off] = this.words[off] | (1 << wbit);\n } else {\n this.words[off] = this.words[off] & ~(1 << wbit);\n }\n\n return this.strip();\n };\n\n // Add `num` to `this` in-place\n BN.prototype.iadd = function iadd (num) {\n var r;\n\n // negative + positive\n if (this.negative !== 0 && num.negative === 0) {\n this.negative = 0;\n r = this.isub(num);\n this.negative ^= 1;\n return this._normSign();\n\n // positive + negative\n } else if (this.negative === 0 && num.negative !== 0) {\n num.negative = 0;\n r = this.isub(num);\n num.negative = 1;\n return r._normSign();\n }\n\n // a.length > b.length\n var a, b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n\n this.length = a.length;\n if (carry !== 0) {\n this.words[this.length] = carry;\n this.length++;\n // Copy the rest of the words\n } else if (a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n return this;\n };\n\n // Add `num` to `this`\n BN.prototype.add = function add (num) {\n var res;\n if (num.negative !== 0 && this.negative === 0) {\n num.negative = 0;\n res = this.sub(num);\n num.negative ^= 1;\n return res;\n } else if (num.negative === 0 && this.negative !== 0) {\n this.negative = 0;\n res = num.sub(this);\n this.negative = 1;\n return res;\n }\n\n if (this.length > num.length) return this.clone().iadd(num);\n\n return num.clone().iadd(this);\n };\n\n // Subtract `num` from `this` in-place\n BN.prototype.isub = function isub (num) {\n // this - (-num) = this + num\n if (num.negative !== 0) {\n num.negative = 0;\n var r = this.iadd(num);\n num.negative = 1;\n return r._normSign();\n\n // -this - num = -(this + num)\n } else if (this.negative !== 0) {\n this.negative = 0;\n this.iadd(num);\n this.negative = 1;\n return this._normSign();\n }\n\n // At this point both numbers are positive\n var cmp = this.cmp(num);\n\n // Optimization - zeroify\n if (cmp === 0) {\n this.negative = 0;\n this.length = 1;\n this.words[0] = 0;\n return this;\n }\n\n // a > b\n var a, b;\n if (cmp > 0) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n\n // Copy rest of the words\n if (carry === 0 && i < a.length && a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = Math.max(this.length, i);\n\n if (a !== this) {\n this.negative = 1;\n }\n\n return this.strip();\n };\n\n // Subtract `num` from `this`\n BN.prototype.sub = function sub (num) {\n return this.clone().isub(num);\n };\n\n function smallMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n var len = (self.length + num.length) | 0;\n out.length = len;\n len = (len - 1) | 0;\n\n // Peel one iteration (compiler can't do it, because of code complexity)\n var a = self.words[0] | 0;\n var b = num.words[0] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n var carry = (r / 0x4000000) | 0;\n out.words[0] = lo;\n\n for (var k = 1; k < len; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = carry >>> 26;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = (k - j) | 0;\n a = self.words[i] | 0;\n b = num.words[j] | 0;\n r = a * b + rword;\n ncarry += (r / 0x4000000) | 0;\n rword = r & 0x3ffffff;\n }\n out.words[k] = rword | 0;\n carry = ncarry | 0;\n }\n if (carry !== 0) {\n out.words[k] = carry | 0;\n } else {\n out.length--;\n }\n\n return out.strip();\n }\n\n // TODO(indutny): it may be reasonable to omit it for users who don't need\n // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit\n // multiplication (like elliptic secp256k1).\n var comb10MulTo = function comb10MulTo (self, num, out) {\n var a = self.words;\n var b = num.words;\n var o = out.words;\n var c = 0;\n var lo;\n var mid;\n var hi;\n var a0 = a[0] | 0;\n var al0 = a0 & 0x1fff;\n var ah0 = a0 >>> 13;\n var a1 = a[1] | 0;\n var al1 = a1 & 0x1fff;\n var ah1 = a1 >>> 13;\n var a2 = a[2] | 0;\n var al2 = a2 & 0x1fff;\n var ah2 = a2 >>> 13;\n var a3 = a[3] | 0;\n var al3 = a3 & 0x1fff;\n var ah3 = a3 >>> 13;\n var a4 = a[4] | 0;\n var al4 = a4 & 0x1fff;\n var ah4 = a4 >>> 13;\n var a5 = a[5] | 0;\n var al5 = a5 & 0x1fff;\n var ah5 = a5 >>> 13;\n var a6 = a[6] | 0;\n var al6 = a6 & 0x1fff;\n var ah6 = a6 >>> 13;\n var a7 = a[7] | 0;\n var al7 = a7 & 0x1fff;\n var ah7 = a7 >>> 13;\n var a8 = a[8] | 0;\n var al8 = a8 & 0x1fff;\n var ah8 = a8 >>> 13;\n var a9 = a[9] | 0;\n var al9 = a9 & 0x1fff;\n var ah9 = a9 >>> 13;\n var b0 = b[0] | 0;\n var bl0 = b0 & 0x1fff;\n var bh0 = b0 >>> 13;\n var b1 = b[1] | 0;\n var bl1 = b1 & 0x1fff;\n var bh1 = b1 >>> 13;\n var b2 = b[2] | 0;\n var bl2 = b2 & 0x1fff;\n var bh2 = b2 >>> 13;\n var b3 = b[3] | 0;\n var bl3 = b3 & 0x1fff;\n var bh3 = b3 >>> 13;\n var b4 = b[4] | 0;\n var bl4 = b4 & 0x1fff;\n var bh4 = b4 >>> 13;\n var b5 = b[5] | 0;\n var bl5 = b5 & 0x1fff;\n var bh5 = b5 >>> 13;\n var b6 = b[6] | 0;\n var bl6 = b6 & 0x1fff;\n var bh6 = b6 >>> 13;\n var b7 = b[7] | 0;\n var bl7 = b7 & 0x1fff;\n var bh7 = b7 >>> 13;\n var b8 = b[8] | 0;\n var bl8 = b8 & 0x1fff;\n var bh8 = b8 >>> 13;\n var b9 = b[9] | 0;\n var bl9 = b9 & 0x1fff;\n var bh9 = b9 >>> 13;\n\n out.negative = self.negative ^ num.negative;\n out.length = 19;\n /* k = 0 */\n lo = Math.imul(al0, bl0);\n mid = Math.imul(al0, bh0);\n mid = (mid + Math.imul(ah0, bl0)) | 0;\n hi = Math.imul(ah0, bh0);\n var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\n w0 &= 0x3ffffff;\n /* k = 1 */\n lo = Math.imul(al1, bl0);\n mid = Math.imul(al1, bh0);\n mid = (mid + Math.imul(ah1, bl0)) | 0;\n hi = Math.imul(ah1, bh0);\n lo = (lo + Math.imul(al0, bl1)) | 0;\n mid = (mid + Math.imul(al0, bh1)) | 0;\n mid = (mid + Math.imul(ah0, bl1)) | 0;\n hi = (hi + Math.imul(ah0, bh1)) | 0;\n var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\n w1 &= 0x3ffffff;\n /* k = 2 */\n lo = Math.imul(al2, bl0);\n mid = Math.imul(al2, bh0);\n mid = (mid + Math.imul(ah2, bl0)) | 0;\n hi = Math.imul(ah2, bh0);\n lo = (lo + Math.imul(al1, bl1)) | 0;\n mid = (mid + Math.imul(al1, bh1)) | 0;\n mid = (mid + Math.imul(ah1, bl1)) | 0;\n hi = (hi + Math.imul(ah1, bh1)) | 0;\n lo = (lo + Math.imul(al0, bl2)) | 0;\n mid = (mid + Math.imul(al0, bh2)) | 0;\n mid = (mid + Math.imul(ah0, bl2)) | 0;\n hi = (hi + Math.imul(ah0, bh2)) | 0;\n var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\n w2 &= 0x3ffffff;\n /* k = 3 */\n lo = Math.imul(al3, bl0);\n mid = Math.imul(al3, bh0);\n mid = (mid + Math.imul(ah3, bl0)) | 0;\n hi = Math.imul(ah3, bh0);\n lo = (lo + Math.imul(al2, bl1)) | 0;\n mid = (mid + Math.imul(al2, bh1)) | 0;\n mid = (mid + Math.imul(ah2, bl1)) | 0;\n hi = (hi + Math.imul(ah2, bh1)) | 0;\n lo = (lo + Math.imul(al1, bl2)) | 0;\n mid = (mid + Math.imul(al1, bh2)) | 0;\n mid = (mid + Math.imul(ah1, bl2)) | 0;\n hi = (hi + Math.imul(ah1, bh2)) | 0;\n lo = (lo + Math.imul(al0, bl3)) | 0;\n mid = (mid + Math.imul(al0, bh3)) | 0;\n mid = (mid + Math.imul(ah0, bl3)) | 0;\n hi = (hi + Math.imul(ah0, bh3)) | 0;\n var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\n w3 &= 0x3ffffff;\n /* k = 4 */\n lo = Math.imul(al4, bl0);\n mid = Math.imul(al4, bh0);\n mid = (mid + Math.imul(ah4, bl0)) | 0;\n hi = Math.imul(ah4, bh0);\n lo = (lo + Math.imul(al3, bl1)) | 0;\n mid = (mid + Math.imul(al3, bh1)) | 0;\n mid = (mid + Math.imul(ah3, bl1)) | 0;\n hi = (hi + Math.imul(ah3, bh1)) | 0;\n lo = (lo + Math.imul(al2, bl2)) | 0;\n mid = (mid + Math.imul(al2, bh2)) | 0;\n mid = (mid + Math.imul(ah2, bl2)) | 0;\n hi = (hi + Math.imul(ah2, bh2)) | 0;\n lo = (lo + Math.imul(al1, bl3)) | 0;\n mid = (mid + Math.imul(al1, bh3)) | 0;\n mid = (mid + Math.imul(ah1, bl3)) | 0;\n hi = (hi + Math.imul(ah1, bh3)) | 0;\n lo = (lo + Math.imul(al0, bl4)) | 0;\n mid = (mid + Math.imul(al0, bh4)) | 0;\n mid = (mid + Math.imul(ah0, bl4)) | 0;\n hi = (hi + Math.imul(ah0, bh4)) | 0;\n var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\n w4 &= 0x3ffffff;\n /* k = 5 */\n lo = Math.imul(al5, bl0);\n mid = Math.imul(al5, bh0);\n mid = (mid + Math.imul(ah5, bl0)) | 0;\n hi = Math.imul(ah5, bh0);\n lo = (lo + Math.imul(al4, bl1)) | 0;\n mid = (mid + Math.imul(al4, bh1)) | 0;\n mid = (mid + Math.imul(ah4, bl1)) | 0;\n hi = (hi + Math.imul(ah4, bh1)) | 0;\n lo = (lo + Math.imul(al3, bl2)) | 0;\n mid = (mid + Math.imul(al3, bh2)) | 0;\n mid = (mid + Math.imul(ah3, bl2)) | 0;\n hi = (hi + Math.imul(ah3, bh2)) | 0;\n lo = (lo + Math.imul(al2, bl3)) | 0;\n mid = (mid + Math.imul(al2, bh3)) | 0;\n mid = (mid + Math.imul(ah2, bl3)) | 0;\n hi = (hi + Math.imul(ah2, bh3)) | 0;\n lo = (lo + Math.imul(al1, bl4)) | 0;\n mid = (mid + Math.imul(al1, bh4)) | 0;\n mid = (mid + Math.imul(ah1, bl4)) | 0;\n hi = (hi + Math.imul(ah1, bh4)) | 0;\n lo = (lo + Math.imul(al0, bl5)) | 0;\n mid = (mid + Math.imul(al0, bh5)) | 0;\n mid = (mid + Math.imul(ah0, bl5)) | 0;\n hi = (hi + Math.imul(ah0, bh5)) | 0;\n var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\n w5 &= 0x3ffffff;\n /* k = 6 */\n lo = Math.imul(al6, bl0);\n mid = Math.imul(al6, bh0);\n mid = (mid + Math.imul(ah6, bl0)) | 0;\n hi = Math.imul(ah6, bh0);\n lo = (lo + Math.imul(al5, bl1)) | 0;\n mid = (mid + Math.imul(al5, bh1)) | 0;\n mid = (mid + Math.imul(ah5, bl1)) | 0;\n hi = (hi + Math.imul(ah5, bh1)) | 0;\n lo = (lo + Math.imul(al4, bl2)) | 0;\n mid = (mid + Math.imul(al4, bh2)) | 0;\n mid = (mid + Math.imul(ah4, bl2)) | 0;\n hi = (hi + Math.imul(ah4, bh2)) | 0;\n lo = (lo + Math.imul(al3, bl3)) | 0;\n mid = (mid + Math.imul(al3, bh3)) | 0;\n mid = (mid + Math.imul(ah3, bl3)) | 0;\n hi = (hi + Math.imul(ah3, bh3)) | 0;\n lo = (lo + Math.imul(al2, bl4)) | 0;\n mid = (mid + Math.imul(al2, bh4)) | 0;\n mid = (mid + Math.imul(ah2, bl4)) | 0;\n hi = (hi + Math.imul(ah2, bh4)) | 0;\n lo = (lo + Math.imul(al1, bl5)) | 0;\n mid = (mid + Math.imul(al1, bh5)) | 0;\n mid = (mid + Math.imul(ah1, bl5)) | 0;\n hi = (hi + Math.imul(ah1, bh5)) | 0;\n lo = (lo + Math.imul(al0, bl6)) | 0;\n mid = (mid + Math.imul(al0, bh6)) | 0;\n mid = (mid + Math.imul(ah0, bl6)) | 0;\n hi = (hi + Math.imul(ah0, bh6)) | 0;\n var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\n w6 &= 0x3ffffff;\n /* k = 7 */\n lo = Math.imul(al7, bl0);\n mid = Math.imul(al7, bh0);\n mid = (mid + Math.imul(ah7, bl0)) | 0;\n hi = Math.imul(ah7, bh0);\n lo = (lo + Math.imul(al6, bl1)) | 0;\n mid = (mid + Math.imul(al6, bh1)) | 0;\n mid = (mid + Math.imul(ah6, bl1)) | 0;\n hi = (hi + Math.imul(ah6, bh1)) | 0;\n lo = (lo + Math.imul(al5, bl2)) | 0;\n mid = (mid + Math.imul(al5, bh2)) | 0;\n mid = (mid + Math.imul(ah5, bl2)) | 0;\n hi = (hi + Math.imul(ah5, bh2)) | 0;\n lo = (lo + Math.imul(al4, bl3)) | 0;\n mid = (mid + Math.imul(al4, bh3)) | 0;\n mid = (mid + Math.imul(ah4, bl3)) | 0;\n hi = (hi + Math.imul(ah4, bh3)) | 0;\n lo = (lo + Math.imul(al3, bl4)) | 0;\n mid = (mid + Math.imul(al3, bh4)) | 0;\n mid = (mid + Math.imul(ah3, bl4)) | 0;\n hi = (hi + Math.imul(ah3, bh4)) | 0;\n lo = (lo + Math.imul(al2, bl5)) | 0;\n mid = (mid + Math.imul(al2, bh5)) | 0;\n mid = (mid + Math.imul(ah2, bl5)) | 0;\n hi = (hi + Math.imul(ah2, bh5)) | 0;\n lo = (lo + Math.imul(al1, bl6)) | 0;\n mid = (mid + Math.imul(al1, bh6)) | 0;\n mid = (mid + Math.imul(ah1, bl6)) | 0;\n hi = (hi + Math.imul(ah1, bh6)) | 0;\n lo = (lo + Math.imul(al0, bl7)) | 0;\n mid = (mid + Math.imul(al0, bh7)) | 0;\n mid = (mid + Math.imul(ah0, bl7)) | 0;\n hi = (hi + Math.imul(ah0, bh7)) | 0;\n var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\n w7 &= 0x3ffffff;\n /* k = 8 */\n lo = Math.imul(al8, bl0);\n mid = Math.imul(al8, bh0);\n mid = (mid + Math.imul(ah8, bl0)) | 0;\n hi = Math.imul(ah8, bh0);\n lo = (lo + Math.imul(al7, bl1)) | 0;\n mid = (mid + Math.imul(al7, bh1)) | 0;\n mid = (mid + Math.imul(ah7, bl1)) | 0;\n hi = (hi + Math.imul(ah7, bh1)) | 0;\n lo = (lo + Math.imul(al6, bl2)) | 0;\n mid = (mid + Math.imul(al6, bh2)) | 0;\n mid = (mid + Math.imul(ah6, bl2)) | 0;\n hi = (hi + Math.imul(ah6, bh2)) | 0;\n lo = (lo + Math.imul(al5, bl3)) | 0;\n mid = (mid + Math.imul(al5, bh3)) | 0;\n mid = (mid + Math.imul(ah5, bl3)) | 0;\n hi = (hi + Math.imul(ah5, bh3)) | 0;\n lo = (lo + Math.imul(al4, bl4)) | 0;\n mid = (mid + Math.imul(al4, bh4)) | 0;\n mid = (mid + Math.imul(ah4, bl4)) | 0;\n hi = (hi + Math.imul(ah4, bh4)) | 0;\n lo = (lo + Math.imul(al3, bl5)) | 0;\n mid = (mid + Math.imul(al3, bh5)) | 0;\n mid = (mid + Math.imul(ah3, bl5)) | 0;\n hi = (hi + Math.imul(ah3, bh5)) | 0;\n lo = (lo + Math.imul(al2, bl6)) | 0;\n mid = (mid + Math.imul(al2, bh6)) | 0;\n mid = (mid + Math.imul(ah2, bl6)) | 0;\n hi = (hi + Math.imul(ah2, bh6)) | 0;\n lo = (lo + Math.imul(al1, bl7)) | 0;\n mid = (mid + Math.imul(al1, bh7)) | 0;\n mid = (mid + Math.imul(ah1, bl7)) | 0;\n hi = (hi + Math.imul(ah1, bh7)) | 0;\n lo = (lo + Math.imul(al0, bl8)) | 0;\n mid = (mid + Math.imul(al0, bh8)) | 0;\n mid = (mid + Math.imul(ah0, bl8)) | 0;\n hi = (hi + Math.imul(ah0, bh8)) | 0;\n var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\n w8 &= 0x3ffffff;\n /* k = 9 */\n lo = Math.imul(al9, bl0);\n mid = Math.imul(al9, bh0);\n mid = (mid + Math.imul(ah9, bl0)) | 0;\n hi = Math.imul(ah9, bh0);\n lo = (lo + Math.imul(al8, bl1)) | 0;\n mid = (mid + Math.imul(al8, bh1)) | 0;\n mid = (mid + Math.imul(ah8, bl1)) | 0;\n hi = (hi + Math.imul(ah8, bh1)) | 0;\n lo = (lo + Math.imul(al7, bl2)) | 0;\n mid = (mid + Math.imul(al7, bh2)) | 0;\n mid = (mid + Math.imul(ah7, bl2)) | 0;\n hi = (hi + Math.imul(ah7, bh2)) | 0;\n lo = (lo + Math.imul(al6, bl3)) | 0;\n mid = (mid + Math.imul(al6, bh3)) | 0;\n mid = (mid + Math.imul(ah6, bl3)) | 0;\n hi = (hi + Math.imul(ah6, bh3)) | 0;\n lo = (lo + Math.imul(al5, bl4)) | 0;\n mid = (mid + Math.imul(al5, bh4)) | 0;\n mid = (mid + Math.imul(ah5, bl4)) | 0;\n hi = (hi + Math.imul(ah5, bh4)) | 0;\n lo = (lo + Math.imul(al4, bl5)) | 0;\n mid = (mid + Math.imul(al4, bh5)) | 0;\n mid = (mid + Math.imul(ah4, bl5)) | 0;\n hi = (hi + Math.imul(ah4, bh5)) | 0;\n lo = (lo + Math.imul(al3, bl6)) | 0;\n mid = (mid + Math.imul(al3, bh6)) | 0;\n mid = (mid + Math.imul(ah3, bl6)) | 0;\n hi = (hi + Math.imul(ah3, bh6)) | 0;\n lo = (lo + Math.imul(al2, bl7)) | 0;\n mid = (mid + Math.imul(al2, bh7)) | 0;\n mid = (mid + Math.imul(ah2, bl7)) | 0;\n hi = (hi + Math.imul(ah2, bh7)) | 0;\n lo = (lo + Math.imul(al1, bl8)) | 0;\n mid = (mid + Math.imul(al1, bh8)) | 0;\n mid = (mid + Math.imul(ah1, bl8)) | 0;\n hi = (hi + Math.imul(ah1, bh8)) | 0;\n lo = (lo + Math.imul(al0, bl9)) | 0;\n mid = (mid + Math.imul(al0, bh9)) | 0;\n mid = (mid + Math.imul(ah0, bl9)) | 0;\n hi = (hi + Math.imul(ah0, bh9)) | 0;\n var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\n w9 &= 0x3ffffff;\n /* k = 10 */\n lo = Math.imul(al9, bl1);\n mid = Math.imul(al9, bh1);\n mid = (mid + Math.imul(ah9, bl1)) | 0;\n hi = Math.imul(ah9, bh1);\n lo = (lo + Math.imul(al8, bl2)) | 0;\n mid = (mid + Math.imul(al8, bh2)) | 0;\n mid = (mid + Math.imul(ah8, bl2)) | 0;\n hi = (hi + Math.imul(ah8, bh2)) | 0;\n lo = (lo + Math.imul(al7, bl3)) | 0;\n mid = (mid + Math.imul(al7, bh3)) | 0;\n mid = (mid + Math.imul(ah7, bl3)) | 0;\n hi = (hi + Math.imul(ah7, bh3)) | 0;\n lo = (lo + Math.imul(al6, bl4)) | 0;\n mid = (mid + Math.imul(al6, bh4)) | 0;\n mid = (mid + Math.imul(ah6, bl4)) | 0;\n hi = (hi + Math.imul(ah6, bh4)) | 0;\n lo = (lo + Math.imul(al5, bl5)) | 0;\n mid = (mid + Math.imul(al5, bh5)) | 0;\n mid = (mid + Math.imul(ah5, bl5)) | 0;\n hi = (hi + Math.imul(ah5, bh5)) | 0;\n lo = (lo + Math.imul(al4, bl6)) | 0;\n mid = (mid + Math.imul(al4, bh6)) | 0;\n mid = (mid + Math.imul(ah4, bl6)) | 0;\n hi = (hi + Math.imul(ah4, bh6)) | 0;\n lo = (lo + Math.imul(al3, bl7)) | 0;\n mid = (mid + Math.imul(al3, bh7)) | 0;\n mid = (mid + Math.imul(ah3, bl7)) | 0;\n hi = (hi + Math.imul(ah3, bh7)) | 0;\n lo = (lo + Math.imul(al2, bl8)) | 0;\n mid = (mid + Math.imul(al2, bh8)) | 0;\n mid = (mid + Math.imul(ah2, bl8)) | 0;\n hi = (hi + Math.imul(ah2, bh8)) | 0;\n lo = (lo + Math.imul(al1, bl9)) | 0;\n mid = (mid + Math.imul(al1, bh9)) | 0;\n mid = (mid + Math.imul(ah1, bl9)) | 0;\n hi = (hi + Math.imul(ah1, bh9)) | 0;\n var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\n w10 &= 0x3ffffff;\n /* k = 11 */\n lo = Math.imul(al9, bl2);\n mid = Math.imul(al9, bh2);\n mid = (mid + Math.imul(ah9, bl2)) | 0;\n hi = Math.imul(ah9, bh2);\n lo = (lo + Math.imul(al8, bl3)) | 0;\n mid = (mid + Math.imul(al8, bh3)) | 0;\n mid = (mid + Math.imul(ah8, bl3)) | 0;\n hi = (hi + Math.imul(ah8, bh3)) | 0;\n lo = (lo + Math.imul(al7, bl4)) | 0;\n mid = (mid + Math.imul(al7, bh4)) | 0;\n mid = (mid + Math.imul(ah7, bl4)) | 0;\n hi = (hi + Math.imul(ah7, bh4)) | 0;\n lo = (lo + Math.imul(al6, bl5)) | 0;\n mid = (mid + Math.imul(al6, bh5)) | 0;\n mid = (mid + Math.imul(ah6, bl5)) | 0;\n hi = (hi + Math.imul(ah6, bh5)) | 0;\n lo = (lo + Math.imul(al5, bl6)) | 0;\n mid = (mid + Math.imul(al5, bh6)) | 0;\n mid = (mid + Math.imul(ah5, bl6)) | 0;\n hi = (hi + Math.imul(ah5, bh6)) | 0;\n lo = (lo + Math.imul(al4, bl7)) | 0;\n mid = (mid + Math.imul(al4, bh7)) | 0;\n mid = (mid + Math.imul(ah4, bl7)) | 0;\n hi = (hi + Math.imul(ah4, bh7)) | 0;\n lo = (lo + Math.imul(al3, bl8)) | 0;\n mid = (mid + Math.imul(al3, bh8)) | 0;\n mid = (mid + Math.imul(ah3, bl8)) | 0;\n hi = (hi + Math.imul(ah3, bh8)) | 0;\n lo = (lo + Math.imul(al2, bl9)) | 0;\n mid = (mid + Math.imul(al2, bh9)) | 0;\n mid = (mid + Math.imul(ah2, bl9)) | 0;\n hi = (hi + Math.imul(ah2, bh9)) | 0;\n var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\n w11 &= 0x3ffffff;\n /* k = 12 */\n lo = Math.imul(al9, bl3);\n mid = Math.imul(al9, bh3);\n mid = (mid + Math.imul(ah9, bl3)) | 0;\n hi = Math.imul(ah9, bh3);\n lo = (lo + Math.imul(al8, bl4)) | 0;\n mid = (mid + Math.imul(al8, bh4)) | 0;\n mid = (mid + Math.imul(ah8, bl4)) | 0;\n hi = (hi + Math.imul(ah8, bh4)) | 0;\n lo = (lo + Math.imul(al7, bl5)) | 0;\n mid = (mid + Math.imul(al7, bh5)) | 0;\n mid = (mid + Math.imul(ah7, bl5)) | 0;\n hi = (hi + Math.imul(ah7, bh5)) | 0;\n lo = (lo + Math.imul(al6, bl6)) | 0;\n mid = (mid + Math.imul(al6, bh6)) | 0;\n mid = (mid + Math.imul(ah6, bl6)) | 0;\n hi = (hi + Math.imul(ah6, bh6)) | 0;\n lo = (lo + Math.imul(al5, bl7)) | 0;\n mid = (mid + Math.imul(al5, bh7)) | 0;\n mid = (mid + Math.imul(ah5, bl7)) | 0;\n hi = (hi + Math.imul(ah5, bh7)) | 0;\n lo = (lo + Math.imul(al4, bl8)) | 0;\n mid = (mid + Math.imul(al4, bh8)) | 0;\n mid = (mid + Math.imul(ah4, bl8)) | 0;\n hi = (hi + Math.imul(ah4, bh8)) | 0;\n lo = (lo + Math.imul(al3, bl9)) | 0;\n mid = (mid + Math.imul(al3, bh9)) | 0;\n mid = (mid + Math.imul(ah3, bl9)) | 0;\n hi = (hi + Math.imul(ah3, bh9)) | 0;\n var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\n w12 &= 0x3ffffff;\n /* k = 13 */\n lo = Math.imul(al9, bl4);\n mid = Math.imul(al9, bh4);\n mid = (mid + Math.imul(ah9, bl4)) | 0;\n hi = Math.imul(ah9, bh4);\n lo = (lo + Math.imul(al8, bl5)) | 0;\n mid = (mid + Math.imul(al8, bh5)) | 0;\n mid = (mid + Math.imul(ah8, bl5)) | 0;\n hi = (hi + Math.imul(ah8, bh5)) | 0;\n lo = (lo + Math.imul(al7, bl6)) | 0;\n mid = (mid + Math.imul(al7, bh6)) | 0;\n mid = (mid + Math.imul(ah7, bl6)) | 0;\n hi = (hi + Math.imul(ah7, bh6)) | 0;\n lo = (lo + Math.imul(al6, bl7)) | 0;\n mid = (mid + Math.imul(al6, bh7)) | 0;\n mid = (mid + Math.imul(ah6, bl7)) | 0;\n hi = (hi + Math.imul(ah6, bh7)) | 0;\n lo = (lo + Math.imul(al5, bl8)) | 0;\n mid = (mid + Math.imul(al5, bh8)) | 0;\n mid = (mid + Math.imul(ah5, bl8)) | 0;\n hi = (hi + Math.imul(ah5, bh8)) | 0;\n lo = (lo + Math.imul(al4, bl9)) | 0;\n mid = (mid + Math.imul(al4, bh9)) | 0;\n mid = (mid + Math.imul(ah4, bl9)) | 0;\n hi = (hi + Math.imul(ah4, bh9)) | 0;\n var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\n w13 &= 0x3ffffff;\n /* k = 14 */\n lo = Math.imul(al9, bl5);\n mid = Math.imul(al9, bh5);\n mid = (mid + Math.imul(ah9, bl5)) | 0;\n hi = Math.imul(ah9, bh5);\n lo = (lo + Math.imul(al8, bl6)) | 0;\n mid = (mid + Math.imul(al8, bh6)) | 0;\n mid = (mid + Math.imul(ah8, bl6)) | 0;\n hi = (hi + Math.imul(ah8, bh6)) | 0;\n lo = (lo + Math.imul(al7, bl7)) | 0;\n mid = (mid + Math.imul(al7, bh7)) | 0;\n mid = (mid + Math.imul(ah7, bl7)) | 0;\n hi = (hi + Math.imul(ah7, bh7)) | 0;\n lo = (lo + Math.imul(al6, bl8)) | 0;\n mid = (mid + Math.imul(al6, bh8)) | 0;\n mid = (mid + Math.imul(ah6, bl8)) | 0;\n hi = (hi + Math.imul(ah6, bh8)) | 0;\n lo = (lo + Math.imul(al5, bl9)) | 0;\n mid = (mid + Math.imul(al5, bh9)) | 0;\n mid = (mid + Math.imul(ah5, bl9)) | 0;\n hi = (hi + Math.imul(ah5, bh9)) | 0;\n var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\n w14 &= 0x3ffffff;\n /* k = 15 */\n lo = Math.imul(al9, bl6);\n mid = Math.imul(al9, bh6);\n mid = (mid + Math.imul(ah9, bl6)) | 0;\n hi = Math.imul(ah9, bh6);\n lo = (lo + Math.imul(al8, bl7)) | 0;\n mid = (mid + Math.imul(al8, bh7)) | 0;\n mid = (mid + Math.imul(ah8, bl7)) | 0;\n hi = (hi + Math.imul(ah8, bh7)) | 0;\n lo = (lo + Math.imul(al7, bl8)) | 0;\n mid = (mid + Math.imul(al7, bh8)) | 0;\n mid = (mid + Math.imul(ah7, bl8)) | 0;\n hi = (hi + Math.imul(ah7, bh8)) | 0;\n lo = (lo + Math.imul(al6, bl9)) | 0;\n mid = (mid + Math.imul(al6, bh9)) | 0;\n mid = (mid + Math.imul(ah6, bl9)) | 0;\n hi = (hi + Math.imul(ah6, bh9)) | 0;\n var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\n w15 &= 0x3ffffff;\n /* k = 16 */\n lo = Math.imul(al9, bl7);\n mid = Math.imul(al9, bh7);\n mid = (mid + Math.imul(ah9, bl7)) | 0;\n hi = Math.imul(ah9, bh7);\n lo = (lo + Math.imul(al8, bl8)) | 0;\n mid = (mid + Math.imul(al8, bh8)) | 0;\n mid = (mid + Math.imul(ah8, bl8)) | 0;\n hi = (hi + Math.imul(ah8, bh8)) | 0;\n lo = (lo + Math.imul(al7, bl9)) | 0;\n mid = (mid + Math.imul(al7, bh9)) | 0;\n mid = (mid + Math.imul(ah7, bl9)) | 0;\n hi = (hi + Math.imul(ah7, bh9)) | 0;\n var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\n w16 &= 0x3ffffff;\n /* k = 17 */\n lo = Math.imul(al9, bl8);\n mid = Math.imul(al9, bh8);\n mid = (mid + Math.imul(ah9, bl8)) | 0;\n hi = Math.imul(ah9, bh8);\n lo = (lo + Math.imul(al8, bl9)) | 0;\n mid = (mid + Math.imul(al8, bh9)) | 0;\n mid = (mid + Math.imul(ah8, bl9)) | 0;\n hi = (hi + Math.imul(ah8, bh9)) | 0;\n var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\n w17 &= 0x3ffffff;\n /* k = 18 */\n lo = Math.imul(al9, bl9);\n mid = Math.imul(al9, bh9);\n mid = (mid + Math.imul(ah9, bl9)) | 0;\n hi = Math.imul(ah9, bh9);\n var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\n w18 &= 0x3ffffff;\n o[0] = w0;\n o[1] = w1;\n o[2] = w2;\n o[3] = w3;\n o[4] = w4;\n o[5] = w5;\n o[6] = w6;\n o[7] = w7;\n o[8] = w8;\n o[9] = w9;\n o[10] = w10;\n o[11] = w11;\n o[12] = w12;\n o[13] = w13;\n o[14] = w14;\n o[15] = w15;\n o[16] = w16;\n o[17] = w17;\n o[18] = w18;\n if (c !== 0) {\n o[19] = c;\n out.length++;\n }\n return out;\n };\n\n // Polyfill comb\n if (!Math.imul) {\n comb10MulTo = smallMulTo;\n }\n\n function bigMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n out.length = self.length + num.length;\n\n var carry = 0;\n var hncarry = 0;\n for (var k = 0; k < out.length - 1; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = hncarry;\n hncarry = 0;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = k - j;\n var a = self.words[i] | 0;\n var b = num.words[j] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\n lo = (lo + rword) | 0;\n rword = lo & 0x3ffffff;\n ncarry = (ncarry + (lo >>> 26)) | 0;\n\n hncarry += ncarry >>> 26;\n ncarry &= 0x3ffffff;\n }\n out.words[k] = rword;\n carry = ncarry;\n ncarry = hncarry;\n }\n if (carry !== 0) {\n out.words[k] = carry;\n } else {\n out.length--;\n }\n\n return out.strip();\n }\n\n function jumboMulTo (self, num, out) {\n var fftm = new FFTM();\n return fftm.mulp(self, num, out);\n }\n\n BN.prototype.mulTo = function mulTo (num, out) {\n var res;\n var len = this.length + num.length;\n if (this.length === 10 && num.length === 10) {\n res = comb10MulTo(this, num, out);\n } else if (len < 63) {\n res = smallMulTo(this, num, out);\n } else if (len < 1024) {\n res = bigMulTo(this, num, out);\n } else {\n res = jumboMulTo(this, num, out);\n }\n\n return res;\n };\n\n // Cooley-Tukey algorithm for FFT\n // slightly revisited to rely on looping instead of recursion\n\n function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }\n\n FFTM.prototype.makeRBT = function makeRBT (N) {\n var t = new Array(N);\n var l = BN.prototype._countBits(N) - 1;\n for (var i = 0; i < N; i++) {\n t[i] = this.revBin(i, l, N);\n }\n\n return t;\n };\n\n // Returns binary-reversed representation of `x`\n FFTM.prototype.revBin = function revBin (x, l, N) {\n if (x === 0 || x === N - 1) return x;\n\n var rb = 0;\n for (var i = 0; i < l; i++) {\n rb |= (x & 1) << (l - i - 1);\n x >>= 1;\n }\n\n return rb;\n };\n\n // Performs \"tweedling\" phase, therefore 'emulating'\n // behaviour of the recursive algorithm\n FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {\n for (var i = 0; i < N; i++) {\n rtws[i] = rws[rbt[i]];\n itws[i] = iws[rbt[i]];\n }\n };\n\n FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {\n this.permute(rbt, rws, iws, rtws, itws, N);\n\n for (var s = 1; s < N; s <<= 1) {\n var l = s << 1;\n\n var rtwdf = Math.cos(2 * Math.PI / l);\n var itwdf = Math.sin(2 * Math.PI / l);\n\n for (var p = 0; p < N; p += l) {\n var rtwdf_ = rtwdf;\n var itwdf_ = itwdf;\n\n for (var j = 0; j < s; j++) {\n var re = rtws[p + j];\n var ie = itws[p + j];\n\n var ro = rtws[p + j + s];\n var io = itws[p + j + s];\n\n var rx = rtwdf_ * ro - itwdf_ * io;\n\n io = rtwdf_ * io + itwdf_ * ro;\n ro = rx;\n\n rtws[p + j] = re + ro;\n itws[p + j] = ie + io;\n\n rtws[p + j + s] = re - ro;\n itws[p + j + s] = ie - io;\n\n /* jshint maxdepth : false */\n if (j !== l) {\n rx = rtwdf * rtwdf_ - itwdf * itwdf_;\n\n itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;\n rtwdf_ = rx;\n }\n }\n }\n }\n };\n\n FFTM.prototype.guessLen13b = function guessLen13b (n, m) {\n var N = Math.max(m, n) | 1;\n var odd = N & 1;\n var i = 0;\n for (N = N / 2 | 0; N; N = N >>> 1) {\n i++;\n }\n\n return 1 << i + 1 + odd;\n };\n\n FFTM.prototype.conjugate = function conjugate (rws, iws, N) {\n if (N <= 1) return;\n\n for (var i = 0; i < N / 2; i++) {\n var t = rws[i];\n\n rws[i] = rws[N - i - 1];\n rws[N - i - 1] = t;\n\n t = iws[i];\n\n iws[i] = -iws[N - i - 1];\n iws[N - i - 1] = -t;\n }\n };\n\n FFTM.prototype.normalize13b = function normalize13b (ws, N) {\n var carry = 0;\n for (var i = 0; i < N / 2; i++) {\n var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +\n Math.round(ws[2 * i] / N) +\n carry;\n\n ws[i] = w & 0x3ffffff;\n\n if (w < 0x4000000) {\n carry = 0;\n } else {\n carry = w / 0x4000000 | 0;\n }\n }\n\n return ws;\n };\n\n FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {\n var carry = 0;\n for (var i = 0; i < len; i++) {\n carry = carry + (ws[i] | 0);\n\n rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;\n rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;\n }\n\n // Pad with zeroes\n for (i = 2 * len; i < N; ++i) {\n rws[i] = 0;\n }\n\n assert(carry === 0);\n assert((carry & ~0x1fff) === 0);\n };\n\n FFTM.prototype.stub = function stub (N) {\n var ph = new Array(N);\n for (var i = 0; i < N; i++) {\n ph[i] = 0;\n }\n\n return ph;\n };\n\n FFTM.prototype.mulp = function mulp (x, y, out) {\n var N = 2 * this.guessLen13b(x.length, y.length);\n\n var rbt = this.makeRBT(N);\n\n var _ = this.stub(N);\n\n var rws = new Array(N);\n var rwst = new Array(N);\n var iwst = new Array(N);\n\n var nrws = new Array(N);\n var nrwst = new Array(N);\n var niwst = new Array(N);\n\n var rmws = out.words;\n rmws.length = N;\n\n this.convert13b(x.words, x.length, rws, N);\n this.convert13b(y.words, y.length, nrws, N);\n\n this.transform(rws, _, rwst, iwst, N, rbt);\n this.transform(nrws, _, nrwst, niwst, N, rbt);\n\n for (var i = 0; i < N; i++) {\n var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\n iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];\n rwst[i] = rx;\n }\n\n this.conjugate(rwst, iwst, N);\n this.transform(rwst, iwst, rmws, _, N, rbt);\n this.conjugate(rmws, _, N);\n this.normalize13b(rmws, N);\n\n out.negative = x.negative ^ y.negative;\n out.length = x.length + y.length;\n return out.strip();\n };\n\n // Multiply `this` by `num`\n BN.prototype.mul = function mul (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return this.mulTo(num, out);\n };\n\n // Multiply employing FFT\n BN.prototype.mulf = function mulf (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return jumboMulTo(this, num, out);\n };\n\n // In-place Multiplication\n BN.prototype.imul = function imul (num) {\n return this.clone().mulTo(num, this);\n };\n\n BN.prototype.imuln = function imuln (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n\n // Carry\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = (this.words[i] | 0) * num;\n var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\n carry >>= 26;\n carry += (w / 0x4000000) | 0;\n // NOTE: lo is 27bit maximum\n carry += lo >>> 26;\n this.words[i] = lo & 0x3ffffff;\n }\n\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n\n return this;\n };\n\n BN.prototype.muln = function muln (num) {\n return this.clone().imuln(num);\n };\n\n // `this` * `this`\n BN.prototype.sqr = function sqr () {\n return this.mul(this);\n };\n\n // `this` * `this` in-place\n BN.prototype.isqr = function isqr () {\n return this.imul(this.clone());\n };\n\n // Math.pow(`this`, `num`)\n BN.prototype.pow = function pow (num) {\n var w = toBitArray(num);\n if (w.length === 0) return new BN(1);\n\n // Skip leading zeroes\n var res = this;\n for (var i = 0; i < w.length; i++, res = res.sqr()) {\n if (w[i] !== 0) break;\n }\n\n if (++i < w.length) {\n for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {\n if (w[i] === 0) continue;\n\n res = res.mul(q);\n }\n }\n\n return res;\n };\n\n // Shift-left in-place\n BN.prototype.iushln = function iushln (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);\n var i;\n\n if (r !== 0) {\n var carry = 0;\n\n for (i = 0; i < this.length; i++) {\n var newCarry = this.words[i] & carryMask;\n var c = ((this.words[i] | 0) - newCarry) << r;\n this.words[i] = c | carry;\n carry = newCarry >>> (26 - r);\n }\n\n if (carry) {\n this.words[i] = carry;\n this.length++;\n }\n }\n\n if (s !== 0) {\n for (i = this.length - 1; i >= 0; i--) {\n this.words[i + s] = this.words[i];\n }\n\n for (i = 0; i < s; i++) {\n this.words[i] = 0;\n }\n\n this.length += s;\n }\n\n return this.strip();\n };\n\n BN.prototype.ishln = function ishln (bits) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushln(bits);\n };\n\n // Shift-right in-place\n // NOTE: `hint` is a lowest bit before trailing zeroes\n // NOTE: if `extended` is present - it will be filled with destroyed bits\n BN.prototype.iushrn = function iushrn (bits, hint, extended) {\n assert(typeof bits === 'number' && bits >= 0);\n var h;\n if (hint) {\n h = (hint - (hint % 26)) / 26;\n } else {\n h = 0;\n }\n\n var r = bits % 26;\n var s = Math.min((bits - r) / 26, this.length);\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n var maskedWords = extended;\n\n h -= s;\n h = Math.max(0, h);\n\n // Extended mode, copy masked part\n if (maskedWords) {\n for (var i = 0; i < s; i++) {\n maskedWords.words[i] = this.words[i];\n }\n maskedWords.length = s;\n }\n\n if (s === 0) {\n // No-op, we should not move anything at all\n } else if (this.length > s) {\n this.length -= s;\n for (i = 0; i < this.length; i++) {\n this.words[i] = this.words[i + s];\n }\n } else {\n this.words[0] = 0;\n this.length = 1;\n }\n\n var carry = 0;\n for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {\n var word = this.words[i] | 0;\n this.words[i] = (carry << (26 - r)) | (word >>> r);\n carry = word & mask;\n }\n\n // Push carried bits as a mask\n if (maskedWords && carry !== 0) {\n maskedWords.words[maskedWords.length++] = carry;\n }\n\n if (this.length === 0) {\n this.words[0] = 0;\n this.length = 1;\n }\n\n return this.strip();\n };\n\n BN.prototype.ishrn = function ishrn (bits, hint, extended) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushrn(bits, hint, extended);\n };\n\n // Shift-left\n BN.prototype.shln = function shln (bits) {\n return this.clone().ishln(bits);\n };\n\n BN.prototype.ushln = function ushln (bits) {\n return this.clone().iushln(bits);\n };\n\n // Shift-right\n BN.prototype.shrn = function shrn (bits) {\n return this.clone().ishrn(bits);\n };\n\n BN.prototype.ushrn = function ushrn (bits) {\n return this.clone().iushrn(bits);\n };\n\n // Test if n bit is set\n BN.prototype.testn = function testn (bit) {\n assert(typeof bit === 'number' && bit >= 0);\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) return false;\n\n // Check bit and return\n var w = this.words[s];\n\n return !!(w & q);\n };\n\n // Return only lowers bits of number (in-place)\n BN.prototype.imaskn = function imaskn (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n\n assert(this.negative === 0, 'imaskn works only with positive numbers');\n\n if (this.length <= s) {\n return this;\n }\n\n if (r !== 0) {\n s++;\n }\n this.length = Math.min(s, this.length);\n\n if (r !== 0) {\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n this.words[this.length - 1] &= mask;\n }\n\n return this.strip();\n };\n\n // Return only lowers bits of number\n BN.prototype.maskn = function maskn (bits) {\n return this.clone().imaskn(bits);\n };\n\n // Add plain number `num` to `this`\n BN.prototype.iaddn = function iaddn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.isubn(-num);\n\n // Possible sign change\n if (this.negative !== 0) {\n if (this.length === 1 && (this.words[0] | 0) < num) {\n this.words[0] = num - (this.words[0] | 0);\n this.negative = 0;\n return this;\n }\n\n this.negative = 0;\n this.isubn(num);\n this.negative = 1;\n return this;\n }\n\n // Add without checks\n return this._iaddn(num);\n };\n\n BN.prototype._iaddn = function _iaddn (num) {\n this.words[0] += num;\n\n // Carry\n for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {\n this.words[i] -= 0x4000000;\n if (i === this.length - 1) {\n this.words[i + 1] = 1;\n } else {\n this.words[i + 1]++;\n }\n }\n this.length = Math.max(this.length, i + 1);\n\n return this;\n };\n\n // Subtract plain number `num` from `this`\n BN.prototype.isubn = function isubn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.iaddn(-num);\n\n if (this.negative !== 0) {\n this.negative = 0;\n this.iaddn(num);\n this.negative = 1;\n return this;\n }\n\n this.words[0] -= num;\n\n if (this.length === 1 && this.words[0] < 0) {\n this.words[0] = -this.words[0];\n this.negative = 1;\n } else {\n // Carry\n for (var i = 0; i < this.length && this.words[i] < 0; i++) {\n this.words[i] += 0x4000000;\n this.words[i + 1] -= 1;\n }\n }\n\n return this.strip();\n };\n\n BN.prototype.addn = function addn (num) {\n return this.clone().iaddn(num);\n };\n\n BN.prototype.subn = function subn (num) {\n return this.clone().isubn(num);\n };\n\n BN.prototype.iabs = function iabs () {\n this.negative = 0;\n\n return this;\n };\n\n BN.prototype.abs = function abs () {\n return this.clone().iabs();\n };\n\n BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {\n var len = num.length + shift;\n var i;\n\n this._expand(len);\n\n var w;\n var carry = 0;\n for (i = 0; i < num.length; i++) {\n w = (this.words[i + shift] | 0) + carry;\n var right = (num.words[i] | 0) * mul;\n w -= right & 0x3ffffff;\n carry = (w >> 26) - ((right / 0x4000000) | 0);\n this.words[i + shift] = w & 0x3ffffff;\n }\n for (; i < this.length - shift; i++) {\n w = (this.words[i + shift] | 0) + carry;\n carry = w >> 26;\n this.words[i + shift] = w & 0x3ffffff;\n }\n\n if (carry === 0) return this.strip();\n\n // Subtraction overflow\n assert(carry === -1);\n carry = 0;\n for (i = 0; i < this.length; i++) {\n w = -(this.words[i] | 0) + carry;\n carry = w >> 26;\n this.words[i] = w & 0x3ffffff;\n }\n this.negative = 1;\n\n return this.strip();\n };\n\n BN.prototype._wordDiv = function _wordDiv (num, mode) {\n var shift = this.length - num.length;\n\n var a = this.clone();\n var b = num;\n\n // Normalize\n var bhi = b.words[b.length - 1] | 0;\n var bhiBits = this._countBits(bhi);\n shift = 26 - bhiBits;\n if (shift !== 0) {\n b = b.ushln(shift);\n a.iushln(shift);\n bhi = b.words[b.length - 1] | 0;\n }\n\n // Initialize quotient\n var m = a.length - b.length;\n var q;\n\n if (mode !== 'mod') {\n q = new BN(null);\n q.length = m + 1;\n q.words = new Array(q.length);\n for (var i = 0; i < q.length; i++) {\n q.words[i] = 0;\n }\n }\n\n var diff = a.clone()._ishlnsubmul(b, 1, m);\n if (diff.negative === 0) {\n a = diff;\n if (q) {\n q.words[m] = 1;\n }\n }\n\n for (var j = m - 1; j >= 0; j--) {\n var qj = (a.words[b.length + j] | 0) * 0x4000000 +\n (a.words[b.length + j - 1] | 0);\n\n // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max\n // (0x7ffffff)\n qj = Math.min((qj / bhi) | 0, 0x3ffffff);\n\n a._ishlnsubmul(b, qj, j);\n while (a.negative !== 0) {\n qj--;\n a.negative = 0;\n a._ishlnsubmul(b, 1, j);\n if (!a.isZero()) {\n a.negative ^= 1;\n }\n }\n if (q) {\n q.words[j] = qj;\n }\n }\n if (q) {\n q.strip();\n }\n a.strip();\n\n // Denormalize\n if (mode !== 'div' && shift !== 0) {\n a.iushrn(shift);\n }\n\n return {\n div: q || null,\n mod: a\n };\n };\n\n // NOTE: 1) `mode` can be set to `mod` to request mod only,\n // to `div` to request div only, or be absent to\n // request both div & mod\n // 2) `positive` is true if unsigned mod is requested\n BN.prototype.divmod = function divmod (num, mode, positive) {\n assert(!num.isZero());\n\n if (this.isZero()) {\n return {\n div: new BN(0),\n mod: new BN(0)\n };\n }\n\n var div, mod, res;\n if (this.negative !== 0 && num.negative === 0) {\n res = this.neg().divmod(num, mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.iadd(num);\n }\n }\n\n return {\n div: div,\n mod: mod\n };\n }\n\n if (this.negative === 0 && num.negative !== 0) {\n res = this.divmod(num.neg(), mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n return {\n div: div,\n mod: res.mod\n };\n }\n\n if ((this.negative & num.negative) !== 0) {\n res = this.neg().divmod(num.neg(), mode);\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.isub(num);\n }\n }\n\n return {\n div: res.div,\n mod: mod\n };\n }\n\n // Both numbers are positive at this point\n\n // Strip both numbers to approximate shift value\n if (num.length > this.length || this.cmp(num) < 0) {\n return {\n div: new BN(0),\n mod: this\n };\n }\n\n // Very short reduction\n if (num.length === 1) {\n if (mode === 'div') {\n return {\n div: this.divn(num.words[0]),\n mod: null\n };\n }\n\n if (mode === 'mod') {\n return {\n div: null,\n mod: new BN(this.modn(num.words[0]))\n };\n }\n\n return {\n div: this.divn(num.words[0]),\n mod: new BN(this.modn(num.words[0]))\n };\n }\n\n return this._wordDiv(num, mode);\n };\n\n // Find `this` / `num`\n BN.prototype.div = function div (num) {\n return this.divmod(num, 'div', false).div;\n };\n\n // Find `this` % `num`\n BN.prototype.mod = function mod (num) {\n return this.divmod(num, 'mod', false).mod;\n };\n\n BN.prototype.umod = function umod (num) {\n return this.divmod(num, 'mod', true).mod;\n };\n\n // Find Round(`this` / `num`)\n BN.prototype.divRound = function divRound (num) {\n var dm = this.divmod(num);\n\n // Fast case - exact division\n if (dm.mod.isZero()) return dm.div;\n\n var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;\n\n var half = num.ushrn(1);\n var r2 = num.andln(1);\n var cmp = mod.cmp(half);\n\n // Round down\n if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;\n\n // Round up\n return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);\n };\n\n BN.prototype.modn = function modn (num) {\n assert(num <= 0x3ffffff);\n var p = (1 << 26) % num;\n\n var acc = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n acc = (p * acc + (this.words[i] | 0)) % num;\n }\n\n return acc;\n };\n\n // In-place division by number\n BN.prototype.idivn = function idivn (num) {\n assert(num <= 0x3ffffff);\n\n var carry = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var w = (this.words[i] | 0) + carry * 0x4000000;\n this.words[i] = (w / num) | 0;\n carry = w % num;\n }\n\n return this.strip();\n };\n\n BN.prototype.divn = function divn (num) {\n return this.clone().idivn(num);\n };\n\n BN.prototype.egcd = function egcd (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var x = this;\n var y = p.clone();\n\n if (x.negative !== 0) {\n x = x.umod(p);\n } else {\n x = x.clone();\n }\n\n // A * x + B * y = x\n var A = new BN(1);\n var B = new BN(0);\n\n // C * x + D * y = y\n var C = new BN(0);\n var D = new BN(1);\n\n var g = 0;\n\n while (x.isEven() && y.isEven()) {\n x.iushrn(1);\n y.iushrn(1);\n ++g;\n }\n\n var yp = y.clone();\n var xp = x.clone();\n\n while (!x.isZero()) {\n for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n x.iushrn(i);\n while (i-- > 0) {\n if (A.isOdd() || B.isOdd()) {\n A.iadd(yp);\n B.isub(xp);\n }\n\n A.iushrn(1);\n B.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n y.iushrn(j);\n while (j-- > 0) {\n if (C.isOdd() || D.isOdd()) {\n C.iadd(yp);\n D.isub(xp);\n }\n\n C.iushrn(1);\n D.iushrn(1);\n }\n }\n\n if (x.cmp(y) >= 0) {\n x.isub(y);\n A.isub(C);\n B.isub(D);\n } else {\n y.isub(x);\n C.isub(A);\n D.isub(B);\n }\n }\n\n return {\n a: C,\n b: D,\n gcd: y.iushln(g)\n };\n };\n\n // This is reduced incarnation of the binary EEA\n // above, designated to invert members of the\n // _prime_ fields F(p) at a maximal speed\n BN.prototype._invmp = function _invmp (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var a = this;\n var b = p.clone();\n\n if (a.negative !== 0) {\n a = a.umod(p);\n } else {\n a = a.clone();\n }\n\n var x1 = new BN(1);\n var x2 = new BN(0);\n\n var delta = b.clone();\n\n while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {\n for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n a.iushrn(i);\n while (i-- > 0) {\n if (x1.isOdd()) {\n x1.iadd(delta);\n }\n\n x1.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n b.iushrn(j);\n while (j-- > 0) {\n if (x2.isOdd()) {\n x2.iadd(delta);\n }\n\n x2.iushrn(1);\n }\n }\n\n if (a.cmp(b) >= 0) {\n a.isub(b);\n x1.isub(x2);\n } else {\n b.isub(a);\n x2.isub(x1);\n }\n }\n\n var res;\n if (a.cmpn(1) === 0) {\n res = x1;\n } else {\n res = x2;\n }\n\n if (res.cmpn(0) < 0) {\n res.iadd(p);\n }\n\n return res;\n };\n\n BN.prototype.gcd = function gcd (num) {\n if (this.isZero()) return num.abs();\n if (num.isZero()) return this.abs();\n\n var a = this.clone();\n var b = num.clone();\n a.negative = 0;\n b.negative = 0;\n\n // Remove common factor of two\n for (var shift = 0; a.isEven() && b.isEven(); shift++) {\n a.iushrn(1);\n b.iushrn(1);\n }\n\n do {\n while (a.isEven()) {\n a.iushrn(1);\n }\n while (b.isEven()) {\n b.iushrn(1);\n }\n\n var r = a.cmp(b);\n if (r < 0) {\n // Swap `a` and `b` to make `a` always bigger than `b`\n var t = a;\n a = b;\n b = t;\n } else if (r === 0 || b.cmpn(1) === 0) {\n break;\n }\n\n a.isub(b);\n } while (true);\n\n return b.iushln(shift);\n };\n\n // Invert number in the field F(num)\n BN.prototype.invm = function invm (num) {\n return this.egcd(num).a.umod(num);\n };\n\n BN.prototype.isEven = function isEven () {\n return (this.words[0] & 1) === 0;\n };\n\n BN.prototype.isOdd = function isOdd () {\n return (this.words[0] & 1) === 1;\n };\n\n // And first word and num\n BN.prototype.andln = function andln (num) {\n return this.words[0] & num;\n };\n\n // Increment at the bit position in-line\n BN.prototype.bincn = function bincn (bit) {\n assert(typeof bit === 'number');\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) {\n this._expand(s + 1);\n this.words[s] |= q;\n return this;\n }\n\n // Add bit and propagate, if needed\n var carry = q;\n for (var i = s; carry !== 0 && i < this.length; i++) {\n var w = this.words[i] | 0;\n w += carry;\n carry = w >>> 26;\n w &= 0x3ffffff;\n this.words[i] = w;\n }\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n return this;\n };\n\n BN.prototype.isZero = function isZero () {\n return this.length === 1 && this.words[0] === 0;\n };\n\n BN.prototype.cmpn = function cmpn (num) {\n var negative = num < 0;\n\n if (this.negative !== 0 && !negative) return -1;\n if (this.negative === 0 && negative) return 1;\n\n this.strip();\n\n var res;\n if (this.length > 1) {\n res = 1;\n } else {\n if (negative) {\n num = -num;\n }\n\n assert(num <= 0x3ffffff, 'Number is too big');\n\n var w = this.words[0] | 0;\n res = w === num ? 0 : w < num ? -1 : 1;\n }\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Compare two numbers and return:\n // 1 - if `this` > `num`\n // 0 - if `this` == `num`\n // -1 - if `this` < `num`\n BN.prototype.cmp = function cmp (num) {\n if (this.negative !== 0 && num.negative === 0) return -1;\n if (this.negative === 0 && num.negative !== 0) return 1;\n\n var res = this.ucmp(num);\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Unsigned comparison\n BN.prototype.ucmp = function ucmp (num) {\n // At this point both numbers have the same sign\n if (this.length > num.length) return 1;\n if (this.length < num.length) return -1;\n\n var res = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var a = this.words[i] | 0;\n var b = num.words[i] | 0;\n\n if (a === b) continue;\n if (a < b) {\n res = -1;\n } else if (a > b) {\n res = 1;\n }\n break;\n }\n return res;\n };\n\n BN.prototype.gtn = function gtn (num) {\n return this.cmpn(num) === 1;\n };\n\n BN.prototype.gt = function gt (num) {\n return this.cmp(num) === 1;\n };\n\n BN.prototype.gten = function gten (num) {\n return this.cmpn(num) >= 0;\n };\n\n BN.prototype.gte = function gte (num) {\n return this.cmp(num) >= 0;\n };\n\n BN.prototype.ltn = function ltn (num) {\n return this.cmpn(num) === -1;\n };\n\n BN.prototype.lt = function lt (num) {\n return this.cmp(num) === -1;\n };\n\n BN.prototype.lten = function lten (num) {\n return this.cmpn(num) <= 0;\n };\n\n BN.prototype.lte = function lte (num) {\n return this.cmp(num) <= 0;\n };\n\n BN.prototype.eqn = function eqn (num) {\n return this.cmpn(num) === 0;\n };\n\n BN.prototype.eq = function eq (num) {\n return this.cmp(num) === 0;\n };\n\n //\n // A reduce context, could be using montgomery or something better, depending\n // on the `m` itself.\n //\n BN.red = function red (num) {\n return new Red(num);\n };\n\n BN.prototype.toRed = function toRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n assert(this.negative === 0, 'red works only with positives');\n return ctx.convertTo(this)._forceRed(ctx);\n };\n\n BN.prototype.fromRed = function fromRed () {\n assert(this.red, 'fromRed works only with numbers in reduction context');\n return this.red.convertFrom(this);\n };\n\n BN.prototype._forceRed = function _forceRed (ctx) {\n this.red = ctx;\n return this;\n };\n\n BN.prototype.forceRed = function forceRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n return this._forceRed(ctx);\n };\n\n BN.prototype.redAdd = function redAdd (num) {\n assert(this.red, 'redAdd works only with red numbers');\n return this.red.add(this, num);\n };\n\n BN.prototype.redIAdd = function redIAdd (num) {\n assert(this.red, 'redIAdd works only with red numbers');\n return this.red.iadd(this, num);\n };\n\n BN.prototype.redSub = function redSub (num) {\n assert(this.red, 'redSub works only with red numbers');\n return this.red.sub(this, num);\n };\n\n BN.prototype.redISub = function redISub (num) {\n assert(this.red, 'redISub works only with red numbers');\n return this.red.isub(this, num);\n };\n\n BN.prototype.redShl = function redShl (num) {\n assert(this.red, 'redShl works only with red numbers');\n return this.red.shl(this, num);\n };\n\n BN.prototype.redMul = function redMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.mul(this, num);\n };\n\n BN.prototype.redIMul = function redIMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.imul(this, num);\n };\n\n BN.prototype.redSqr = function redSqr () {\n assert(this.red, 'redSqr works only with red numbers');\n this.red._verify1(this);\n return this.red.sqr(this);\n };\n\n BN.prototype.redISqr = function redISqr () {\n assert(this.red, 'redISqr works only with red numbers');\n this.red._verify1(this);\n return this.red.isqr(this);\n };\n\n // Square root over p\n BN.prototype.redSqrt = function redSqrt () {\n assert(this.red, 'redSqrt works only with red numbers');\n this.red._verify1(this);\n return this.red.sqrt(this);\n };\n\n BN.prototype.redInvm = function redInvm () {\n assert(this.red, 'redInvm works only with red numbers');\n this.red._verify1(this);\n return this.red.invm(this);\n };\n\n // Return negative clone of `this` % `red modulo`\n BN.prototype.redNeg = function redNeg () {\n assert(this.red, 'redNeg works only with red numbers');\n this.red._verify1(this);\n return this.red.neg(this);\n };\n\n BN.prototype.redPow = function redPow (num) {\n assert(this.red && !num.red, 'redPow(normalNum)');\n this.red._verify1(this);\n return this.red.pow(this, num);\n };\n\n // Prime numbers with efficient reduction\n var primes = {\n k256: null,\n p224: null,\n p192: null,\n p25519: null\n };\n\n // Pseudo-Mersenne prime\n function MPrime (name, p) {\n // P = 2 ^ N - K\n this.name = name;\n this.p = new BN(p, 16);\n this.n = this.p.bitLength();\n this.k = new BN(1).iushln(this.n).isub(this.p);\n\n this.tmp = this._tmp();\n }\n\n MPrime.prototype._tmp = function _tmp () {\n var tmp = new BN(null);\n tmp.words = new Array(Math.ceil(this.n / 13));\n return tmp;\n };\n\n MPrime.prototype.ireduce = function ireduce (num) {\n // Assumes that `num` is less than `P^2`\n // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)\n var r = num;\n var rlen;\n\n do {\n this.split(r, this.tmp);\n r = this.imulK(r);\n r = r.iadd(this.tmp);\n rlen = r.bitLength();\n } while (rlen > this.n);\n\n var cmp = rlen < this.n ? -1 : r.ucmp(this.p);\n if (cmp === 0) {\n r.words[0] = 0;\n r.length = 1;\n } else if (cmp > 0) {\n r.isub(this.p);\n } else {\n r.strip();\n }\n\n return r;\n };\n\n MPrime.prototype.split = function split (input, out) {\n input.iushrn(this.n, 0, out);\n };\n\n MPrime.prototype.imulK = function imulK (num) {\n return num.imul(this.k);\n };\n\n function K256 () {\n MPrime.call(\n this,\n 'k256',\n 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');\n }\n inherits(K256, MPrime);\n\n K256.prototype.split = function split (input, output) {\n // 256 = 9 * 26 + 22\n var mask = 0x3fffff;\n\n var outLen = Math.min(input.length, 9);\n for (var i = 0; i < outLen; i++) {\n output.words[i] = input.words[i];\n }\n output.length = outLen;\n\n if (input.length <= 9) {\n input.words[0] = 0;\n input.length = 1;\n return;\n }\n\n // Shift by 9 limbs\n var prev = input.words[9];\n output.words[output.length++] = prev & mask;\n\n for (i = 10; i < input.length; i++) {\n var next = input.words[i] | 0;\n input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\n prev = next;\n }\n prev >>>= 22;\n input.words[i - 10] = prev;\n if (prev === 0 && input.length > 10) {\n input.length -= 10;\n } else {\n input.length -= 9;\n }\n };\n\n K256.prototype.imulK = function imulK (num) {\n // K = 0x1000003d1 = [ 0x40, 0x3d1 ]\n num.words[num.length] = 0;\n num.words[num.length + 1] = 0;\n num.length += 2;\n\n // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\n var lo = 0;\n for (var i = 0; i < num.length; i++) {\n var w = num.words[i] | 0;\n lo += w * 0x3d1;\n num.words[i] = lo & 0x3ffffff;\n lo = w * 0x40 + ((lo / 0x4000000) | 0);\n }\n\n // Fast length reduction\n if (num.words[num.length - 1] === 0) {\n num.length--;\n if (num.words[num.length - 1] === 0) {\n num.length--;\n }\n }\n return num;\n };\n\n function P224 () {\n MPrime.call(\n this,\n 'p224',\n 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');\n }\n inherits(P224, MPrime);\n\n function P192 () {\n MPrime.call(\n this,\n 'p192',\n 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');\n }\n inherits(P192, MPrime);\n\n function P25519 () {\n // 2 ^ 255 - 19\n MPrime.call(\n this,\n '25519',\n '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');\n }\n inherits(P25519, MPrime);\n\n P25519.prototype.imulK = function imulK (num) {\n // K = 0x13\n var carry = 0;\n for (var i = 0; i < num.length; i++) {\n var hi = (num.words[i] | 0) * 0x13 + carry;\n var lo = hi & 0x3ffffff;\n hi >>>= 26;\n\n num.words[i] = lo;\n carry = hi;\n }\n if (carry !== 0) {\n num.words[num.length++] = carry;\n }\n return num;\n };\n\n // Exported mostly for testing purposes, use plain name instead\n BN._prime = function prime (name) {\n // Cached version of prime\n if (primes[name]) return primes[name];\n\n var prime;\n if (name === 'k256') {\n prime = new K256();\n } else if (name === 'p224') {\n prime = new P224();\n } else if (name === 'p192') {\n prime = new P192();\n } else if (name === 'p25519') {\n prime = new P25519();\n } else {\n throw new Error('Unknown prime ' + name);\n }\n primes[name] = prime;\n\n return prime;\n };\n\n //\n // Base reduction engine\n //\n function Red (m) {\n if (typeof m === 'string') {\n var prime = BN._prime(m);\n this.m = prime.p;\n this.prime = prime;\n } else {\n assert(m.gtn(1), 'modulus must be greater than 1');\n this.m = m;\n this.prime = null;\n }\n }\n\n Red.prototype._verify1 = function _verify1 (a) {\n assert(a.negative === 0, 'red works only with positives');\n assert(a.red, 'red works only with red numbers');\n };\n\n Red.prototype._verify2 = function _verify2 (a, b) {\n assert((a.negative | b.negative) === 0, 'red works only with positives');\n assert(a.red && a.red === b.red,\n 'red works only with red numbers');\n };\n\n Red.prototype.imod = function imod (a) {\n if (this.prime) return this.prime.ireduce(a)._forceRed(this);\n return a.umod(this.m)._forceRed(this);\n };\n\n Red.prototype.neg = function neg (a) {\n if (a.isZero()) {\n return a.clone();\n }\n\n return this.m.sub(a)._forceRed(this);\n };\n\n Red.prototype.add = function add (a, b) {\n this._verify2(a, b);\n\n var res = a.add(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.iadd = function iadd (a, b) {\n this._verify2(a, b);\n\n var res = a.iadd(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res;\n };\n\n Red.prototype.sub = function sub (a, b) {\n this._verify2(a, b);\n\n var res = a.sub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.isub = function isub (a, b) {\n this._verify2(a, b);\n\n var res = a.isub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res;\n };\n\n Red.prototype.shl = function shl (a, num) {\n this._verify1(a);\n return this.imod(a.ushln(num));\n };\n\n Red.prototype.imul = function imul (a, b) {\n this._verify2(a, b);\n return this.imod(a.imul(b));\n };\n\n Red.prototype.mul = function mul (a, b) {\n this._verify2(a, b);\n return this.imod(a.mul(b));\n };\n\n Red.prototype.isqr = function isqr (a) {\n return this.imul(a, a.clone());\n };\n\n Red.prototype.sqr = function sqr (a) {\n return this.mul(a, a);\n };\n\n Red.prototype.sqrt = function sqrt (a) {\n if (a.isZero()) return a.clone();\n\n var mod3 = this.m.andln(3);\n assert(mod3 % 2 === 1);\n\n // Fast case\n if (mod3 === 3) {\n var pow = this.m.add(new BN(1)).iushrn(2);\n return this.pow(a, pow);\n }\n\n // Tonelli-Shanks algorithm (Totally unoptimized and slow)\n //\n // Find Q and S, that Q * 2 ^ S = (P - 1)\n var q = this.m.subn(1);\n var s = 0;\n while (!q.isZero() && q.andln(1) === 0) {\n s++;\n q.iushrn(1);\n }\n assert(!q.isZero());\n\n var one = new BN(1).toRed(this);\n var nOne = one.redNeg();\n\n // Find quadratic non-residue\n // NOTE: Max is such because of generalized Riemann hypothesis.\n var lpow = this.m.subn(1).iushrn(1);\n var z = this.m.bitLength();\n z = new BN(2 * z * z).toRed(this);\n\n while (this.pow(z, lpow).cmp(nOne) !== 0) {\n z.redIAdd(nOne);\n }\n\n var c = this.pow(z, q);\n var r = this.pow(a, q.addn(1).iushrn(1));\n var t = this.pow(a, q);\n var m = s;\n while (t.cmp(one) !== 0) {\n var tmp = t;\n for (var i = 0; tmp.cmp(one) !== 0; i++) {\n tmp = tmp.redSqr();\n }\n assert(i < m);\n var b = this.pow(c, new BN(1).iushln(m - i - 1));\n\n r = r.redMul(b);\n c = b.redSqr();\n t = t.redMul(c);\n m = i;\n }\n\n return r;\n };\n\n Red.prototype.invm = function invm (a) {\n var inv = a._invmp(this.m);\n if (inv.negative !== 0) {\n inv.negative = 0;\n return this.imod(inv).redNeg();\n } else {\n return this.imod(inv);\n }\n };\n\n Red.prototype.pow = function pow (a, num) {\n if (num.isZero()) return new BN(1);\n if (num.cmpn(1) === 0) return a.clone();\n\n var windowSize = 4;\n var wnd = new Array(1 << windowSize);\n wnd[0] = new BN(1).toRed(this);\n wnd[1] = a;\n for (var i = 2; i < wnd.length; i++) {\n wnd[i] = this.mul(wnd[i - 1], a);\n }\n\n var res = wnd[0];\n var current = 0;\n var currentLen = 0;\n var start = num.bitLength() % 26;\n if (start === 0) {\n start = 26;\n }\n\n for (i = num.length - 1; i >= 0; i--) {\n var word = num.words[i];\n for (var j = start - 1; j >= 0; j--) {\n var bit = (word >> j) & 1;\n if (res !== wnd[0]) {\n res = this.sqr(res);\n }\n\n if (bit === 0 && current === 0) {\n currentLen = 0;\n continue;\n }\n\n current <<= 1;\n current |= bit;\n currentLen++;\n if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;\n\n res = this.mul(res, wnd[current]);\n currentLen = 0;\n current = 0;\n }\n start = 26;\n }\n\n return res;\n };\n\n Red.prototype.convertTo = function convertTo (num) {\n var r = num.umod(this.m);\n\n return r === num ? r.clone() : r;\n };\n\n Red.prototype.convertFrom = function convertFrom (num) {\n var res = num.clone();\n res.red = null;\n return res;\n };\n\n //\n // Montgomery method engine\n //\n\n BN.mont = function mont (num) {\n return new Mont(num);\n };\n\n function Mont (m) {\n Red.call(this, m);\n\n this.shift = this.m.bitLength();\n if (this.shift % 26 !== 0) {\n this.shift += 26 - (this.shift % 26);\n }\n\n this.r = new BN(1).iushln(this.shift);\n this.r2 = this.imod(this.r.sqr());\n this.rinv = this.r._invmp(this.m);\n\n this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);\n this.minv = this.minv.umod(this.r);\n this.minv = this.r.sub(this.minv);\n }\n inherits(Mont, Red);\n\n Mont.prototype.convertTo = function convertTo (num) {\n return this.imod(num.ushln(this.shift));\n };\n\n Mont.prototype.convertFrom = function convertFrom (num) {\n var r = this.imod(num.mul(this.rinv));\n r.red = null;\n return r;\n };\n\n Mont.prototype.imul = function imul (a, b) {\n if (a.isZero() || b.isZero()) {\n a.words[0] = 0;\n a.length = 1;\n return a;\n }\n\n var t = a.imul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.mul = function mul (a, b) {\n if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);\n\n var t = a.mul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.invm = function invm (a) {\n // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\n var res = this.imod(a._invmp(this.m).mul(this.r2));\n return res._forceRed(this);\n };\n})(typeof module === 'undefined' || module, this);\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nfunction EventEmitter() {\n this._events = this._events || {};\n this._maxListeners = this._maxListeners || undefined;\n}\nmodule.exports = EventEmitter;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nEventEmitter.defaultMaxListeners = 10;\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function(n) {\n if (!isNumber(n) || n < 0 || isNaN(n))\n throw TypeError('n must be a positive number');\n this._maxListeners = n;\n return this;\n};\n\nEventEmitter.prototype.emit = function(type) {\n var er, handler, len, args, i, listeners;\n\n if (!this._events)\n this._events = {};\n\n // If there is no 'error' event listener then throw.\n if (type === 'error') {\n if (!this._events.error ||\n (isObject(this._events.error) && !this._events.error.length)) {\n er = arguments[1];\n if (er instanceof Error) {\n throw er; // Unhandled 'error' event\n } else {\n // At least give some kind of context to the user\n var err = new Error('Uncaught, unspecified \"error\" event. (' + er + ')');\n err.context = er;\n throw err;\n }\n }\n }\n\n handler = this._events[type];\n\n if (isUndefined(handler))\n return false;\n\n if (isFunction(handler)) {\n switch (arguments.length) {\n // fast cases\n case 1:\n handler.call(this);\n break;\n case 2:\n handler.call(this, arguments[1]);\n break;\n case 3:\n handler.call(this, arguments[1], arguments[2]);\n break;\n // slower\n default:\n args = Array.prototype.slice.call(arguments, 1);\n handler.apply(this, args);\n }\n } else if (isObject(handler)) {\n args = Array.prototype.slice.call(arguments, 1);\n listeners = handler.slice();\n len = listeners.length;\n for (i = 0; i < len; i++)\n listeners[i].apply(this, args);\n }\n\n return true;\n};\n\nEventEmitter.prototype.addListener = function(type, listener) {\n var m;\n\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n if (!this._events)\n this._events = {};\n\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (this._events.newListener)\n this.emit('newListener', type,\n isFunction(listener.listener) ?\n listener.listener : listener);\n\n if (!this._events[type])\n // Optimize the case of one listener. Don't need the extra array object.\n this._events[type] = listener;\n else if (isObject(this._events[type]))\n // If we've already got an array, just append.\n this._events[type].push(listener);\n else\n // Adding the second element, need to change to array.\n this._events[type] = [this._events[type], listener];\n\n // Check for listener leak\n if (isObject(this._events[type]) && !this._events[type].warned) {\n if (!isUndefined(this._maxListeners)) {\n m = this._maxListeners;\n } else {\n m = EventEmitter.defaultMaxListeners;\n }\n\n if (m && m > 0 && this._events[type].length > m) {\n this._events[type].warned = true;\n console.error('(node) warning: possible EventEmitter memory ' +\n 'leak detected. %d listeners added. ' +\n 'Use emitter.setMaxListeners() to increase limit.',\n this._events[type].length);\n if (typeof console.trace === 'function') {\n // not supported in IE 10\n console.trace();\n }\n }\n }\n\n return this;\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.once = function(type, listener) {\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n var fired = false;\n\n function g() {\n this.removeListener(type, g);\n\n if (!fired) {\n fired = true;\n listener.apply(this, arguments);\n }\n }\n\n g.listener = listener;\n this.on(type, g);\n\n return this;\n};\n\n// emits a 'removeListener' event iff the listener was removed\nEventEmitter.prototype.removeListener = function(type, listener) {\n var list, position, length, i;\n\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n if (!this._events || !this._events[type])\n return this;\n\n list = this._events[type];\n length = list.length;\n position = -1;\n\n if (list === listener ||\n (isFunction(list.listener) && list.listener === listener)) {\n delete this._events[type];\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n\n } else if (isObject(list)) {\n for (i = length; i-- > 0;) {\n if (list[i] === listener ||\n (list[i].listener && list[i].listener === listener)) {\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (list.length === 1) {\n list.length = 0;\n delete this._events[type];\n } else {\n list.splice(position, 1);\n }\n\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n }\n\n return this;\n};\n\nEventEmitter.prototype.removeAllListeners = function(type) {\n var key, listeners;\n\n if (!this._events)\n return this;\n\n // not listening for removeListener, no need to emit\n if (!this._events.removeListener) {\n if (arguments.length === 0)\n this._events = {};\n else if (this._events[type])\n delete this._events[type];\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n for (key in this._events) {\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = {};\n return this;\n }\n\n listeners = this._events[type];\n\n if (isFunction(listeners)) {\n this.removeListener(type, listeners);\n } else if (listeners) {\n // LIFO order\n while (listeners.length)\n this.removeListener(type, listeners[listeners.length - 1]);\n }\n delete this._events[type];\n\n return this;\n};\n\nEventEmitter.prototype.listeners = function(type) {\n var ret;\n if (!this._events || !this._events[type])\n ret = [];\n else if (isFunction(this._events[type]))\n ret = [this._events[type]];\n else\n ret = this._events[type].slice();\n return ret;\n};\n\nEventEmitter.prototype.listenerCount = function(type) {\n if (this._events) {\n var evlistener = this._events[type];\n\n if (isFunction(evlistener))\n return 1;\n else if (evlistener)\n return evlistener.length;\n }\n return 0;\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n return emitter.listenerCount(type);\n};\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\n","var Buffer = require('safe-buffer').Buffer\nvar MD5 = require('md5.js')\n\n/* eslint-disable camelcase */\nfunction EVP_BytesToKey (password, salt, keyBits, ivLen) {\n if (!Buffer.isBuffer(password)) password = Buffer.from(password, 'binary')\n if (salt) {\n if (!Buffer.isBuffer(salt)) salt = Buffer.from(salt, 'binary')\n if (salt.length !== 8) throw new RangeError('salt should be Buffer with 8 byte length')\n }\n\n var keyLen = keyBits / 8\n var key = Buffer.alloc(keyLen)\n var iv = Buffer.alloc(ivLen || 0)\n var tmp = Buffer.alloc(0)\n\n while (keyLen > 0 || ivLen > 0) {\n var hash = new MD5()\n hash.update(tmp)\n hash.update(password)\n if (salt) hash.update(salt)\n tmp = hash.digest()\n\n var used = 0\n\n if (keyLen > 0) {\n var keyStart = key.length - keyLen\n used = Math.min(keyLen, tmp.length)\n tmp.copy(key, keyStart, 0, used)\n keyLen -= used\n }\n\n if (used < tmp.length && ivLen > 0) {\n var ivStart = iv.length - ivLen\n var length = Math.min(ivLen, tmp.length - used)\n tmp.copy(iv, ivStart, used, used + length)\n ivLen -= length\n }\n }\n\n tmp.fill(0)\n return { key: key, iv: iv }\n}\n\nmodule.exports = EVP_BytesToKey\n","'use strict';\n\nvar isArray = Array.isArray;\nvar keyList = Object.keys;\nvar hasProp = Object.prototype.hasOwnProperty;\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n var arrA = isArray(a)\n , arrB = isArray(b)\n , i\n , length\n , key;\n\n if (arrA && arrB) {\n length = a.length;\n if (length != b.length) return false;\n for (i = 0; i < length; i++)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n if (arrA != arrB) return false;\n\n var dateA = a instanceof Date\n , dateB = b instanceof Date;\n if (dateA != dateB) return false;\n if (dateA && dateB) return a.getTime() == b.getTime();\n\n var regexpA = a instanceof RegExp\n , regexpB = b instanceof RegExp;\n if (regexpA != regexpB) return false;\n if (regexpA && regexpB) return a.toString() == b.toString();\n\n if (a instanceof Object && b instanceof Object) {\n var keys = keyList(a);\n length = keys.length;\n\n if (length !== keyList(b).length)\n return false;\n\n for (i = 0; i < length; i++)\n if (!hasProp.call(b, keys[i])) return false;\n\n for (i = 0; i < length; i++) {\n key = keys[i];\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n return false;\n};\n","'use strict';\n\nmodule.exports = function (data, opts) {\n if (!opts) opts = {};\n if (typeof opts === 'function') opts = { cmp: opts };\n var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false;\n\n var cmp = opts.cmp && (function (f) {\n return function (node) {\n return function (a, b) {\n var aobj = { key: a, value: node[a] };\n var bobj = { key: b, value: node[b] };\n return f(aobj, bobj);\n };\n };\n })(opts.cmp);\n\n var seen = [];\n return (function stringify (node) {\n if (node && node.toJSON && typeof node.toJSON === 'function') {\n node = node.toJSON();\n }\n\n if (node === undefined) return;\n if (typeof node == 'number') return isFinite(node) ? '' + node : 'null';\n if (typeof node !== 'object') return JSON.stringify(node);\n\n var i, out;\n if (Array.isArray(node)) {\n out = '[';\n for (i = 0; i < node.length; i++) {\n if (i) out += ',';\n out += stringify(node[i]) || 'null';\n }\n return out + ']';\n }\n\n if (node === null) return 'null';\n\n if (seen.indexOf(node) !== -1) {\n if (cycles) return JSON.stringify('__cycle__');\n throw new TypeError('Converting circular structure to JSON');\n }\n\n var seenIndex = seen.push(node) - 1;\n var keys = Object.keys(node).sort(cmp && cmp(node));\n out = '';\n for (i = 0; i < keys.length; i++) {\n var key = keys[i];\n var value = stringify(node[key]);\n\n if (!value) continue;\n if (out) out += ',';\n out += JSON.stringify(key) + ':' + value;\n }\n seen.splice(seenIndex, 1);\n return '{' + out + '}';\n })(data);\n};\n","'use strict';\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @typechecks\n */\n\nvar emptyFunction = require('./emptyFunction');\n\n/**\n * Upstream version of event listener. Does not take into account specific\n * nature of platform.\n */\nvar EventListener = {\n /**\n * Listen to DOM events during the bubble phase.\n *\n * @param {DOMEventTarget} target DOM element to register listener on.\n * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.\n * @param {function} callback Callback function.\n * @return {object} Object with a `remove` method.\n */\n listen: function listen(target, eventType, callback) {\n if (target.addEventListener) {\n target.addEventListener(eventType, callback, false);\n return {\n remove: function remove() {\n target.removeEventListener(eventType, callback, false);\n }\n };\n } else if (target.attachEvent) {\n target.attachEvent('on' + eventType, callback);\n return {\n remove: function remove() {\n target.detachEvent('on' + eventType, callback);\n }\n };\n }\n },\n\n /**\n * Listen to DOM events during the capture phase.\n *\n * @param {DOMEventTarget} target DOM element to register listener on.\n * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.\n * @param {function} callback Callback function.\n * @return {object} Object with a `remove` method.\n */\n capture: function capture(target, eventType, callback) {\n if (target.addEventListener) {\n target.addEventListener(eventType, callback, true);\n return {\n remove: function remove() {\n target.removeEventListener(eventType, callback, true);\n }\n };\n } else {\n if (process.env.NODE_ENV !== 'production') {\n console.error('Attempted to listen to events during the capture phase on a ' + 'browser that does not support the capture phase. Your application ' + 'will not receive some events.');\n }\n return {\n remove: emptyFunction\n };\n }\n },\n\n registerDefault: function registerDefault() {}\n};\n\nmodule.exports = EventListener;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n'use strict';\n\nvar canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);\n\n/**\n * Simple, lightweight module assisting with the detection and context of\n * Worker. Helps avoid circular dependencies and allows code to reason about\n * whether or not they are in a Worker, even if they never include the main\n * `ReactWorker` dependency.\n */\nvar ExecutionEnvironment = {\n\n canUseDOM: canUseDOM,\n\n canUseWorkers: typeof Worker !== 'undefined',\n\n canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent),\n\n canUseViewport: canUseDOM && !!window.screen,\n\n isInWorker: !canUseDOM // For now, this is true - might change in the future.\n\n};\n\nmodule.exports = ExecutionEnvironment;","\"use strict\";\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @typechecks\n */\n\nvar _hyphenPattern = /-(.)/g;\n\n/**\n * Camelcases a hyphenated string, for example:\n *\n * > camelize('background-color')\n * < \"backgroundColor\"\n *\n * @param {string} string\n * @return {string}\n */\nfunction camelize(string) {\n return string.replace(_hyphenPattern, function (_, character) {\n return character.toUpperCase();\n });\n}\n\nmodule.exports = camelize;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @typechecks\n */\n\n'use strict';\n\nvar camelize = require('./camelize');\n\nvar msPattern = /^-ms-/;\n\n/**\n * Camelcases a hyphenated CSS property name, for example:\n *\n * > camelizeStyleName('background-color')\n * < \"backgroundColor\"\n * > camelizeStyleName('-moz-transition')\n * < \"MozTransition\"\n * > camelizeStyleName('-ms-transition')\n * < \"msTransition\"\n *\n * As Andi Smith suggests\n * (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix\n * is converted to lowercase `ms`.\n *\n * @param {string} string\n * @return {string}\n */\nfunction camelizeStyleName(string) {\n return camelize(string.replace(msPattern, 'ms-'));\n}\n\nmodule.exports = camelizeStyleName;","'use strict';\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nvar isTextNode = require('./isTextNode');\n\n/*eslint-disable no-bitwise */\n\n/**\n * Checks if a given DOM node contains or is another DOM node.\n */\nfunction containsNode(outerNode, innerNode) {\n if (!outerNode || !innerNode) {\n return false;\n } else if (outerNode === innerNode) {\n return true;\n } else if (isTextNode(outerNode)) {\n return false;\n } else if (isTextNode(innerNode)) {\n return containsNode(outerNode, innerNode.parentNode);\n } else if ('contains' in outerNode) {\n return outerNode.contains(innerNode);\n } else if (outerNode.compareDocumentPosition) {\n return !!(outerNode.compareDocumentPosition(innerNode) & 16);\n } else {\n return false;\n }\n}\n\nmodule.exports = containsNode;","\"use strict\";\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}\n\n/**\n * This function accepts and discards inputs; it has no side effects. This is\n * primarily useful idiomatically for overridable function endpoints which\n * always need to be callable, since JS lacks a null-call idiom ala Cocoa.\n */\nvar emptyFunction = function emptyFunction() {};\n\nemptyFunction.thatReturns = makeEmptyFunction;\nemptyFunction.thatReturnsFalse = makeEmptyFunction(false);\nemptyFunction.thatReturnsTrue = makeEmptyFunction(true);\nemptyFunction.thatReturnsNull = makeEmptyFunction(null);\nemptyFunction.thatReturnsThis = function () {\n return this;\n};\nemptyFunction.thatReturnsArgument = function (arg) {\n return arg;\n};\n\nmodule.exports = emptyFunction;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n'use strict';\n\nvar emptyObject = {};\n\nif (process.env.NODE_ENV !== 'production') {\n Object.freeze(emptyObject);\n}\n\nmodule.exports = emptyObject;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n'use strict';\n\n/**\n * @param {DOMElement} node input/textarea to focus\n */\n\nfunction focusNode(node) {\n // IE8 can throw \"Can't move focus to the control because it is invisible,\n // not enabled, or of a type that does not accept the focus.\" for all kinds of\n // reasons that are too expensive and fragile to test.\n try {\n node.focus();\n } catch (e) {}\n}\n\nmodule.exports = focusNode;","'use strict';\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @typechecks\n */\n\n/* eslint-disable fb-www/typeof-undefined */\n\n/**\n * Same as document.activeElement but wraps in a try-catch block. In IE it is\n * not safe to call document.activeElement if there is nothing focused.\n *\n * The activeElement will be null only if the document or document body is not\n * yet defined.\n *\n * @param {?DOMDocument} doc Defaults to current document.\n * @return {?DOMElement}\n */\nfunction getActiveElement(doc) /*?DOMElement*/{\n doc = doc || (typeof document !== 'undefined' ? document : undefined);\n if (typeof doc === 'undefined') {\n return null;\n }\n try {\n return doc.activeElement || doc.body;\n } catch (e) {\n return doc.body;\n }\n}\n\nmodule.exports = getActiveElement;","'use strict';\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @typechecks\n */\n\nvar _uppercasePattern = /([A-Z])/g;\n\n/**\n * Hyphenates a camelcased string, for example:\n *\n * > hyphenate('backgroundColor')\n * < \"background-color\"\n *\n * For CSS style names, use `hyphenateStyleName` instead which works properly\n * with all vendor prefixes, including `ms`.\n *\n * @param {string} string\n * @return {string}\n */\nfunction hyphenate(string) {\n return string.replace(_uppercasePattern, '-$1').toLowerCase();\n}\n\nmodule.exports = hyphenate;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @typechecks\n */\n\n'use strict';\n\nvar hyphenate = require('./hyphenate');\n\nvar msPattern = /^ms-/;\n\n/**\n * Hyphenates a camelcased CSS property name, for example:\n *\n * > hyphenateStyleName('backgroundColor')\n * < \"background-color\"\n * > hyphenateStyleName('MozTransition')\n * < \"-moz-transition\"\n * > hyphenateStyleName('msTransition')\n * < \"-ms-transition\"\n *\n * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix\n * is converted to `-ms-`.\n *\n * @param {string} string\n * @return {string}\n */\nfunction hyphenateStyleName(string) {\n return hyphenate(string).replace(msPattern, '-ms-');\n}\n\nmodule.exports = hyphenateStyleName;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n'use strict';\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar validateFormat = function validateFormat(format) {};\n\nif (process.env.NODE_ENV !== 'production') {\n validateFormat = function validateFormat(format) {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n };\n}\n\nfunction invariant(condition, format, a, b, c, d, e, f) {\n validateFormat(format);\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(format.replace(/%s/g, function () {\n return args[argIndex++];\n }));\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n}\n\nmodule.exports = invariant;","'use strict';\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @typechecks\n */\n\n/**\n * @param {*} object The object to check.\n * @return {boolean} Whether or not the object is a DOM node.\n */\nfunction isNode(object) {\n var doc = object ? object.ownerDocument || object : document;\n var defaultView = doc.defaultView || window;\n return !!(object && (typeof defaultView.Node === 'function' ? object instanceof defaultView.Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string'));\n}\n\nmodule.exports = isNode;","'use strict';\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @typechecks\n */\n\nvar isNode = require('./isNode');\n\n/**\n * @param {*} object The object to check.\n * @return {boolean} Whether or not the object is a DOM text node.\n */\nfunction isTextNode(object) {\n return isNode(object) && object.nodeType == 3;\n}\n\nmodule.exports = isTextNode;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @typechecks\n * \n */\n\n/*eslint-disable no-self-compare */\n\n'use strict';\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\nfunction is(x, y) {\n // SameValue algorithm\n if (x === y) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n // Added the nonzero y check to make Flow happy, but it is redundant\n return x !== 0 || y !== 0 || 1 / x === 1 / y;\n } else {\n // Step 6.a: NaN == NaN\n return x !== x && y !== y;\n }\n}\n\n/**\n * Performs equality by iterating through keys on an object and returning false\n * when any key has values which are not strictly equal between the arguments.\n * Returns true when the values of all keys are strictly equal.\n */\nfunction shallowEqual(objA, objB) {\n if (is(objA, objB)) {\n return true;\n }\n\n if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n // Test for A's keys different from B.\n for (var i = 0; i < keysA.length; i++) {\n if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n\n return true;\n}\n\nmodule.exports = shallowEqual;","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n'use strict';\n\nvar emptyFunction = require('./emptyFunction');\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar warning = emptyFunction;\n\nif (process.env.NODE_ENV !== 'production') {\n var printWarning = function printWarning(format) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n var argIndex = 0;\n var message = 'Warning: ' + format.replace(/%s/g, function () {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n\n warning = function warning(condition, format) {\n if (format === undefined) {\n throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');\n }\n\n if (format.indexOf('Failed Composite propType: ') === 0) {\n return; // Ignore CompositeComponent proptype check.\n }\n\n if (!condition) {\n for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n args[_key2 - 2] = arguments[_key2];\n }\n\n printWarning.apply(undefined, [format].concat(args));\n }\n };\n}\n\nmodule.exports = warning;","// \nvar toPath = function toPath(key) {\n if (key === null || key === undefined) {\n return [];\n }\n if (typeof key !== 'string') {\n throw new Error('toPath() expects a string');\n }\n return key.length ? key.split(/[.[\\]]+/).filter(Boolean) : [];\n};\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n return typeof obj;\n} : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n};\n\nvar defineProperty = function (obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n};\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nvar toConsumableArray = function (arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];\n\n return arr2;\n } else {\n return Array.from(arr);\n }\n};\n\n// \n\nvar getIn = function getIn(state, complexKey) {\n // Intentionally using iteration rather than recursion\n var path = toPath(complexKey);\n var current = state;\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = path[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var key = _step.value;\n\n if (current === undefined || current === null || (typeof current === 'undefined' ? 'undefined' : _typeof(current)) !== 'object' || Array.isArray(current) && isNaN(key)) {\n return undefined;\n }\n current = current[key];\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return current;\n};\n\n// \n\nvar setInRecursor = function setInRecursor(current, index, path, value) {\n if (index >= path.length) {\n // end of recursion\n return value;\n }\n var key = path[index];\n\n // determine type of key\n if (isNaN(key)) {\n // object set\n if (current === undefined || current === null) {\n // recurse\n var _result2 = setInRecursor(undefined, index + 1, path, value);\n\n // delete or create an object\n return _result2 === undefined ? undefined : defineProperty({}, key, _result2);\n }\n if (Array.isArray(current)) {\n throw new Error('Cannot set a non-numeric property on an array');\n }\n // current exists, so make a copy of all its values, and add/update the new one\n var _result = setInRecursor(current[key], index + 1, path, value);\n var numKeys = Object.keys(current).length;\n if (_result === undefined) {\n if (current[key] === undefined && numKeys === 0) {\n // object was already empty\n return undefined;\n }\n if (current[key] !== undefined && numKeys <= 1) {\n // only key we had was the one we are deleting\n if (!isNaN(path[index - 1])) {\n // we are in an array, so return an empty object\n return {};\n } else {\n return undefined;\n }\n }\n }\n // set result in key\n return _extends({}, current, defineProperty({}, key, _result));\n }\n // array set\n var numericKey = Number(key);\n if (current === undefined || current === null) {\n // recurse\n var _result3 = setInRecursor(undefined, index + 1, path, value);\n\n // if nothing returned, delete it\n if (_result3 === undefined) {\n return undefined;\n }\n\n // create an array\n var _array = [];\n _array[numericKey] = _result3;\n return _array;\n }\n if (!Array.isArray(current)) {\n throw new Error('Cannot set a numeric property on an object');\n }\n // recurse\n var existingValue = current[numericKey];\n var result = setInRecursor(existingValue, index + 1, path, value);\n\n // current exists, so make a copy of all its values, and add/update the new one\n var array = [].concat(toConsumableArray(current));\n array[numericKey] = result;\n return array;\n};\n\nvar setIn = function setIn(state, key, value) {\n if (state === undefined || state === null) {\n throw new Error('Cannot call setIn() with ' + String(state) + ' state');\n }\n if (key === undefined || key === null) {\n throw new Error('Cannot call setIn() with ' + String(key) + ' key');\n }\n // Recursive function needs to accept and return State, but public API should\n // only deal with Objects\n return setInRecursor(state, 0, toPath(key), value);\n};\n\n// \n\n/**\n * Converts internal field state to published field state\n */\nvar publishFieldState = function publishFieldState(formState, field) {\n var errors = formState.errors,\n initialValues = formState.initialValues,\n lastSubmittedValues = formState.lastSubmittedValues,\n submitErrors = formState.submitErrors,\n submitFailed = formState.submitFailed,\n submitSucceeded = formState.submitSucceeded,\n values = formState.values;\n var active = field.active,\n blur = field.blur,\n change = field.change,\n data = field.data,\n focus = field.focus,\n name = field.name,\n touched = field.touched,\n visited = field.visited;\n\n var value = getIn(values, name);\n var error = getIn(errors, name);\n var submitError = submitErrors && getIn(submitErrors, name);\n var initial = initialValues && getIn(initialValues, name);\n var pristine = field.isEqual(initial, value);\n var dirtySinceLastSubmit = !!(lastSubmittedValues && !field.isEqual(getIn(lastSubmittedValues, name), value));\n var valid = !error && !submitError;\n return {\n active: active,\n blur: blur,\n change: change,\n data: data,\n dirty: !pristine,\n dirtySinceLastSubmit: dirtySinceLastSubmit,\n error: error,\n focus: focus,\n initial: initial,\n invalid: !valid,\n length: Array.isArray(value) ? value.length : undefined,\n name: name,\n pristine: pristine,\n submitError: submitError,\n submitFailed: submitFailed,\n submitSucceeded: submitSucceeded,\n touched: touched,\n valid: valid,\n value: value,\n visited: visited\n };\n};\n\n// \nvar fieldSubscriptionItems = ['active', 'data', 'dirty', 'dirtySinceLastSubmit', 'error', 'initial', 'invalid', 'length', 'pristine', 'submitError', 'submitFailed', 'submitSucceeded', 'touched', 'valid', 'value', 'visited'];\n\n// \n\n\nvar shallowEqual = function shallowEqual(a, b) {\n if (a === b) {\n return true;\n }\n if ((typeof a === 'undefined' ? 'undefined' : _typeof(a)) !== 'object' || !a || (typeof b === 'undefined' ? 'undefined' : _typeof(b)) !== 'object' || !b) {\n return false;\n }\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n if (keysA.length !== keysB.length) {\n return false;\n }\n var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(b);\n for (var idx = 0; idx < keysA.length; idx++) {\n var key = keysA[idx];\n if (!bHasOwnProperty(key) || a[key] !== b[key]) {\n return false;\n }\n }\n return true;\n};\n\n// \nfunction subscriptionFilter (dest, src, previous, subscription, keys, shallowEqualKeys) {\n var different = false;\n keys.forEach(function (key) {\n if (subscription[key]) {\n dest[key] = src[key];\n if (!previous || (~shallowEqualKeys.indexOf(key) ? !shallowEqual(src[key], previous[key]) : src[key] !== previous[key])) {\n different = true;\n }\n }\n });\n return different;\n}\n\n// \n\nvar shallowEqualKeys = ['data'];\n\n/**\n * Filters items in a FieldState based on a FieldSubscription\n */\nvar filterFieldState = function filterFieldState(state, previousState, subscription, force) {\n var result = {\n blur: state.blur,\n change: state.change,\n focus: state.focus,\n name: state.name\n };\n var different = subscriptionFilter(result, state, previousState, subscription, fieldSubscriptionItems, shallowEqualKeys) || !previousState;\n return different || force ? result : undefined;\n};\n\n// \nvar formSubscriptionItems = ['active', 'dirty', 'dirtySinceLastSubmit', 'error', 'errors', 'initialValues', 'invalid', 'pristine', 'submitting', 'submitError', 'submitErrors', 'submitFailed', 'submitSucceeded', 'touched', 'valid', 'validating', 'values', 'visited'];\n\n// \n\nvar shallowEqualKeys$1 = ['touched', 'visited'];\n\n/**\n * Filters items in a FormState based on a FormSubscription\n */\nvar filterFormState = function filterFormState(state, previousState, subscription, force) {\n var result = {};\n var different = subscriptionFilter(result, state, previousState, subscription, formSubscriptionItems, shallowEqualKeys$1) || !previousState;\n return different || force ? result : undefined;\n};\n\n// \n\nvar memoize = function memoize(fn) {\n var lastArgs = void 0;\n var lastResult = void 0;\n return function () {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (!lastArgs || args.length !== lastArgs.length || args.some(function (arg, index) {\n return !shallowEqual(lastArgs[index], arg);\n })) {\n lastArgs = args;\n lastResult = fn.apply(undefined, args);\n }\n return lastResult;\n };\n};\n\nvar isPromise = (function (obj) {\n return !!obj && ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';\n});\n\n// \n\nvar FORM_ERROR = Symbol('form-error');\nvar version = '4.2.0';\n\nvar tripleEquals = function tripleEquals(a, b) {\n return a === b;\n};\n\nvar convertToExternalFormState = function convertToExternalFormState(_ref) {\n var active = _ref.active,\n dirtySinceLastSubmit = _ref.dirtySinceLastSubmit,\n error = _ref.error,\n errors = _ref.errors,\n initialValues = _ref.initialValues,\n pristine = _ref.pristine,\n submitting = _ref.submitting,\n submitFailed = _ref.submitFailed,\n submitSucceeded = _ref.submitSucceeded,\n submitError = _ref.submitError,\n submitErrors = _ref.submitErrors,\n valid = _ref.valid,\n validating = _ref.validating,\n values = _ref.values;\n return {\n active: active,\n dirty: !pristine,\n dirtySinceLastSubmit: dirtySinceLastSubmit,\n error: error,\n errors: errors,\n invalid: !valid,\n initialValues: initialValues,\n pristine: pristine,\n submitting: submitting,\n submitFailed: submitFailed,\n submitSucceeded: submitSucceeded,\n submitError: submitError,\n submitErrors: submitErrors,\n valid: valid,\n validating: validating > 0,\n values: values\n };\n};\n\nfunction notifySubscriber(subscriber, subscription, state, lastState, filter) {\n var force = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;\n\n var notification = filter(state, lastState, subscription, force);\n if (notification) {\n subscriber(notification);\n }\n}\n\nfunction notify(_ref2, state, lastState, filter) {\n var entries = _ref2.entries;\n\n Object.keys(entries).forEach(function (key) {\n var _entries$Number = entries[Number(key)],\n subscription = _entries$Number.subscription,\n subscriber = _entries$Number.subscriber;\n\n notifySubscriber(subscriber, subscription, state, lastState, filter);\n });\n}\n\nvar createForm = function createForm(config) {\n if (!config) {\n throw new Error('No config specified');\n }\n var debug = config.debug,\n initialValues = config.initialValues,\n mutators = config.mutators,\n onSubmit = config.onSubmit,\n validate = config.validate,\n validateOnBlur = config.validateOnBlur;\n\n if (!onSubmit) {\n throw new Error('No onSubmit function specified');\n }\n\n var state = {\n subscribers: { index: 0, entries: {} },\n fieldSubscribers: {},\n fields: {},\n formState: {\n dirtySinceLastSubmit: false,\n errors: {},\n initialValues: initialValues && _extends({}, initialValues),\n invalid: false,\n pristine: true,\n submitting: false,\n submitFailed: false,\n submitSucceeded: false,\n valid: true,\n validating: 0,\n values: initialValues ? _extends({}, initialValues) : {}\n },\n lastFormState: undefined\n };\n var inBatch = false;\n var validationPaused = false;\n var validationBlocked = false;\n var nextAsyncValidationKey = 0;\n var asyncValidationPromises = {};\n var clearAsyncValidationPromise = function clearAsyncValidationPromise(key) {\n return function (result) {\n delete asyncValidationPromises[key];\n return result;\n };\n };\n\n var changeValue = function changeValue(state, name, mutate) {\n if (state.fields[name]) {\n var before = getIn(state.formState.values, name);\n var after = mutate(before);\n state.formState.values = setIn(state.formState.values, name, after) || {};\n }\n };\n\n // bind state to mutators\n var mutatorsApi = mutators && Object.keys(mutators).reduce(function (result, key) {\n result[key] = function () {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var mutatableState = {\n formState: state.formState,\n fields: state.fields\n };\n var returnValue = mutators[key](args, mutatableState, {\n changeValue: changeValue,\n getIn: getIn,\n setIn: setIn,\n shallowEqual: shallowEqual\n });\n state.formState = mutatableState.formState;\n state.fields = mutatableState.fields;\n runValidation(undefined, function () {\n notifyFieldListeners();\n notifyFormListeners();\n });\n return returnValue;\n };\n return result;\n }, {}) || {};\n\n var runRecordLevelValidation = function runRecordLevelValidation(setErrors) {\n var promises = [];\n if (validate) {\n var errorsOrPromise = validate(_extends({}, state.formState.values)); // clone to avoid writing\n if (isPromise(errorsOrPromise)) {\n var asyncValidationPromiseKey = nextAsyncValidationKey++;\n var promise = errorsOrPromise.then(setErrors).then(clearAsyncValidationPromise(asyncValidationPromiseKey));\n promises.push(promise);\n asyncValidationPromises[asyncValidationPromiseKey] = promise;\n } else {\n setErrors(errorsOrPromise);\n }\n }\n return promises;\n };\n\n var getValidators = function getValidators(field) {\n return Object.keys(field.validators).reduce(function (result, index) {\n var validator = field.validators[Number(index)]();\n if (validator) {\n result.push(validator);\n }\n return result;\n }, []);\n };\n\n var runFieldLevelValidation = function runFieldLevelValidation(field, setError) {\n var promises = [];\n var validators = getValidators(field);\n if (validators.length) {\n var error = void 0;\n validators.forEach(function (validator) {\n var errorOrPromise = validator(getIn(state.formState.values, field.name), state.formState.values);\n if (errorOrPromise && isPromise(errorOrPromise)) {\n var asyncValidationPromiseKey = nextAsyncValidationKey++;\n var promise = errorOrPromise.then(setError).then(clearAsyncValidationPromise(asyncValidationPromiseKey));\n promises.push(promise);\n asyncValidationPromises[asyncValidationPromiseKey] = promise;\n } else if (!error) {\n // first registered validator wins\n error = errorOrPromise;\n }\n });\n setError(error);\n }\n return promises;\n };\n\n var runValidation = function runValidation(fieldChanged, callback) {\n if (validationPaused) {\n validationBlocked = true;\n /* istanbul ignore next */\n if (callback) {\n callback();\n }\n return;\n }\n\n var fields = state.fields,\n formState = state.formState;\n\n var fieldKeys = Object.keys(fields);\n if (!validate && !fieldKeys.some(function (key) {\n return getValidators(fields[key]).length;\n })) {\n if (callback) {\n callback();\n }\n return; // no validation rules\n }\n\n // pare down field keys to actually validate\n if (fieldChanged) {\n var validateFields = fields[fieldChanged].validateFields;\n\n if (validateFields) {\n fieldKeys = validateFields.length ? validateFields.concat(fieldChanged) : [fieldChanged];\n }\n }\n\n var recordLevelErrors = {};\n var fieldLevelErrors = {};\n var promises = [].concat(toConsumableArray(runRecordLevelValidation(function (errors) {\n recordLevelErrors = errors || {};\n })), toConsumableArray(fieldKeys.reduce(function (result, name) {\n return result.concat(runFieldLevelValidation(fields[name], function (error) {\n fieldLevelErrors[name] = error;\n }));\n }, [])));\n\n var processErrors = function processErrors() {\n var merged = _extends({}, recordLevelErrors);\n fieldKeys.forEach(function (name) {\n if (fields[name]) {\n // make sure field is still registered\n // field-level errors take precedent over record-level errors\n var error = fieldLevelErrors[name] || getIn(recordLevelErrors, name);\n if (error) {\n merged = setIn(merged, name, error);\n }\n }\n });\n if (!shallowEqual(formState.errors, merged)) {\n formState.errors = merged;\n }\n formState.error = recordLevelErrors[FORM_ERROR];\n };\n\n // process sync errors\n processErrors();\n\n if (promises.length) {\n // sync errors have been set. notify listeners while we wait for others\n state.formState.validating++;\n if (callback) {\n callback();\n }\n\n Promise.all(promises).then(function () {\n state.formState.validating--;\n processErrors();\n if (callback) {\n callback();\n }\n });\n } else if (callback) {\n callback();\n }\n };\n\n var notifyFieldListeners = function notifyFieldListeners(force) {\n if (inBatch) {\n return;\n }\n var fields = state.fields,\n fieldSubscribers = state.fieldSubscribers,\n formState = state.formState;\n\n Object.keys(fields).forEach(function (name) {\n var field = fields[name];\n var fieldState = publishFieldState(formState, field);\n var lastFieldState = field.lastFieldState;\n\n if (!shallowEqual(fieldState, lastFieldState)) {\n field.lastFieldState = fieldState;\n notify(fieldSubscribers[name], fieldState, lastFieldState, filterFieldState);\n }\n });\n };\n\n var hasSyncErrors = function hasSyncErrors() {\n return !!(state.formState.error || Object.keys(state.formState.errors).length);\n };\n\n var calculateNextFormState = function calculateNextFormState() {\n var fields = state.fields,\n formState = state.formState,\n lastFormState = state.lastFormState;\n\n var fieldKeys = Object.keys(fields);\n\n // calculate dirty/pristine\n formState.pristine = fieldKeys.every(function (key) {\n return fields[key].isEqual(getIn(formState.values, key), getIn(formState.initialValues || {}, key));\n });\n formState.dirtySinceLastSubmit = !!(formState.lastSubmittedValues && !fieldKeys.every(function (key) {\n return fields[key].isEqual(getIn(formState.values, key), getIn(formState.lastSubmittedValues || {}, key) // || {} is for flow, but causes branch coverage complaint\n );\n }));\n\n formState.valid = !formState.error && !formState.submitError && !Object.keys(formState.errors).length && !(formState.submitErrors && Object.keys(formState.submitErrors).length);\n var nextFormState = convertToExternalFormState(formState);\n\n var _fieldKeys$reduce = fieldKeys.reduce(function (result, key) {\n result.touched[key] = fields[key].touched;\n result.visited[key] = fields[key].visited;\n return result;\n }, { touched: {}, visited: {} }),\n touched = _fieldKeys$reduce.touched,\n visited = _fieldKeys$reduce.visited;\n\n nextFormState.touched = lastFormState && shallowEqual(lastFormState.touched, touched) ? lastFormState.touched : touched;\n nextFormState.visited = lastFormState && shallowEqual(lastFormState.visited, visited) ? lastFormState.visited : visited;\n return lastFormState && shallowEqual(lastFormState, nextFormState) ? lastFormState : nextFormState;\n };\n\n var callDebug = function callDebug() {\n return debug && process.env.NODE_ENV !== 'production' && debug(convertToExternalFormState(state.formState), Object.keys(state.fields).reduce(function (result, key) {\n result[key] = state.fields[key];\n return result;\n }, {}));\n };\n\n var notifyFormListeners = function notifyFormListeners() {\n callDebug();\n if (inBatch) {\n return;\n }\n var lastFormState = state.lastFormState;\n\n var nextFormState = calculateNextFormState();\n if (nextFormState !== lastFormState) {\n state.lastFormState = nextFormState;\n notify(state.subscribers, nextFormState, lastFormState, filterFormState);\n }\n };\n\n // generate initial errors\n runValidation();\n\n var api = {\n batch: function batch(fn) {\n inBatch = true;\n fn();\n inBatch = false;\n notifyFieldListeners();\n notifyFormListeners();\n },\n\n blur: function blur(name) {\n var fields = state.fields,\n formState = state.formState;\n\n var previous = fields[name];\n if (previous) {\n // can only blur registered fields\n delete formState.active;\n fields[name] = _extends({}, previous, {\n active: false,\n touched: true\n });\n if (validateOnBlur) {\n runValidation(name, function () {\n notifyFieldListeners();\n notifyFormListeners();\n });\n } else {\n notifyFieldListeners();\n notifyFormListeners();\n }\n }\n },\n\n change: function change(name, value) {\n var fields = state.fields,\n formState = state.formState;\n\n if (fields[name] && getIn(formState.values, name) !== value) {\n changeValue(state, name, function () {\n return value;\n });\n if (validateOnBlur) {\n notifyFieldListeners();\n notifyFormListeners();\n } else {\n runValidation(name, function () {\n notifyFieldListeners();\n notifyFormListeners();\n });\n }\n }\n },\n\n focus: function focus(name) {\n var field = state.fields[name];\n if (field && !field.active) {\n state.formState.active = name;\n field.active = true;\n field.visited = true;\n notifyFieldListeners();\n notifyFormListeners();\n }\n },\n\n mutators: mutatorsApi,\n\n getRegisteredFields: function getRegisteredFields() {\n return Object.keys(state.fields);\n },\n\n getState: function getState() {\n return convertToExternalFormState(state.formState);\n },\n\n initialize: function initialize(values) {\n var fields = state.fields,\n formState = state.formState;\n\n formState.initialValues = values;\n formState.values = values;\n Object.keys(fields).forEach(function (key) {\n var field = fields[key];\n field.touched = false;\n field.visited = false;\n });\n runValidation(undefined, function () {\n notifyFieldListeners();\n notifyFormListeners();\n });\n },\n\n pauseValidation: function pauseValidation() {\n validationPaused = true;\n },\n\n registerField: function registerField(name, subscriber) {\n var subscription = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var fieldConfig = arguments[3];\n\n if (!state.fieldSubscribers[name]) {\n state.fieldSubscribers[name] = { index: 0, entries: {} };\n }\n var index = state.fieldSubscribers[name].index++;\n\n // save field subscriber callback\n state.fieldSubscribers[name].entries[index] = {\n subscriber: memoize(subscriber),\n subscription: subscription\n };\n\n if (!state.fields[name]) {\n // create initial field state\n var initial = state.formState.initialValues ? getIn(state.formState.initialValues, name) : undefined;\n state.fields[name] = {\n active: false,\n blur: function blur() {\n return api.blur(name);\n },\n change: function change(value) {\n return api.change(name, value);\n },\n data: {},\n focus: function focus() {\n return api.focus(name);\n },\n initial: initial,\n isEqual: fieldConfig && fieldConfig.isEqual || tripleEquals,\n lastFieldState: undefined,\n name: name,\n touched: false,\n valid: true,\n validateFields: fieldConfig && fieldConfig.validateFields,\n validators: {},\n visited: false\n };\n }\n if (fieldConfig && fieldConfig.getValidator) {\n state.fields[name].validators[index] = fieldConfig.getValidator;\n }\n\n var sentFirstNotification = false;\n var firstNotification = function firstNotification() {\n var fieldState = publishFieldState(state.formState, state.fields[name]);\n notifySubscriber(subscriber, subscription, fieldState, undefined, filterFieldState, true);\n state.fields[name].lastFieldState = fieldState;\n sentFirstNotification = true;\n };\n\n runValidation(undefined, function () {\n notifyFormListeners();\n if (!sentFirstNotification) {\n firstNotification();\n }\n notifyFieldListeners();\n });\n\n return function () {\n delete state.fields[name].validators[index];\n delete state.fieldSubscribers[name].entries[index];\n if (!Object.keys(state.fieldSubscribers[name].entries).length) {\n delete state.fieldSubscribers[name];\n delete state.fields[name];\n }\n runValidation(undefined, function () {\n notifyFieldListeners();\n notifyFormListeners();\n });\n };\n },\n\n reset: function reset() {\n state.formState.submitFailed = false;\n state.formState.submitSucceeded = false;\n delete state.formState.submitErrors;\n delete state.formState.lastSubmittedValues;\n api.initialize(state.formState.initialValues || {});\n },\n\n resumeValidation: function resumeValidation() {\n validationPaused = false;\n if (validationBlocked) {\n // validation was attempted while it was paused, so run it now\n runValidation(undefined, function () {\n notifyFieldListeners();\n notifyFormListeners();\n });\n }\n validationBlocked = false;\n },\n\n submit: function submit() {\n var formState = state.formState,\n fields = state.fields;\n\n if (hasSyncErrors()) {\n // mark all fields as touched\n Object.keys(fields).forEach(function (key) {\n fields[key].touched = true;\n });\n state.formState.submitFailed = true;\n notifyFormListeners();\n notifyFieldListeners();\n return; // no submit for you!!\n }\n var asyncValidationPromisesKeys = Object.keys(asyncValidationPromises);\n if (asyncValidationPromisesKeys.length) {\n // still waiting on async validation to complete...\n Promise.all(asyncValidationPromisesKeys.reduce(function (result, key) {\n result.push(asyncValidationPromises[Number(key)]);\n return result;\n }, [])).then(function () {\n return api.submit();\n });\n return;\n }\n\n var resolvePromise = void 0;\n var completeCalled = false;\n var complete = function complete(errors) {\n formState.submitting = false;\n if (errors && (Object.keys(errors).length || Object.getOwnPropertySymbols(errors).length)) {\n formState.submitFailed = true;\n formState.submitSucceeded = false;\n formState.submitErrors = errors;\n formState.submitError = errors[FORM_ERROR];\n } else {\n delete formState.submitErrors;\n delete formState.submitError;\n formState.submitFailed = false;\n formState.submitSucceeded = true;\n }\n notifyFormListeners();\n notifyFieldListeners();\n completeCalled = true;\n if (resolvePromise) {\n resolvePromise();\n }\n };\n formState.submitting = true;\n formState.submitFailed = false;\n formState.submitSucceeded = false;\n formState.lastSubmittedValues = _extends({}, formState.values);\n if (onSubmit.length === 3) {\n // onSubmit is expecting a callback, first try synchronously\n onSubmit(formState.values, api, complete);\n if (!completeCalled) {\n // must be async, so we should return a Promise\n notifyFormListeners(); // let everyone know we are submitting\n return new Promise(function (resolve) {\n resolvePromise = resolve;\n });\n }\n } else {\n // onSubmit is either sync or async with a Promise\n var result = onSubmit(formState.values, api);\n if (result && isPromise(result)) {\n // onSubmit is async with a Promise\n notifyFormListeners(); // let everyone know we are submitting\n return result.then(complete);\n } else {\n // onSubmit is sync\n complete(result);\n }\n }\n },\n\n subscribe: function subscribe(subscriber, subscription) {\n if (!subscriber) {\n throw new Error('No callback given.');\n }\n if (!subscription) {\n throw new Error('No subscription provided. What values do you want to listen to?');\n }\n var memoized = memoize(subscriber);\n var subscribers = state.subscribers,\n lastFormState = state.lastFormState;\n\n var index = subscribers.index++;\n subscribers.entries[index] = {\n subscriber: memoized,\n subscription: subscription\n };\n var nextFormState = calculateNextFormState();\n if (nextFormState !== lastFormState) {\n state.lastFormState = nextFormState;\n }\n notifySubscriber(memoized, subscription, nextFormState, nextFormState, filterFormState, true);\n return function () {\n delete subscribers.entries[index];\n };\n }\n };\n return api;\n};\n\n//\n\nexport { createForm, FORM_ERROR, version, formSubscriptionItems, fieldSubscriptionItems, getIn, setIn };\n","var isFunction = require('is-function')\n\nmodule.exports = forEach\n\nvar toString = Object.prototype.toString\nvar hasOwnProperty = Object.prototype.hasOwnProperty\n\nfunction forEach(list, iterator, context) {\n if (!isFunction(iterator)) {\n throw new TypeError('iterator must be a function')\n }\n\n if (arguments.length < 3) {\n context = this\n }\n \n if (toString.call(list) === '[object Array]')\n forEachArray(list, iterator, context)\n else if (typeof list === 'string')\n forEachString(list, iterator, context)\n else\n forEachObject(list, iterator, context)\n}\n\nfunction forEachArray(array, iterator, context) {\n for (var i = 0, len = array.length; i < len; i++) {\n if (hasOwnProperty.call(array, i)) {\n iterator.call(context, array[i], i, array)\n }\n }\n}\n\nfunction forEachString(string, iterator, context) {\n for (var i = 0, len = string.length; i < len; i++) {\n // no such thing as a sparse string.\n iterator.call(context, string.charAt(i), i, string)\n }\n}\n\nfunction forEachObject(object, iterator, context) {\n for (var k in object) {\n if (hasOwnProperty.call(object, k)) {\n iterator.call(context, object[k], k, object)\n }\n }\n}\n","var win;\n\nif (typeof window !== \"undefined\") {\n win = window;\n} else if (typeof global !== \"undefined\") {\n win = global;\n} else if (typeof self !== \"undefined\"){\n win = self;\n} else {\n win = {};\n}\n\nmodule.exports = win;\n","'use strict'\nvar Transform = require('stream').Transform\nvar inherits = require('inherits')\n\nfunction HashBase (blockSize) {\n Transform.call(this)\n\n this._block = new Buffer(blockSize)\n this._blockSize = blockSize\n this._blockOffset = 0\n this._length = [0, 0, 0, 0]\n\n this._finalized = false\n}\n\ninherits(HashBase, Transform)\n\nHashBase.prototype._transform = function (chunk, encoding, callback) {\n var error = null\n try {\n if (encoding !== 'buffer') chunk = new Buffer(chunk, encoding)\n this.update(chunk)\n } catch (err) {\n error = err\n }\n\n callback(error)\n}\n\nHashBase.prototype._flush = function (callback) {\n var error = null\n try {\n this.push(this._digest())\n } catch (err) {\n error = err\n }\n\n callback(error)\n}\n\nHashBase.prototype.update = function (data, encoding) {\n if (!Buffer.isBuffer(data) && typeof data !== 'string') throw new TypeError('Data must be a string or a buffer')\n if (this._finalized) throw new Error('Digest already called')\n if (!Buffer.isBuffer(data)) data = new Buffer(data, encoding || 'binary')\n\n // consume data\n var block = this._block\n var offset = 0\n while (this._blockOffset + data.length - offset >= this._blockSize) {\n for (var i = this._blockOffset; i < this._blockSize;) block[i++] = data[offset++]\n this._update()\n this._blockOffset = 0\n }\n while (offset < data.length) block[this._blockOffset++] = data[offset++]\n\n // update length\n for (var j = 0, carry = data.length * 8; carry > 0; ++j) {\n this._length[j] += carry\n carry = (this._length[j] / 0x0100000000) | 0\n if (carry > 0) this._length[j] -= 0x0100000000 * carry\n }\n\n return this\n}\n\nHashBase.prototype._update = function (data) {\n throw new Error('_update is not implemented')\n}\n\nHashBase.prototype.digest = function (encoding) {\n if (this._finalized) throw new Error('Digest already called')\n this._finalized = true\n\n var digest = this._digest()\n if (encoding !== undefined) digest = digest.toString(encoding)\n return digest\n}\n\nHashBase.prototype._digest = function () {\n throw new Error('_digest is not implemented')\n}\n\nmodule.exports = HashBase\n","var hash = exports;\n\nhash.utils = require('./hash/utils');\nhash.common = require('./hash/common');\nhash.sha = require('./hash/sha');\nhash.ripemd = require('./hash/ripemd');\nhash.hmac = require('./hash/hmac');\n\n// Proxy hash functions to the main object\nhash.sha1 = hash.sha.sha1;\nhash.sha256 = hash.sha.sha256;\nhash.sha224 = hash.sha.sha224;\nhash.sha384 = hash.sha.sha384;\nhash.sha512 = hash.sha.sha512;\nhash.ripemd160 = hash.ripemd.ripemd160;\n","'use strict';\n\nvar utils = require('./utils');\nvar assert = require('minimalistic-assert');\n\nfunction BlockHash() {\n this.pending = null;\n this.pendingTotal = 0;\n this.blockSize = this.constructor.blockSize;\n this.outSize = this.constructor.outSize;\n this.hmacStrength = this.constructor.hmacStrength;\n this.padLength = this.constructor.padLength / 8;\n this.endian = 'big';\n\n this._delta8 = this.blockSize / 8;\n this._delta32 = this.blockSize / 32;\n}\nexports.BlockHash = BlockHash;\n\nBlockHash.prototype.update = function update(msg, enc) {\n // Convert message to array, pad it, and join into 32bit blocks\n msg = utils.toArray(msg, enc);\n if (!this.pending)\n this.pending = msg;\n else\n this.pending = this.pending.concat(msg);\n this.pendingTotal += msg.length;\n\n // Enough data, try updating\n if (this.pending.length >= this._delta8) {\n msg = this.pending;\n\n // Process pending data in blocks\n var r = msg.length % this._delta8;\n this.pending = msg.slice(msg.length - r, msg.length);\n if (this.pending.length === 0)\n this.pending = null;\n\n msg = utils.join32(msg, 0, msg.length - r, this.endian);\n for (var i = 0; i < msg.length; i += this._delta32)\n this._update(msg, i, i + this._delta32);\n }\n\n return this;\n};\n\nBlockHash.prototype.digest = function digest(enc) {\n this.update(this._pad());\n assert(this.pending === null);\n\n return this._digest(enc);\n};\n\nBlockHash.prototype._pad = function pad() {\n var len = this.pendingTotal;\n var bytes = this._delta8;\n var k = bytes - ((len + this.padLength) % bytes);\n var res = new Array(k + this.padLength);\n res[0] = 0x80;\n for (var i = 1; i < k; i++)\n res[i] = 0;\n\n // Append length\n len <<= 3;\n if (this.endian === 'big') {\n for (var t = 8; t < this.padLength; t++)\n res[i++] = 0;\n\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = (len >>> 24) & 0xff;\n res[i++] = (len >>> 16) & 0xff;\n res[i++] = (len >>> 8) & 0xff;\n res[i++] = len & 0xff;\n } else {\n res[i++] = len & 0xff;\n res[i++] = (len >>> 8) & 0xff;\n res[i++] = (len >>> 16) & 0xff;\n res[i++] = (len >>> 24) & 0xff;\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = 0;\n res[i++] = 0;\n\n for (t = 8; t < this.padLength; t++)\n res[i++] = 0;\n }\n\n return res;\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar assert = require('minimalistic-assert');\n\nfunction Hmac(hash, key, enc) {\n if (!(this instanceof Hmac))\n return new Hmac(hash, key, enc);\n this.Hash = hash;\n this.blockSize = hash.blockSize / 8;\n this.outSize = hash.outSize / 8;\n this.inner = null;\n this.outer = null;\n\n this._init(utils.toArray(key, enc));\n}\nmodule.exports = Hmac;\n\nHmac.prototype._init = function init(key) {\n // Shorten key, if needed\n if (key.length > this.blockSize)\n key = new this.Hash().update(key).digest();\n assert(key.length <= this.blockSize);\n\n // Add padding to key\n for (var i = key.length; i < this.blockSize; i++)\n key.push(0);\n\n for (i = 0; i < key.length; i++)\n key[i] ^= 0x36;\n this.inner = new this.Hash().update(key);\n\n // 0x36 ^ 0x5c = 0x6a\n for (i = 0; i < key.length; i++)\n key[i] ^= 0x6a;\n this.outer = new this.Hash().update(key);\n};\n\nHmac.prototype.update = function update(msg, enc) {\n this.inner.update(msg, enc);\n return this;\n};\n\nHmac.prototype.digest = function digest(enc) {\n this.outer.update(this.inner.digest());\n return this.outer.digest(enc);\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar common = require('./common');\n\nvar rotl32 = utils.rotl32;\nvar sum32 = utils.sum32;\nvar sum32_3 = utils.sum32_3;\nvar sum32_4 = utils.sum32_4;\nvar BlockHash = common.BlockHash;\n\nfunction RIPEMD160() {\n if (!(this instanceof RIPEMD160))\n return new RIPEMD160();\n\n BlockHash.call(this);\n\n this.h = [ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ];\n this.endian = 'little';\n}\nutils.inherits(RIPEMD160, BlockHash);\nexports.ripemd160 = RIPEMD160;\n\nRIPEMD160.blockSize = 512;\nRIPEMD160.outSize = 160;\nRIPEMD160.hmacStrength = 192;\nRIPEMD160.padLength = 64;\n\nRIPEMD160.prototype._update = function update(msg, start) {\n var A = this.h[0];\n var B = this.h[1];\n var C = this.h[2];\n var D = this.h[3];\n var E = this.h[4];\n var Ah = A;\n var Bh = B;\n var Ch = C;\n var Dh = D;\n var Eh = E;\n for (var j = 0; j < 80; j++) {\n var T = sum32(\n rotl32(\n sum32_4(A, f(j, B, C, D), msg[r[j] + start], K(j)),\n s[j]),\n E);\n A = E;\n E = D;\n D = rotl32(C, 10);\n C = B;\n B = T;\n T = sum32(\n rotl32(\n sum32_4(Ah, f(79 - j, Bh, Ch, Dh), msg[rh[j] + start], Kh(j)),\n sh[j]),\n Eh);\n Ah = Eh;\n Eh = Dh;\n Dh = rotl32(Ch, 10);\n Ch = Bh;\n Bh = T;\n }\n T = sum32_3(this.h[1], C, Dh);\n this.h[1] = sum32_3(this.h[2], D, Eh);\n this.h[2] = sum32_3(this.h[3], E, Ah);\n this.h[3] = sum32_3(this.h[4], A, Bh);\n this.h[4] = sum32_3(this.h[0], B, Ch);\n this.h[0] = T;\n};\n\nRIPEMD160.prototype._digest = function digest(enc) {\n if (enc === 'hex')\n return utils.toHex32(this.h, 'little');\n else\n return utils.split32(this.h, 'little');\n};\n\nfunction f(j, x, y, z) {\n if (j <= 15)\n return x ^ y ^ z;\n else if (j <= 31)\n return (x & y) | ((~x) & z);\n else if (j <= 47)\n return (x | (~y)) ^ z;\n else if (j <= 63)\n return (x & z) | (y & (~z));\n else\n return x ^ (y | (~z));\n}\n\nfunction K(j) {\n if (j <= 15)\n return 0x00000000;\n else if (j <= 31)\n return 0x5a827999;\n else if (j <= 47)\n return 0x6ed9eba1;\n else if (j <= 63)\n return 0x8f1bbcdc;\n else\n return 0xa953fd4e;\n}\n\nfunction Kh(j) {\n if (j <= 15)\n return 0x50a28be6;\n else if (j <= 31)\n return 0x5c4dd124;\n else if (j <= 47)\n return 0x6d703ef3;\n else if (j <= 63)\n return 0x7a6d76e9;\n else\n return 0x00000000;\n}\n\nvar r = [\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,\n 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,\n 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,\n 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13\n];\n\nvar rh = [\n 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,\n 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,\n 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,\n 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,\n 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11\n];\n\nvar s = [\n 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,\n 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,\n 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,\n 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,\n 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6\n];\n\nvar sh = [\n 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,\n 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,\n 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,\n 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,\n 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11\n];\n","'use strict';\n\nexports.sha1 = require('./sha/1');\nexports.sha224 = require('./sha/224');\nexports.sha256 = require('./sha/256');\nexports.sha384 = require('./sha/384');\nexports.sha512 = require('./sha/512');\n","'use strict';\n\nvar utils = require('../utils');\nvar common = require('../common');\nvar shaCommon = require('./common');\n\nvar rotl32 = utils.rotl32;\nvar sum32 = utils.sum32;\nvar sum32_5 = utils.sum32_5;\nvar ft_1 = shaCommon.ft_1;\nvar BlockHash = common.BlockHash;\n\nvar sha1_K = [\n 0x5A827999, 0x6ED9EBA1,\n 0x8F1BBCDC, 0xCA62C1D6\n];\n\nfunction SHA1() {\n if (!(this instanceof SHA1))\n return new SHA1();\n\n BlockHash.call(this);\n this.h = [\n 0x67452301, 0xefcdab89, 0x98badcfe,\n 0x10325476, 0xc3d2e1f0 ];\n this.W = new Array(80);\n}\n\nutils.inherits(SHA1, BlockHash);\nmodule.exports = SHA1;\n\nSHA1.blockSize = 512;\nSHA1.outSize = 160;\nSHA1.hmacStrength = 80;\nSHA1.padLength = 64;\n\nSHA1.prototype._update = function _update(msg, start) {\n var W = this.W;\n\n for (var i = 0; i < 16; i++)\n W[i] = msg[start + i];\n\n for(; i < W.length; i++)\n W[i] = rotl32(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1);\n\n var a = this.h[0];\n var b = this.h[1];\n var c = this.h[2];\n var d = this.h[3];\n var e = this.h[4];\n\n for (i = 0; i < W.length; i++) {\n var s = ~~(i / 20);\n var t = sum32_5(rotl32(a, 5), ft_1(s, b, c, d), e, W[i], sha1_K[s]);\n e = d;\n d = c;\n c = rotl32(b, 30);\n b = a;\n a = t;\n }\n\n this.h[0] = sum32(this.h[0], a);\n this.h[1] = sum32(this.h[1], b);\n this.h[2] = sum32(this.h[2], c);\n this.h[3] = sum32(this.h[3], d);\n this.h[4] = sum32(this.h[4], e);\n};\n\nSHA1.prototype._digest = function digest(enc) {\n if (enc === 'hex')\n return utils.toHex32(this.h, 'big');\n else\n return utils.split32(this.h, 'big');\n};\n","'use strict';\n\nvar utils = require('../utils');\nvar SHA256 = require('./256');\n\nfunction SHA224() {\n if (!(this instanceof SHA224))\n return new SHA224();\n\n SHA256.call(this);\n this.h = [\n 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939,\n 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 ];\n}\nutils.inherits(SHA224, SHA256);\nmodule.exports = SHA224;\n\nSHA224.blockSize = 512;\nSHA224.outSize = 224;\nSHA224.hmacStrength = 192;\nSHA224.padLength = 64;\n\nSHA224.prototype._digest = function digest(enc) {\n // Just truncate output\n if (enc === 'hex')\n return utils.toHex32(this.h.slice(0, 7), 'big');\n else\n return utils.split32(this.h.slice(0, 7), 'big');\n};\n\n","'use strict';\n\nvar utils = require('../utils');\nvar common = require('../common');\nvar shaCommon = require('./common');\nvar assert = require('minimalistic-assert');\n\nvar sum32 = utils.sum32;\nvar sum32_4 = utils.sum32_4;\nvar sum32_5 = utils.sum32_5;\nvar ch32 = shaCommon.ch32;\nvar maj32 = shaCommon.maj32;\nvar s0_256 = shaCommon.s0_256;\nvar s1_256 = shaCommon.s1_256;\nvar g0_256 = shaCommon.g0_256;\nvar g1_256 = shaCommon.g1_256;\n\nvar BlockHash = common.BlockHash;\n\nvar sha256_K = [\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,\n 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,\n 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,\n 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,\n 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,\n 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,\n 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,\n 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,\n 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n];\n\nfunction SHA256() {\n if (!(this instanceof SHA256))\n return new SHA256();\n\n BlockHash.call(this);\n this.h = [\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,\n 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19\n ];\n this.k = sha256_K;\n this.W = new Array(64);\n}\nutils.inherits(SHA256, BlockHash);\nmodule.exports = SHA256;\n\nSHA256.blockSize = 512;\nSHA256.outSize = 256;\nSHA256.hmacStrength = 192;\nSHA256.padLength = 64;\n\nSHA256.prototype._update = function _update(msg, start) {\n var W = this.W;\n\n for (var i = 0; i < 16; i++)\n W[i] = msg[start + i];\n for (; i < W.length; i++)\n W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]);\n\n var a = this.h[0];\n var b = this.h[1];\n var c = this.h[2];\n var d = this.h[3];\n var e = this.h[4];\n var f = this.h[5];\n var g = this.h[6];\n var h = this.h[7];\n\n assert(this.k.length === W.length);\n for (i = 0; i < W.length; i++) {\n var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]);\n var T2 = sum32(s0_256(a), maj32(a, b, c));\n h = g;\n g = f;\n f = e;\n e = sum32(d, T1);\n d = c;\n c = b;\n b = a;\n a = sum32(T1, T2);\n }\n\n this.h[0] = sum32(this.h[0], a);\n this.h[1] = sum32(this.h[1], b);\n this.h[2] = sum32(this.h[2], c);\n this.h[3] = sum32(this.h[3], d);\n this.h[4] = sum32(this.h[4], e);\n this.h[5] = sum32(this.h[5], f);\n this.h[6] = sum32(this.h[6], g);\n this.h[7] = sum32(this.h[7], h);\n};\n\nSHA256.prototype._digest = function digest(enc) {\n if (enc === 'hex')\n return utils.toHex32(this.h, 'big');\n else\n return utils.split32(this.h, 'big');\n};\n","'use strict';\n\nvar utils = require('../utils');\n\nvar SHA512 = require('./512');\n\nfunction SHA384() {\n if (!(this instanceof SHA384))\n return new SHA384();\n\n SHA512.call(this);\n this.h = [\n 0xcbbb9d5d, 0xc1059ed8,\n 0x629a292a, 0x367cd507,\n 0x9159015a, 0x3070dd17,\n 0x152fecd8, 0xf70e5939,\n 0x67332667, 0xffc00b31,\n 0x8eb44a87, 0x68581511,\n 0xdb0c2e0d, 0x64f98fa7,\n 0x47b5481d, 0xbefa4fa4 ];\n}\nutils.inherits(SHA384, SHA512);\nmodule.exports = SHA384;\n\nSHA384.blockSize = 1024;\nSHA384.outSize = 384;\nSHA384.hmacStrength = 192;\nSHA384.padLength = 128;\n\nSHA384.prototype._digest = function digest(enc) {\n if (enc === 'hex')\n return utils.toHex32(this.h.slice(0, 12), 'big');\n else\n return utils.split32(this.h.slice(0, 12), 'big');\n};\n","'use strict';\n\nvar utils = require('../utils');\nvar common = require('../common');\nvar assert = require('minimalistic-assert');\n\nvar rotr64_hi = utils.rotr64_hi;\nvar rotr64_lo = utils.rotr64_lo;\nvar shr64_hi = utils.shr64_hi;\nvar shr64_lo = utils.shr64_lo;\nvar sum64 = utils.sum64;\nvar sum64_hi = utils.sum64_hi;\nvar sum64_lo = utils.sum64_lo;\nvar sum64_4_hi = utils.sum64_4_hi;\nvar sum64_4_lo = utils.sum64_4_lo;\nvar sum64_5_hi = utils.sum64_5_hi;\nvar sum64_5_lo = utils.sum64_5_lo;\n\nvar BlockHash = common.BlockHash;\n\nvar sha512_K = [\n 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,\n 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,\n 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,\n 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,\n 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,\n 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,\n 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,\n 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,\n 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,\n 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,\n 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,\n 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,\n 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,\n 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,\n 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,\n 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,\n 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,\n 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,\n 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,\n 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,\n 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,\n 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,\n 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,\n 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,\n 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,\n 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,\n 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,\n 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,\n 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,\n 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,\n 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,\n 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,\n 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,\n 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,\n 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,\n 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,\n 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,\n 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,\n 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,\n 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817\n];\n\nfunction SHA512() {\n if (!(this instanceof SHA512))\n return new SHA512();\n\n BlockHash.call(this);\n this.h = [\n 0x6a09e667, 0xf3bcc908,\n 0xbb67ae85, 0x84caa73b,\n 0x3c6ef372, 0xfe94f82b,\n 0xa54ff53a, 0x5f1d36f1,\n 0x510e527f, 0xade682d1,\n 0x9b05688c, 0x2b3e6c1f,\n 0x1f83d9ab, 0xfb41bd6b,\n 0x5be0cd19, 0x137e2179 ];\n this.k = sha512_K;\n this.W = new Array(160);\n}\nutils.inherits(SHA512, BlockHash);\nmodule.exports = SHA512;\n\nSHA512.blockSize = 1024;\nSHA512.outSize = 512;\nSHA512.hmacStrength = 192;\nSHA512.padLength = 128;\n\nSHA512.prototype._prepareBlock = function _prepareBlock(msg, start) {\n var W = this.W;\n\n // 32 x 32bit words\n for (var i = 0; i < 32; i++)\n W[i] = msg[start + i];\n for (; i < W.length; i += 2) {\n var c0_hi = g1_512_hi(W[i - 4], W[i - 3]); // i - 2\n var c0_lo = g1_512_lo(W[i - 4], W[i - 3]);\n var c1_hi = W[i - 14]; // i - 7\n var c1_lo = W[i - 13];\n var c2_hi = g0_512_hi(W[i - 30], W[i - 29]); // i - 15\n var c2_lo = g0_512_lo(W[i - 30], W[i - 29]);\n var c3_hi = W[i - 32]; // i - 16\n var c3_lo = W[i - 31];\n\n W[i] = sum64_4_hi(\n c0_hi, c0_lo,\n c1_hi, c1_lo,\n c2_hi, c2_lo,\n c3_hi, c3_lo);\n W[i + 1] = sum64_4_lo(\n c0_hi, c0_lo,\n c1_hi, c1_lo,\n c2_hi, c2_lo,\n c3_hi, c3_lo);\n }\n};\n\nSHA512.prototype._update = function _update(msg, start) {\n this._prepareBlock(msg, start);\n\n var W = this.W;\n\n var ah = this.h[0];\n var al = this.h[1];\n var bh = this.h[2];\n var bl = this.h[3];\n var ch = this.h[4];\n var cl = this.h[5];\n var dh = this.h[6];\n var dl = this.h[7];\n var eh = this.h[8];\n var el = this.h[9];\n var fh = this.h[10];\n var fl = this.h[11];\n var gh = this.h[12];\n var gl = this.h[13];\n var hh = this.h[14];\n var hl = this.h[15];\n\n assert(this.k.length === W.length);\n for (var i = 0; i < W.length; i += 2) {\n var c0_hi = hh;\n var c0_lo = hl;\n var c1_hi = s1_512_hi(eh, el);\n var c1_lo = s1_512_lo(eh, el);\n var c2_hi = ch64_hi(eh, el, fh, fl, gh, gl);\n var c2_lo = ch64_lo(eh, el, fh, fl, gh, gl);\n var c3_hi = this.k[i];\n var c3_lo = this.k[i + 1];\n var c4_hi = W[i];\n var c4_lo = W[i + 1];\n\n var T1_hi = sum64_5_hi(\n c0_hi, c0_lo,\n c1_hi, c1_lo,\n c2_hi, c2_lo,\n c3_hi, c3_lo,\n c4_hi, c4_lo);\n var T1_lo = sum64_5_lo(\n c0_hi, c0_lo,\n c1_hi, c1_lo,\n c2_hi, c2_lo,\n c3_hi, c3_lo,\n c4_hi, c4_lo);\n\n c0_hi = s0_512_hi(ah, al);\n c0_lo = s0_512_lo(ah, al);\n c1_hi = maj64_hi(ah, al, bh, bl, ch, cl);\n c1_lo = maj64_lo(ah, al, bh, bl, ch, cl);\n\n var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo);\n var T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo);\n\n hh = gh;\n hl = gl;\n\n gh = fh;\n gl = fl;\n\n fh = eh;\n fl = el;\n\n eh = sum64_hi(dh, dl, T1_hi, T1_lo);\n el = sum64_lo(dl, dl, T1_hi, T1_lo);\n\n dh = ch;\n dl = cl;\n\n ch = bh;\n cl = bl;\n\n bh = ah;\n bl = al;\n\n ah = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo);\n al = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo);\n }\n\n sum64(this.h, 0, ah, al);\n sum64(this.h, 2, bh, bl);\n sum64(this.h, 4, ch, cl);\n sum64(this.h, 6, dh, dl);\n sum64(this.h, 8, eh, el);\n sum64(this.h, 10, fh, fl);\n sum64(this.h, 12, gh, gl);\n sum64(this.h, 14, hh, hl);\n};\n\nSHA512.prototype._digest = function digest(enc) {\n if (enc === 'hex')\n return utils.toHex32(this.h, 'big');\n else\n return utils.split32(this.h, 'big');\n};\n\nfunction ch64_hi(xh, xl, yh, yl, zh) {\n var r = (xh & yh) ^ ((~xh) & zh);\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction ch64_lo(xh, xl, yh, yl, zh, zl) {\n var r = (xl & yl) ^ ((~xl) & zl);\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction maj64_hi(xh, xl, yh, yl, zh) {\n var r = (xh & yh) ^ (xh & zh) ^ (yh & zh);\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction maj64_lo(xh, xl, yh, yl, zh, zl) {\n var r = (xl & yl) ^ (xl & zl) ^ (yl & zl);\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction s0_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 28);\n var c1_hi = rotr64_hi(xl, xh, 2); // 34\n var c2_hi = rotr64_hi(xl, xh, 7); // 39\n\n var r = c0_hi ^ c1_hi ^ c2_hi;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction s0_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 28);\n var c1_lo = rotr64_lo(xl, xh, 2); // 34\n var c2_lo = rotr64_lo(xl, xh, 7); // 39\n\n var r = c0_lo ^ c1_lo ^ c2_lo;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction s1_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 14);\n var c1_hi = rotr64_hi(xh, xl, 18);\n var c2_hi = rotr64_hi(xl, xh, 9); // 41\n\n var r = c0_hi ^ c1_hi ^ c2_hi;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction s1_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 14);\n var c1_lo = rotr64_lo(xh, xl, 18);\n var c2_lo = rotr64_lo(xl, xh, 9); // 41\n\n var r = c0_lo ^ c1_lo ^ c2_lo;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction g0_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 1);\n var c1_hi = rotr64_hi(xh, xl, 8);\n var c2_hi = shr64_hi(xh, xl, 7);\n\n var r = c0_hi ^ c1_hi ^ c2_hi;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction g0_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 1);\n var c1_lo = rotr64_lo(xh, xl, 8);\n var c2_lo = shr64_lo(xh, xl, 7);\n\n var r = c0_lo ^ c1_lo ^ c2_lo;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction g1_512_hi(xh, xl) {\n var c0_hi = rotr64_hi(xh, xl, 19);\n var c1_hi = rotr64_hi(xl, xh, 29); // 61\n var c2_hi = shr64_hi(xh, xl, 6);\n\n var r = c0_hi ^ c1_hi ^ c2_hi;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n\nfunction g1_512_lo(xh, xl) {\n var c0_lo = rotr64_lo(xh, xl, 19);\n var c1_lo = rotr64_lo(xl, xh, 29); // 61\n var c2_lo = shr64_lo(xh, xl, 6);\n\n var r = c0_lo ^ c1_lo ^ c2_lo;\n if (r < 0)\n r += 0x100000000;\n return r;\n}\n","'use strict';\n\nvar utils = require('../utils');\nvar rotr32 = utils.rotr32;\n\nfunction ft_1(s, x, y, z) {\n if (s === 0)\n return ch32(x, y, z);\n if (s === 1 || s === 3)\n return p32(x, y, z);\n if (s === 2)\n return maj32(x, y, z);\n}\nexports.ft_1 = ft_1;\n\nfunction ch32(x, y, z) {\n return (x & y) ^ ((~x) & z);\n}\nexports.ch32 = ch32;\n\nfunction maj32(x, y, z) {\n return (x & y) ^ (x & z) ^ (y & z);\n}\nexports.maj32 = maj32;\n\nfunction p32(x, y, z) {\n return x ^ y ^ z;\n}\nexports.p32 = p32;\n\nfunction s0_256(x) {\n return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22);\n}\nexports.s0_256 = s0_256;\n\nfunction s1_256(x) {\n return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25);\n}\nexports.s1_256 = s1_256;\n\nfunction g0_256(x) {\n return rotr32(x, 7) ^ rotr32(x, 18) ^ (x >>> 3);\n}\nexports.g0_256 = g0_256;\n\nfunction g1_256(x) {\n return rotr32(x, 17) ^ rotr32(x, 19) ^ (x >>> 10);\n}\nexports.g1_256 = g1_256;\n","'use strict';\n\nvar assert = require('minimalistic-assert');\nvar inherits = require('inherits');\n\nexports.inherits = inherits;\n\nfunction toArray(msg, enc) {\n if (Array.isArray(msg))\n return msg.slice();\n if (!msg)\n return [];\n var res = [];\n if (typeof msg === 'string') {\n if (!enc) {\n for (var i = 0; i < msg.length; i++) {\n var c = msg.charCodeAt(i);\n var hi = c >> 8;\n var lo = c & 0xff;\n if (hi)\n res.push(hi, lo);\n else\n res.push(lo);\n }\n } else if (enc === 'hex') {\n msg = msg.replace(/[^a-z0-9]+/ig, '');\n if (msg.length % 2 !== 0)\n msg = '0' + msg;\n for (i = 0; i < msg.length; i += 2)\n res.push(parseInt(msg[i] + msg[i + 1], 16));\n }\n } else {\n for (i = 0; i < msg.length; i++)\n res[i] = msg[i] | 0;\n }\n return res;\n}\nexports.toArray = toArray;\n\nfunction toHex(msg) {\n var res = '';\n for (var i = 0; i < msg.length; i++)\n res += zero2(msg[i].toString(16));\n return res;\n}\nexports.toHex = toHex;\n\nfunction htonl(w) {\n var res = (w >>> 24) |\n ((w >>> 8) & 0xff00) |\n ((w << 8) & 0xff0000) |\n ((w & 0xff) << 24);\n return res >>> 0;\n}\nexports.htonl = htonl;\n\nfunction toHex32(msg, endian) {\n var res = '';\n for (var i = 0; i < msg.length; i++) {\n var w = msg[i];\n if (endian === 'little')\n w = htonl(w);\n res += zero8(w.toString(16));\n }\n return res;\n}\nexports.toHex32 = toHex32;\n\nfunction zero2(word) {\n if (word.length === 1)\n return '0' + word;\n else\n return word;\n}\nexports.zero2 = zero2;\n\nfunction zero8(word) {\n if (word.length === 7)\n return '0' + word;\n else if (word.length === 6)\n return '00' + word;\n else if (word.length === 5)\n return '000' + word;\n else if (word.length === 4)\n return '0000' + word;\n else if (word.length === 3)\n return '00000' + word;\n else if (word.length === 2)\n return '000000' + word;\n else if (word.length === 1)\n return '0000000' + word;\n else\n return word;\n}\nexports.zero8 = zero8;\n\nfunction join32(msg, start, end, endian) {\n var len = end - start;\n assert(len % 4 === 0);\n var res = new Array(len / 4);\n for (var i = 0, k = start; i < res.length; i++, k += 4) {\n var w;\n if (endian === 'big')\n w = (msg[k] << 24) | (msg[k + 1] << 16) | (msg[k + 2] << 8) | msg[k + 3];\n else\n w = (msg[k + 3] << 24) | (msg[k + 2] << 16) | (msg[k + 1] << 8) | msg[k];\n res[i] = w >>> 0;\n }\n return res;\n}\nexports.join32 = join32;\n\nfunction split32(msg, endian) {\n var res = new Array(msg.length * 4);\n for (var i = 0, k = 0; i < msg.length; i++, k += 4) {\n var m = msg[i];\n if (endian === 'big') {\n res[k] = m >>> 24;\n res[k + 1] = (m >>> 16) & 0xff;\n res[k + 2] = (m >>> 8) & 0xff;\n res[k + 3] = m & 0xff;\n } else {\n res[k + 3] = m >>> 24;\n res[k + 2] = (m >>> 16) & 0xff;\n res[k + 1] = (m >>> 8) & 0xff;\n res[k] = m & 0xff;\n }\n }\n return res;\n}\nexports.split32 = split32;\n\nfunction rotr32(w, b) {\n return (w >>> b) | (w << (32 - b));\n}\nexports.rotr32 = rotr32;\n\nfunction rotl32(w, b) {\n return (w << b) | (w >>> (32 - b));\n}\nexports.rotl32 = rotl32;\n\nfunction sum32(a, b) {\n return (a + b) >>> 0;\n}\nexports.sum32 = sum32;\n\nfunction sum32_3(a, b, c) {\n return (a + b + c) >>> 0;\n}\nexports.sum32_3 = sum32_3;\n\nfunction sum32_4(a, b, c, d) {\n return (a + b + c + d) >>> 0;\n}\nexports.sum32_4 = sum32_4;\n\nfunction sum32_5(a, b, c, d, e) {\n return (a + b + c + d + e) >>> 0;\n}\nexports.sum32_5 = sum32_5;\n\nfunction sum64(buf, pos, ah, al) {\n var bh = buf[pos];\n var bl = buf[pos + 1];\n\n var lo = (al + bl) >>> 0;\n var hi = (lo < al ? 1 : 0) + ah + bh;\n buf[pos] = hi >>> 0;\n buf[pos + 1] = lo;\n}\nexports.sum64 = sum64;\n\nfunction sum64_hi(ah, al, bh, bl) {\n var lo = (al + bl) >>> 0;\n var hi = (lo < al ? 1 : 0) + ah + bh;\n return hi >>> 0;\n}\nexports.sum64_hi = sum64_hi;\n\nfunction sum64_lo(ah, al, bh, bl) {\n var lo = al + bl;\n return lo >>> 0;\n}\nexports.sum64_lo = sum64_lo;\n\nfunction sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) {\n var carry = 0;\n var lo = al;\n lo = (lo + bl) >>> 0;\n carry += lo < al ? 1 : 0;\n lo = (lo + cl) >>> 0;\n carry += lo < cl ? 1 : 0;\n lo = (lo + dl) >>> 0;\n carry += lo < dl ? 1 : 0;\n\n var hi = ah + bh + ch + dh + carry;\n return hi >>> 0;\n}\nexports.sum64_4_hi = sum64_4_hi;\n\nfunction sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) {\n var lo = al + bl + cl + dl;\n return lo >>> 0;\n}\nexports.sum64_4_lo = sum64_4_lo;\n\nfunction sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\n var carry = 0;\n var lo = al;\n lo = (lo + bl) >>> 0;\n carry += lo < al ? 1 : 0;\n lo = (lo + cl) >>> 0;\n carry += lo < cl ? 1 : 0;\n lo = (lo + dl) >>> 0;\n carry += lo < dl ? 1 : 0;\n lo = (lo + el) >>> 0;\n carry += lo < el ? 1 : 0;\n\n var hi = ah + bh + ch + dh + eh + carry;\n return hi >>> 0;\n}\nexports.sum64_5_hi = sum64_5_hi;\n\nfunction sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\n var lo = al + bl + cl + dl + el;\n\n return lo >>> 0;\n}\nexports.sum64_5_lo = sum64_5_lo;\n\nfunction rotr64_hi(ah, al, num) {\n var r = (al << (32 - num)) | (ah >>> num);\n return r >>> 0;\n}\nexports.rotr64_hi = rotr64_hi;\n\nfunction rotr64_lo(ah, al, num) {\n var r = (ah << (32 - num)) | (al >>> num);\n return r >>> 0;\n}\nexports.rotr64_lo = rotr64_lo;\n\nfunction shr64_hi(ah, al, num) {\n return ah >>> num;\n}\nexports.shr64_hi = shr64_hi;\n\nfunction shr64_lo(ah, al, num) {\n var r = (ah << (32 - num)) | (al >>> num);\n return r >>> 0;\n}\nexports.shr64_lo = shr64_lo;\n","'use strict';\n\nvar hash = require('hash.js');\nvar utils = require('minimalistic-crypto-utils');\nvar assert = require('minimalistic-assert');\n\nfunction HmacDRBG(options) {\n if (!(this instanceof HmacDRBG))\n return new HmacDRBG(options);\n this.hash = options.hash;\n this.predResist = !!options.predResist;\n\n this.outLen = this.hash.outSize;\n this.minEntropy = options.minEntropy || this.hash.hmacStrength;\n\n this._reseed = null;\n this.reseedInterval = null;\n this.K = null;\n this.V = null;\n\n var entropy = utils.toArray(options.entropy, options.entropyEnc || 'hex');\n var nonce = utils.toArray(options.nonce, options.nonceEnc || 'hex');\n var pers = utils.toArray(options.pers, options.persEnc || 'hex');\n assert(entropy.length >= (this.minEntropy / 8),\n 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits');\n this._init(entropy, nonce, pers);\n}\nmodule.exports = HmacDRBG;\n\nHmacDRBG.prototype._init = function init(entropy, nonce, pers) {\n var seed = entropy.concat(nonce).concat(pers);\n\n this.K = new Array(this.outLen / 8);\n this.V = new Array(this.outLen / 8);\n for (var i = 0; i < this.V.length; i++) {\n this.K[i] = 0x00;\n this.V[i] = 0x01;\n }\n\n this._update(seed);\n this._reseed = 1;\n this.reseedInterval = 0x1000000000000; // 2^48\n};\n\nHmacDRBG.prototype._hmac = function hmac() {\n return new hash.hmac(this.hash, this.K);\n};\n\nHmacDRBG.prototype._update = function update(seed) {\n var kmac = this._hmac()\n .update(this.V)\n .update([ 0x00 ]);\n if (seed)\n kmac = kmac.update(seed);\n this.K = kmac.digest();\n this.V = this._hmac().update(this.V).digest();\n if (!seed)\n return;\n\n this.K = this._hmac()\n .update(this.V)\n .update([ 0x01 ])\n .update(seed)\n .digest();\n this.V = this._hmac().update(this.V).digest();\n};\n\nHmacDRBG.prototype.reseed = function reseed(entropy, entropyEnc, add, addEnc) {\n // Optional entropy enc\n if (typeof entropyEnc !== 'string') {\n addEnc = add;\n add = entropyEnc;\n entropyEnc = null;\n }\n\n entropy = utils.toArray(entropy, entropyEnc);\n add = utils.toArray(add, addEnc);\n\n assert(entropy.length >= (this.minEntropy / 8),\n 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits');\n\n this._update(entropy.concat(add || []));\n this._reseed = 1;\n};\n\nHmacDRBG.prototype.generate = function generate(len, enc, add, addEnc) {\n if (this._reseed > this.reseedInterval)\n throw new Error('Reseed is required');\n\n // Optional encoding\n if (typeof enc !== 'string') {\n addEnc = add;\n add = enc;\n enc = null;\n }\n\n // Optional additional data\n if (add) {\n add = utils.toArray(add, addEnc || 'hex');\n this._update(add);\n }\n\n var temp = [];\n while (temp.length < len) {\n this.V = this._hmac().update(this.V).digest();\n temp = temp.concat(this.V);\n }\n\n var res = temp.slice(0, len);\n this._update(add);\n this._reseed++;\n return utils.encode(res, enc);\n};\n","/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global.hoistNonReactStatics = factory());\n}(this, (function () {\n 'use strict';\n \n var REACT_STATICS = {\n childContextTypes: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n };\n \n var KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n };\n \n var defineProperty = Object.defineProperty;\n var getOwnPropertyNames = Object.getOwnPropertyNames;\n var getOwnPropertySymbols = Object.getOwnPropertySymbols;\n var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n var getPrototypeOf = Object.getPrototypeOf;\n var objectPrototype = getPrototypeOf && getPrototypeOf(Object);\n \n return function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components\n \n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n \n var keys = getOwnPropertyNames(sourceComponent);\n \n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n \n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n if (!REACT_STATICS[key] && !KNOWN_STATICS[key] && (!blacklist || !blacklist[key])) {\n var descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n try { // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {}\n }\n }\n \n return targetComponent;\n }\n \n return targetComponent;\n };\n})));\n","'use strict';\n\nvar uppercasePattern = /[A-Z]/g;\nvar msPattern = /^ms-/;\nvar cache = {};\n\nfunction hyphenateStyleName(string) {\n return string in cache\n ? cache[string]\n : cache[string] = string\n .replace(uppercasePattern, '-$&')\n .toLowerCase()\n .replace(msPattern, '-ms-');\n}\n\nmodule.exports = hyphenateStyleName;\n","exports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = nBytes * 8 - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = nBytes * 8 - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","\nvar indexOf = [].indexOf;\n\nmodule.exports = function(arr, obj){\n if (indexOf) return arr.indexOf(obj);\n for (var i = 0; i < arr.length; ++i) {\n if (arr[i] === obj) return i;\n }\n return -1;\n};","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n}\n","module.exports = isFunction\n\nvar toString = Object.prototype.toString\n\nfunction isFunction (fn) {\n var string = toString.call(fn)\n return string === '[object Function]' ||\n (typeof fn === 'function' && string !== '[object RegExp]') ||\n (typeof window !== 'undefined' &&\n // IE8 and below\n (fn === window.setTimeout ||\n fn === window.alert ||\n fn === window.confirm ||\n fn === window.prompt))\n};\n","/**\n * Returns a `Boolean` on whether or not the a `String` starts with '0x'\n * @param {String} str the string input value\n * @return {Boolean} a boolean if it is or is not hex prefixed\n * @throws if the str input is not a string\n */\nmodule.exports = function isHexPrefixed(str) {\n if (typeof str !== 'string') {\n throw new Error(\"[is-hex-prefixed] value must be type 'string', is currently type \" + (typeof str) + \", while checking isHexPrefixed.\");\n }\n\n return str.slice(0, 2) === '0x';\n}\n","var _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nexport var isBrowser = (typeof window === \"undefined\" ? \"undefined\" : _typeof(window)) === \"object\" && (typeof document === \"undefined\" ? \"undefined\" : _typeof(document)) === 'object' && document.nodeType === 9;\n\nexport default isBrowser;\n","'use strict';\n\nvar traverse = module.exports = function (schema, opts, cb) {\n if (typeof opts == 'function') {\n cb = opts;\n opts = {};\n }\n _traverse(opts, cb, schema, '', schema);\n};\n\n\ntraverse.keywords = {\n additionalItems: true,\n items: true,\n contains: true,\n additionalProperties: true,\n propertyNames: true,\n not: true\n};\n\ntraverse.arrayKeywords = {\n items: true,\n allOf: true,\n anyOf: true,\n oneOf: true\n};\n\ntraverse.propsKeywords = {\n definitions: true,\n properties: true,\n patternProperties: true,\n dependencies: true\n};\n\ntraverse.skipKeywords = {\n enum: true,\n const: true,\n required: true,\n maximum: true,\n minimum: true,\n exclusiveMaximum: true,\n exclusiveMinimum: true,\n multipleOf: true,\n maxLength: true,\n minLength: true,\n pattern: true,\n format: true,\n maxItems: true,\n minItems: true,\n uniqueItems: true,\n maxProperties: true,\n minProperties: true\n};\n\n\nfunction _traverse(opts, cb, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {\n if (schema && typeof schema == 'object' && !Array.isArray(schema)) {\n cb(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);\n for (var key in schema) {\n var sch = schema[key];\n if (Array.isArray(sch)) {\n if (key in traverse.arrayKeywords) {\n for (var i=0; i 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var camelCasedOptions = addCamelCasedVersion(options);\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n for (var prop in style) {\n style[prop] = iterate(prop, style[prop], camelCasedOptions);\n }\n\n return style;\n }\n\n function onChangeValue(value, prop) {\n return iterate(prop, value, camelCasedOptions);\n }\n\n return { onProcessStyle: onProcessStyle, onChangeValue: onChangeValue };\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nexports['default'] = jssGlobal;\n\nvar _jss = require('jss');\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar propKey = '@global';\nvar prefixKey = '@global ';\n\nvar GlobalContainerRule = function () {\n function GlobalContainerRule(key, styles, options) {\n _classCallCheck(this, GlobalContainerRule);\n\n this.type = 'global';\n\n this.key = key;\n this.options = options;\n this.rules = new _jss.RuleList(_extends({}, options, {\n parent: this\n }));\n\n for (var selector in styles) {\n this.rules.add(selector, styles[selector], { selector: selector });\n }\n\n this.rules.process();\n }\n\n /**\n * Get a rule.\n */\n\n\n _createClass(GlobalContainerRule, [{\n key: 'getRule',\n value: function getRule(name) {\n return this.rules.get(name);\n }\n\n /**\n * Create and register rule, run plugins.\n */\n\n }, {\n key: 'addRule',\n value: function addRule(name, style, options) {\n var rule = this.rules.add(name, style, options);\n this.options.jss.plugins.onProcessRule(rule);\n return rule;\n }\n\n /**\n * Get index of a rule.\n */\n\n }, {\n key: 'indexOf',\n value: function indexOf(rule) {\n return this.rules.indexOf(rule);\n }\n\n /**\n * Generates a CSS string.\n */\n\n }, {\n key: 'toString',\n value: function toString() {\n return this.rules.toString();\n }\n }]);\n\n return GlobalContainerRule;\n}();\n\nvar GlobalPrefixedRule = function () {\n function GlobalPrefixedRule(name, style, options) {\n _classCallCheck(this, GlobalPrefixedRule);\n\n this.name = name;\n this.options = options;\n var selector = name.substr(prefixKey.length);\n this.rule = options.jss.createRule(selector, style, _extends({}, options, {\n parent: this,\n selector: selector\n }));\n }\n\n _createClass(GlobalPrefixedRule, [{\n key: 'toString',\n value: function toString(options) {\n return this.rule.toString(options);\n }\n }]);\n\n return GlobalPrefixedRule;\n}();\n\nvar separatorRegExp = /\\s*,\\s*/g;\n\nfunction addScope(selector, scope) {\n var parts = selector.split(separatorRegExp);\n var scoped = '';\n for (var i = 0; i < parts.length; i++) {\n scoped += scope + ' ' + parts[i].trim();\n if (parts[i + 1]) scoped += ', ';\n }\n return scoped;\n}\n\nfunction handleNestedGlobalContainerRule(rule) {\n var options = rule.options,\n style = rule.style;\n\n var rules = style[propKey];\n\n if (!rules) return;\n\n for (var name in rules) {\n options.sheet.addRule(name, rules[name], _extends({}, options, {\n selector: addScope(name, rule.selector)\n }));\n }\n\n delete style[propKey];\n}\n\nfunction handlePrefixedGlobalRule(rule) {\n var options = rule.options,\n style = rule.style;\n\n for (var prop in style) {\n if (prop.substr(0, propKey.length) !== propKey) continue;\n\n var selector = addScope(prop.substr(propKey.length), rule.selector);\n options.sheet.addRule(selector, style[prop], _extends({}, options, {\n selector: selector\n }));\n delete style[prop];\n }\n}\n\n/**\n * Convert nested rules to separate, remove them from original styles.\n *\n * @param {Rule} rule\n * @api public\n */\nfunction jssGlobal() {\n function onCreateRule(name, styles, options) {\n if (name === propKey) {\n return new GlobalContainerRule(name, styles, options);\n }\n\n if (name[0] === '@' && name.substr(0, prefixKey.length) === prefixKey) {\n return new GlobalPrefixedRule(name, styles, options);\n }\n\n var parent = options.parent;\n\n\n if (parent) {\n if (parent.type === 'global' || parent.options.parent.type === 'global') {\n options.global = true;\n }\n }\n\n if (options.global) options.selector = name;\n\n return null;\n }\n\n function onProcessRule(rule) {\n if (rule.type !== 'style') return;\n\n handleNestedGlobalContainerRule(rule);\n handlePrefixedGlobalRule(rule);\n }\n\n return { onCreateRule: onCreateRule, onProcessRule: onProcessRule };\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nexports.default = jssNested;\n\nvar _warning = require('warning');\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar separatorRegExp = /\\s*,\\s*/g;\nvar parentRegExp = /&/g;\nvar refRegExp = /\\$([\\w-]+)/g;\n\n/**\n * Convert nested rules to separate, remove them from original styles.\n *\n * @param {Rule} rule\n * @api public\n */\nfunction jssNested() {\n // Get a function to be used for $ref replacement.\n function getReplaceRef(container) {\n return function (match, key) {\n var rule = container.getRule(key);\n if (rule) return rule.selector;\n (0, _warning2.default)(false, '[JSS] Could not find the referenced rule %s in %s.', key, container.options.meta || container);\n return key;\n };\n }\n\n var hasAnd = function hasAnd(str) {\n return str.indexOf('&') !== -1;\n };\n\n function replaceParentRefs(nestedProp, parentProp) {\n var parentSelectors = parentProp.split(separatorRegExp);\n var nestedSelectors = nestedProp.split(separatorRegExp);\n\n var result = '';\n\n for (var i = 0; i < parentSelectors.length; i++) {\n var parent = parentSelectors[i];\n\n for (var j = 0; j < nestedSelectors.length; j++) {\n var nested = nestedSelectors[j];\n if (result) result += ', ';\n // Replace all & by the parent or prefix & with the parent.\n result += hasAnd(nested) ? nested.replace(parentRegExp, parent) : parent + ' ' + nested;\n }\n }\n\n return result;\n }\n\n function getOptions(rule, container, options) {\n // Options has been already created, now we only increase index.\n if (options) return _extends({}, options, { index: options.index + 1 });\n\n var nestingLevel = rule.options.nestingLevel;\n\n nestingLevel = nestingLevel === undefined ? 1 : nestingLevel + 1;\n\n return _extends({}, rule.options, {\n nestingLevel: nestingLevel,\n index: container.indexOf(rule) + 1\n });\n }\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n var container = rule.options.parent;\n var options = void 0;\n var replaceRef = void 0;\n for (var prop in style) {\n var isNested = hasAnd(prop);\n var isNestedConditional = prop[0] === '@';\n\n if (!isNested && !isNestedConditional) continue;\n\n options = getOptions(rule, container, options);\n\n if (isNested) {\n var selector = replaceParentRefs(prop, rule.selector\n // Lazily create the ref replacer function just once for\n // all nested rules within the sheet.\n );if (!replaceRef) replaceRef = getReplaceRef(container\n // Replace all $refs.\n );selector = selector.replace(refRegExp, replaceRef);\n\n container.addRule(selector, style[prop], _extends({}, options, { selector: selector }));\n } else if (isNestedConditional) {\n container\n // Place conditional right after the parent rule to ensure right ordering.\n .addRule(prop, null, options).addRule(rule.key, style[prop], { selector: rule.selector });\n }\n\n delete style[prop];\n }\n\n return style;\n }\n\n return { onProcessStyle: onProcessStyle };\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports['default'] = jssPropsSort;\n/**\n * Sort props by length.\n */\nfunction jssPropsSort() {\n function sort(prop0, prop1) {\n return prop0.length - prop1.length;\n }\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n var newStyle = {};\n var props = Object.keys(style).sort(sort);\n for (var prop in props) {\n newStyle[props[prop]] = style[props[prop]];\n }\n return newStyle;\n }\n\n return { onProcessStyle: onProcessStyle };\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports['default'] = jssVendorPrefixer;\n\nvar _cssVendor = require('css-vendor');\n\nvar vendor = _interopRequireWildcard(_cssVendor);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }\n\n/**\n * Add vendor prefix to a property name when needed.\n *\n * @param {Rule} rule\n * @api public\n */\nfunction jssVendorPrefixer() {\n function onProcessRule(rule) {\n if (rule.type === 'keyframes') {\n rule.key = '@' + vendor.prefix.css + rule.key.substr(1);\n }\n }\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n for (var prop in style) {\n var value = style[prop];\n\n var changeProp = false;\n var supportedProp = vendor.supportedProperty(prop);\n if (supportedProp && supportedProp !== prop) changeProp = true;\n\n var changeValue = false;\n var supportedValue = vendor.supportedValue(supportedProp, value);\n if (supportedValue && supportedValue !== value) changeValue = true;\n\n if (changeProp || changeValue) {\n if (changeProp) delete style[prop];\n style[supportedProp || prop] = supportedValue || value;\n }\n }\n\n return style;\n }\n\n function onChangeValue(value, prop) {\n return vendor.supportedValue(prop, value);\n }\n\n return { onProcessRule: onProcessRule, onProcessStyle: onProcessStyle, onChangeValue: onChangeValue };\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _isInBrowser = require('is-in-browser');\n\nvar _isInBrowser2 = _interopRequireDefault(_isInBrowser);\n\nvar _StyleSheet = require('./StyleSheet');\n\nvar _StyleSheet2 = _interopRequireDefault(_StyleSheet);\n\nvar _PluginsRegistry = require('./PluginsRegistry');\n\nvar _PluginsRegistry2 = _interopRequireDefault(_PluginsRegistry);\n\nvar _rules = require('./plugins/rules');\n\nvar _rules2 = _interopRequireDefault(_rules);\n\nvar _observables = require('./plugins/observables');\n\nvar _observables2 = _interopRequireDefault(_observables);\n\nvar _functions = require('./plugins/functions');\n\nvar _functions2 = _interopRequireDefault(_functions);\n\nvar _sheets = require('./sheets');\n\nvar _sheets2 = _interopRequireDefault(_sheets);\n\nvar _StyleRule = require('./rules/StyleRule');\n\nvar _StyleRule2 = _interopRequireDefault(_StyleRule);\n\nvar _createGenerateClassName = require('./utils/createGenerateClassName');\n\nvar _createGenerateClassName2 = _interopRequireDefault(_createGenerateClassName);\n\nvar _createRule2 = require('./utils/createRule');\n\nvar _createRule3 = _interopRequireDefault(_createRule2);\n\nvar _DomRenderer = require('./renderers/DomRenderer');\n\nvar _DomRenderer2 = _interopRequireDefault(_DomRenderer);\n\nvar _VirtualRenderer = require('./renderers/VirtualRenderer');\n\nvar _VirtualRenderer2 = _interopRequireDefault(_VirtualRenderer);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar defaultPlugins = _rules2['default'].concat([_observables2['default'], _functions2['default']]);\n\nvar instanceCounter = 0;\n\nvar Jss = function () {\n function Jss(options) {\n _classCallCheck(this, Jss);\n\n this.id = instanceCounter++;\n this.version = \"9.8.0\";\n this.plugins = new _PluginsRegistry2['default']();\n this.options = {\n createGenerateClassName: _createGenerateClassName2['default'],\n Renderer: _isInBrowser2['default'] ? _DomRenderer2['default'] : _VirtualRenderer2['default'],\n plugins: []\n };\n this.generateClassName = (0, _createGenerateClassName2['default'])();\n\n // eslint-disable-next-line prefer-spread\n this.use.apply(this, defaultPlugins);\n this.setup(options);\n }\n\n _createClass(Jss, [{\n key: 'setup',\n value: function setup() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n if (options.createGenerateClassName) {\n this.options.createGenerateClassName = options.createGenerateClassName;\n // $FlowFixMe\n this.generateClassName = options.createGenerateClassName();\n }\n\n if (options.insertionPoint != null) this.options.insertionPoint = options.insertionPoint;\n if (options.virtual || options.Renderer) {\n this.options.Renderer = options.Renderer || (options.virtual ? _VirtualRenderer2['default'] : _DomRenderer2['default']);\n }\n\n // eslint-disable-next-line prefer-spread\n if (options.plugins) this.use.apply(this, options.plugins);\n\n return this;\n }\n\n /**\n * Create a Style Sheet.\n */\n\n }, {\n key: 'createStyleSheet',\n value: function createStyleSheet(styles) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var index = options.index;\n if (typeof index !== 'number') {\n index = _sheets2['default'].index === 0 ? 0 : _sheets2['default'].index + 1;\n }\n var sheet = new _StyleSheet2['default'](styles, _extends({}, options, {\n jss: this,\n generateClassName: options.generateClassName || this.generateClassName,\n insertionPoint: this.options.insertionPoint,\n Renderer: this.options.Renderer,\n index: index\n }));\n this.plugins.onProcessSheet(sheet);\n\n return sheet;\n }\n\n /**\n * Detach the Style Sheet and remove it from the registry.\n */\n\n }, {\n key: 'removeStyleSheet',\n value: function removeStyleSheet(sheet) {\n sheet.detach();\n _sheets2['default'].remove(sheet);\n return this;\n }\n\n /**\n * Create a rule without a Style Sheet.\n */\n\n }, {\n key: 'createRule',\n value: function createRule(name) {\n var style = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n // Enable rule without name for inline styles.\n if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') {\n options = style;\n style = name;\n name = undefined;\n }\n\n // Cast from RuleFactoryOptions to RuleOptions\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var ruleOptions = options;\n\n ruleOptions.jss = this;\n ruleOptions.Renderer = this.options.Renderer;\n if (!ruleOptions.generateClassName) ruleOptions.generateClassName = this.generateClassName;\n if (!ruleOptions.classes) ruleOptions.classes = {};\n var rule = (0, _createRule3['default'])(name, style, ruleOptions);\n\n if (!ruleOptions.selector && rule instanceof _StyleRule2['default']) {\n rule.selector = '.' + ruleOptions.generateClassName(rule);\n }\n\n this.plugins.onProcessRule(rule);\n\n return rule;\n }\n\n /**\n * Register plugin. Passed function will be invoked with a rule instance.\n */\n\n }, {\n key: 'use',\n value: function use() {\n var _this = this;\n\n for (var _len = arguments.length, plugins = Array(_len), _key = 0; _key < _len; _key++) {\n plugins[_key] = arguments[_key];\n }\n\n plugins.forEach(function (plugin) {\n // Avoids applying same plugin twice, at least based on ref.\n if (_this.options.plugins.indexOf(plugin) === -1) {\n _this.options.plugins.push(plugin);\n _this.plugins.use(plugin);\n }\n });\n\n return this;\n }\n }]);\n\n return Jss;\n}();\n\nexports['default'] = Jss;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _warning = require('warning');\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar PluginsRegistry = function () {\n function PluginsRegistry() {\n _classCallCheck(this, PluginsRegistry);\n\n this.hooks = {\n onCreateRule: [],\n onProcessRule: [],\n onProcessStyle: [],\n onProcessSheet: [],\n onChangeValue: [],\n onUpdate: []\n\n /**\n * Call `onCreateRule` hooks and return an object if returned by a hook.\n */\n };\n }\n\n _createClass(PluginsRegistry, [{\n key: 'onCreateRule',\n value: function onCreateRule(name, decl, options) {\n for (var i = 0; i < this.hooks.onCreateRule.length; i++) {\n var rule = this.hooks.onCreateRule[i](name, decl, options);\n if (rule) return rule;\n }\n return null;\n }\n\n /**\n * Call `onProcessRule` hooks.\n */\n\n }, {\n key: 'onProcessRule',\n value: function onProcessRule(rule) {\n if (rule.isProcessed) return;\n var sheet = rule.options.sheet;\n\n for (var i = 0; i < this.hooks.onProcessRule.length; i++) {\n this.hooks.onProcessRule[i](rule, sheet);\n }\n\n // $FlowFixMe\n if (rule.style) this.onProcessStyle(rule.style, rule, sheet);\n\n rule.isProcessed = true;\n }\n\n /**\n * Call `onProcessStyle` hooks.\n */\n\n }, {\n key: 'onProcessStyle',\n value: function onProcessStyle(style, rule, sheet) {\n var nextStyle = style;\n\n for (var i = 0; i < this.hooks.onProcessStyle.length; i++) {\n nextStyle = this.hooks.onProcessStyle[i](nextStyle, rule, sheet);\n // $FlowFixMe\n rule.style = nextStyle;\n }\n }\n\n /**\n * Call `onProcessSheet` hooks.\n */\n\n }, {\n key: 'onProcessSheet',\n value: function onProcessSheet(sheet) {\n for (var i = 0; i < this.hooks.onProcessSheet.length; i++) {\n this.hooks.onProcessSheet[i](sheet);\n }\n }\n\n /**\n * Call `onUpdate` hooks.\n */\n\n }, {\n key: 'onUpdate',\n value: function onUpdate(data, rule, sheet) {\n for (var i = 0; i < this.hooks.onUpdate.length; i++) {\n this.hooks.onUpdate[i](data, rule, sheet);\n }\n }\n\n /**\n * Call `onChangeValue` hooks.\n */\n\n }, {\n key: 'onChangeValue',\n value: function onChangeValue(value, prop, rule) {\n var processedValue = value;\n for (var i = 0; i < this.hooks.onChangeValue.length; i++) {\n processedValue = this.hooks.onChangeValue[i](processedValue, prop, rule);\n }\n return processedValue;\n }\n\n /**\n * Register a plugin.\n * If function is passed, it is a shortcut for `{onProcessRule}`.\n */\n\n }, {\n key: 'use',\n value: function use(plugin) {\n for (var name in plugin) {\n if (this.hooks[name]) this.hooks[name].push(plugin[name]);else (0, _warning2['default'])(false, '[JSS] Unknown hook \"%s\".', name);\n }\n }\n }]);\n\n return PluginsRegistry;\n}();\n\nexports['default'] = PluginsRegistry;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _createRule = require('./utils/createRule');\n\nvar _createRule2 = _interopRequireDefault(_createRule);\n\nvar _linkRule = require('./utils/linkRule');\n\nvar _linkRule2 = _interopRequireDefault(_linkRule);\n\nvar _StyleRule = require('./rules/StyleRule');\n\nvar _StyleRule2 = _interopRequireDefault(_StyleRule);\n\nvar _escape = require('./utils/escape');\n\nvar _escape2 = _interopRequireDefault(_escape);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Contains rules objects and allows adding/removing etc.\n * Is used for e.g. by `StyleSheet` or `ConditionalRule`.\n */\nvar RuleList = function () {\n\n // Original styles object.\n function RuleList(options) {\n _classCallCheck(this, RuleList);\n\n this.map = {};\n this.raw = {};\n this.index = [];\n\n this.options = options;\n this.classes = options.classes;\n }\n\n /**\n * Create and register rule.\n *\n * Will not render after Style Sheet was rendered the first time.\n */\n\n\n // Used to ensure correct rules order.\n\n // Rules registry for access by .get() method.\n // It contains the same rule registered by name and by selector.\n\n\n _createClass(RuleList, [{\n key: 'add',\n value: function add(name, decl, options) {\n var _options = this.options,\n parent = _options.parent,\n sheet = _options.sheet,\n jss = _options.jss,\n Renderer = _options.Renderer,\n generateClassName = _options.generateClassName;\n\n\n options = _extends({\n classes: this.classes,\n parent: parent,\n sheet: sheet,\n jss: jss,\n Renderer: Renderer,\n generateClassName: generateClassName\n }, options);\n\n if (!options.selector && this.classes[name]) {\n options.selector = '.' + (0, _escape2['default'])(this.classes[name]);\n }\n\n this.raw[name] = decl;\n\n var rule = (0, _createRule2['default'])(name, decl, options);\n\n var className = void 0;\n\n if (!options.selector && rule instanceof _StyleRule2['default']) {\n className = generateClassName(rule, sheet);\n rule.selector = '.' + (0, _escape2['default'])(className);\n }\n\n this.register(rule, className);\n\n var index = options.index === undefined ? this.index.length : options.index;\n this.index.splice(index, 0, rule);\n\n return rule;\n }\n\n /**\n * Get a rule.\n */\n\n }, {\n key: 'get',\n value: function get(name) {\n return this.map[name];\n }\n\n /**\n * Delete a rule.\n */\n\n }, {\n key: 'remove',\n value: function remove(rule) {\n this.unregister(rule);\n this.index.splice(this.indexOf(rule), 1);\n }\n\n /**\n * Get index of a rule.\n */\n\n }, {\n key: 'indexOf',\n value: function indexOf(rule) {\n return this.index.indexOf(rule);\n }\n\n /**\n * Run `onProcessRule()` plugins on every rule.\n */\n\n }, {\n key: 'process',\n value: function process() {\n var plugins = this.options.jss.plugins;\n // We need to clone array because if we modify the index somewhere else during a loop\n // we end up with very hard-to-track-down side effects.\n\n this.index.slice(0).forEach(plugins.onProcessRule, plugins);\n }\n\n /**\n * Register a rule in `.map` and `.classes` maps.\n */\n\n }, {\n key: 'register',\n value: function register(rule, className) {\n this.map[rule.key] = rule;\n if (rule instanceof _StyleRule2['default']) {\n this.map[rule.selector] = rule;\n if (className) this.classes[rule.key] = className;\n }\n }\n\n /**\n * Unregister a rule.\n */\n\n }, {\n key: 'unregister',\n value: function unregister(rule) {\n delete this.map[rule.key];\n if (rule instanceof _StyleRule2['default']) {\n delete this.map[rule.selector];\n delete this.classes[rule.key];\n }\n }\n\n /**\n * Update the function values with a new data.\n */\n\n }, {\n key: 'update',\n value: function update(name, data) {\n var _options2 = this.options,\n plugins = _options2.jss.plugins,\n sheet = _options2.sheet;\n\n if (typeof name === 'string') {\n plugins.onUpdate(data, this.get(name), sheet);\n return;\n }\n\n for (var index = 0; index < this.index.length; index++) {\n plugins.onUpdate(name, this.index[index], sheet);\n }\n }\n\n /**\n * Link renderable rules with CSSRuleList.\n */\n\n }, {\n key: 'link',\n value: function link(cssRules) {\n var map = this.options.sheet.renderer.getUnescapedKeysMap(this.index);\n\n for (var i = 0; i < cssRules.length; i++) {\n var cssRule = cssRules[i];\n var _key = this.options.sheet.renderer.getKey(cssRule);\n if (map[_key]) _key = map[_key];\n var rule = this.map[_key];\n if (rule) (0, _linkRule2['default'])(rule, cssRule);\n }\n }\n\n /**\n * Convert rules to a CSS string.\n */\n\n }, {\n key: 'toString',\n value: function toString(options) {\n var str = '';\n var sheet = this.options.sheet;\n\n var link = sheet ? sheet.options.link : false;\n\n for (var index = 0; index < this.index.length; index++) {\n var rule = this.index[index];\n var css = rule.toString(options);\n\n // No need to render an empty rule.\n if (!css && !link) continue;\n\n if (str) str += '\\n';\n str += css;\n }\n\n return str;\n }\n }]);\n\n return RuleList;\n}();\n\nexports['default'] = RuleList;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _warning = require('warning');\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * SheetsManager is like a WeakMap which is designed to count StyleSheet\n * instances and attach/detach automatically.\n */\nvar SheetsManager = function () {\n function SheetsManager() {\n _classCallCheck(this, SheetsManager);\n\n this.sheets = [];\n this.refs = [];\n this.keys = [];\n }\n\n _createClass(SheetsManager, [{\n key: 'get',\n value: function get(key) {\n var index = this.keys.indexOf(key);\n return this.sheets[index];\n }\n }, {\n key: 'add',\n value: function add(key, sheet) {\n var sheets = this.sheets,\n refs = this.refs,\n keys = this.keys;\n\n var index = sheets.indexOf(sheet);\n\n if (index !== -1) return index;\n\n sheets.push(sheet);\n refs.push(0);\n keys.push(key);\n\n return sheets.length - 1;\n }\n }, {\n key: 'manage',\n value: function manage(key) {\n var index = this.keys.indexOf(key);\n var sheet = this.sheets[index];\n if (this.refs[index] === 0) sheet.attach();\n this.refs[index]++;\n if (!this.keys[index]) this.keys.splice(index, 0, key);\n return sheet;\n }\n }, {\n key: 'unmanage',\n value: function unmanage(key) {\n var index = this.keys.indexOf(key);\n if (index === -1) {\n // eslint-ignore-next-line no-console\n (0, _warning2['default'])(false, \"SheetsManager: can't find sheet to unmanage\");\n return;\n }\n if (this.refs[index] > 0) {\n this.refs[index]--;\n if (this.refs[index] === 0) this.sheets[index].detach();\n }\n }\n }, {\n key: 'size',\n get: function get() {\n return this.keys.length;\n }\n }]);\n\n return SheetsManager;\n}();\n\nexports['default'] = SheetsManager;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Sheets registry to access them all at one place.\n */\nvar SheetsRegistry = function () {\n function SheetsRegistry() {\n _classCallCheck(this, SheetsRegistry);\n\n this.registry = [];\n }\n\n _createClass(SheetsRegistry, [{\n key: 'add',\n\n\n /**\n * Register a Style Sheet.\n */\n value: function add(sheet) {\n var registry = this.registry;\n var index = sheet.options.index;\n\n\n if (registry.indexOf(sheet) !== -1) return;\n\n if (registry.length === 0 || index >= this.index) {\n registry.push(sheet);\n return;\n }\n\n // Find a position.\n for (var i = 0; i < registry.length; i++) {\n if (registry[i].options.index > index) {\n registry.splice(i, 0, sheet);\n return;\n }\n }\n }\n\n /**\n * Reset the registry.\n */\n\n }, {\n key: 'reset',\n value: function reset() {\n this.registry = [];\n }\n\n /**\n * Remove a Style Sheet.\n */\n\n }, {\n key: 'remove',\n value: function remove(sheet) {\n var index = this.registry.indexOf(sheet);\n this.registry.splice(index, 1);\n }\n\n /**\n * Convert all attached sheets to a CSS string.\n */\n\n }, {\n key: 'toString',\n value: function toString(options) {\n return this.registry.filter(function (sheet) {\n return sheet.attached;\n }).map(function (sheet) {\n return sheet.toString(options);\n }).join('\\n');\n }\n }, {\n key: 'index',\n\n\n /**\n * Current highest index number.\n */\n get: function get() {\n return this.registry.length === 0 ? 0 : this.registry[this.registry.length - 1].options.index;\n }\n }]);\n\n return SheetsRegistry;\n}();\n\nexports['default'] = SheetsRegistry;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _linkRule = require('./utils/linkRule');\n\nvar _linkRule2 = _interopRequireDefault(_linkRule);\n\nvar _RuleList = require('./RuleList');\n\nvar _RuleList2 = _interopRequireDefault(_RuleList);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar StyleSheet = function () {\n function StyleSheet(styles, options) {\n _classCallCheck(this, StyleSheet);\n\n this.attached = false;\n this.deployed = false;\n this.linked = false;\n this.classes = {};\n this.options = _extends({}, options, {\n sheet: this,\n parent: this,\n classes: this.classes\n });\n this.renderer = new options.Renderer(this);\n this.rules = new _RuleList2['default'](this.options);\n\n for (var name in styles) {\n this.rules.add(name, styles[name]);\n }\n\n this.rules.process();\n }\n\n /**\n * Attach renderable to the render tree.\n */\n\n\n _createClass(StyleSheet, [{\n key: 'attach',\n value: function attach() {\n if (this.attached) return this;\n if (!this.deployed) this.deploy();\n this.renderer.attach();\n if (!this.linked && this.options.link) this.link();\n this.attached = true;\n return this;\n }\n\n /**\n * Remove renderable from render tree.\n */\n\n }, {\n key: 'detach',\n value: function detach() {\n if (!this.attached) return this;\n this.renderer.detach();\n this.attached = false;\n return this;\n }\n\n /**\n * Add a rule to the current stylesheet.\n * Will insert a rule also after the stylesheet has been rendered first time.\n */\n\n }, {\n key: 'addRule',\n value: function addRule(name, decl, options) {\n var queue = this.queue;\n\n // Plugins can create rules.\n // In order to preserve the right order, we need to queue all `.addRule` calls,\n // which happen after the first `rules.add()` call.\n\n if (this.attached && !queue) this.queue = [];\n\n var rule = this.rules.add(name, decl, options);\n this.options.jss.plugins.onProcessRule(rule);\n\n if (this.attached) {\n if (!this.deployed) return rule;\n // Don't insert rule directly if there is no stringified version yet.\n // It will be inserted all together when .attach is called.\n if (queue) queue.push(rule);else {\n this.insertRule(rule);\n if (this.queue) {\n this.queue.forEach(this.insertRule, this);\n this.queue = undefined;\n }\n }\n return rule;\n }\n\n // We can't add rules to a detached style node.\n // We will redeploy the sheet once user will attach it.\n this.deployed = false;\n\n return rule;\n }\n\n /**\n * Insert rule into the StyleSheet\n */\n\n }, {\n key: 'insertRule',\n value: function insertRule(rule) {\n var renderable = this.renderer.insertRule(rule);\n if (renderable && this.options.link) (0, _linkRule2['default'])(rule, renderable);\n }\n\n /**\n * Create and add rules.\n * Will render also after Style Sheet was rendered the first time.\n */\n\n }, {\n key: 'addRules',\n value: function addRules(styles, options) {\n var added = [];\n for (var name in styles) {\n added.push(this.addRule(name, styles[name], options));\n }\n return added;\n }\n\n /**\n * Get a rule by name.\n */\n\n }, {\n key: 'getRule',\n value: function getRule(name) {\n return this.rules.get(name);\n }\n\n /**\n * Delete a rule by name.\n * Returns `true`: if rule has been deleted from the DOM.\n */\n\n }, {\n key: 'deleteRule',\n value: function deleteRule(name) {\n var rule = this.rules.get(name);\n\n if (!rule) return false;\n\n this.rules.remove(rule);\n\n if (this.attached && rule.renderable) {\n return this.renderer.deleteRule(rule.renderable);\n }\n\n return true;\n }\n\n /**\n * Get index of a rule.\n */\n\n }, {\n key: 'indexOf',\n value: function indexOf(rule) {\n return this.rules.indexOf(rule);\n }\n\n /**\n * Deploy pure CSS string to a renderable.\n */\n\n }, {\n key: 'deploy',\n value: function deploy() {\n this.renderer.deploy();\n this.deployed = true;\n return this;\n }\n\n /**\n * Link renderable CSS rules from sheet with their corresponding models.\n */\n\n }, {\n key: 'link',\n value: function link() {\n var cssRules = this.renderer.getRules();\n\n // Is undefined when VirtualRenderer is used.\n if (cssRules) this.rules.link(cssRules);\n this.linked = true;\n return this;\n }\n\n /**\n * Update the function values with a new data.\n */\n\n }, {\n key: 'update',\n value: function update(name, data) {\n this.rules.update(name, data);\n return this;\n }\n\n /**\n * Convert rules to a CSS string.\n */\n\n }, {\n key: 'toString',\n value: function toString(options) {\n return this.rules.toString(options);\n }\n }]);\n\n return StyleSheet;\n}();\n\nexports['default'] = StyleSheet;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.create = exports.createGenerateClassName = exports.sheets = exports.RuleList = exports.SheetsManager = exports.SheetsRegistry = exports.toCssValue = exports.getDynamicStyles = undefined;\n\nvar _getDynamicStyles = require('./utils/getDynamicStyles');\n\nObject.defineProperty(exports, 'getDynamicStyles', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_getDynamicStyles)['default'];\n }\n});\n\nvar _toCssValue = require('./utils/toCssValue');\n\nObject.defineProperty(exports, 'toCssValue', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_toCssValue)['default'];\n }\n});\n\nvar _SheetsRegistry = require('./SheetsRegistry');\n\nObject.defineProperty(exports, 'SheetsRegistry', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_SheetsRegistry)['default'];\n }\n});\n\nvar _SheetsManager = require('./SheetsManager');\n\nObject.defineProperty(exports, 'SheetsManager', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_SheetsManager)['default'];\n }\n});\n\nvar _RuleList = require('./RuleList');\n\nObject.defineProperty(exports, 'RuleList', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_RuleList)['default'];\n }\n});\n\nvar _sheets = require('./sheets');\n\nObject.defineProperty(exports, 'sheets', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_sheets)['default'];\n }\n});\n\nvar _createGenerateClassName = require('./utils/createGenerateClassName');\n\nObject.defineProperty(exports, 'createGenerateClassName', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_createGenerateClassName)['default'];\n }\n});\n\nvar _Jss = require('./Jss');\n\nvar _Jss2 = _interopRequireDefault(_Jss);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\n/**\n * Creates a new instance of Jss.\n */\nvar create = exports.create = function create(options) {\n return new _Jss2['default'](options);\n};\n\n/**\n * A global Jss instance.\n */\nexports['default'] = create();","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _RuleList = require('../RuleList');\n\nvar _RuleList2 = _interopRequireDefault(_RuleList);\n\nvar _StyleRule = require('../rules/StyleRule');\n\nvar _StyleRule2 = _interopRequireDefault(_StyleRule);\n\nvar _createRule = require('../utils/createRule');\n\nvar _createRule2 = _interopRequireDefault(_createRule);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\n// A symbol replacement.\nvar now = Date.now();\n\nvar fnValuesNs = 'fnValues' + now;\nvar fnStyleNs = 'fnStyle' + ++now;\n\nexports['default'] = {\n onCreateRule: function onCreateRule(name, decl, options) {\n if (typeof decl !== 'function') return null;\n var rule = (0, _createRule2['default'])(name, {}, options);\n rule[fnStyleNs] = decl;\n return rule;\n },\n onProcessStyle: function onProcessStyle(style, rule) {\n var fn = {};\n for (var prop in style) {\n var value = style[prop];\n if (typeof value !== 'function') continue;\n delete style[prop];\n fn[prop] = value;\n }\n rule = rule;\n rule[fnValuesNs] = fn;\n return style;\n },\n onUpdate: function onUpdate(data, rule) {\n // It is a rules container like for e.g. ConditionalRule.\n if (rule.rules instanceof _RuleList2['default']) {\n rule.rules.update(data);\n return;\n }\n if (!(rule instanceof _StyleRule2['default'])) return;\n\n rule = rule;\n\n // If we have a fn values map, it is a rule with function values.\n if (rule[fnValuesNs]) {\n for (var prop in rule[fnValuesNs]) {\n rule.prop(prop, rule[fnValuesNs][prop](data));\n }\n }\n\n rule = rule;\n\n var fnStyle = rule[fnStyleNs];\n\n // If we have a style function, the entire rule is dynamic and style object\n // will be returned from that function.\n if (fnStyle) {\n var style = fnStyle(data);\n for (var _prop in style) {\n rule.prop(_prop, style[_prop]);\n }\n }\n }\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _StyleRule = require('../rules/StyleRule');\n\nvar _StyleRule2 = _interopRequireDefault(_StyleRule);\n\nvar _createRule = require('../utils/createRule');\n\nvar _createRule2 = _interopRequireDefault(_createRule);\n\nvar _isObservable = require('../utils/isObservable');\n\nvar _isObservable2 = _interopRequireDefault(_isObservable);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nexports['default'] = {\n onCreateRule: function onCreateRule(name, decl, options) {\n if (!(0, _isObservable2['default'])(decl)) return null;\n\n // Cast `decl` to `Observable`, since it passed the type guard.\n var style$ = decl;\n\n var rule = (0, _createRule2['default'])(name, {}, options);\n\n // TODO\n // Call `stream.subscribe()` returns a subscription, which should be explicitly\n // unsubscribed from when we know this sheet is no longer needed.\n style$.subscribe(function (style) {\n for (var prop in style) {\n rule.prop(prop, style[prop]);\n }\n });\n\n return rule;\n },\n onProcessRule: function onProcessRule(rule) {\n if (!(rule instanceof _StyleRule2['default'])) return;\n var styleRule = rule;\n var style = styleRule.style;\n\n var _loop = function _loop(prop) {\n var value = style[prop];\n if (!(0, _isObservable2['default'])(value)) return 'continue';\n delete style[prop];\n value.subscribe({\n next: function next(nextValue) {\n styleRule.prop(prop, nextValue);\n }\n });\n };\n\n for (var prop in style) {\n var _ret = _loop(prop);\n\n if (_ret === 'continue') continue;\n }\n }\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _SimpleRule = require('../rules/SimpleRule');\n\nvar _SimpleRule2 = _interopRequireDefault(_SimpleRule);\n\nvar _KeyframesRule = require('../rules/KeyframesRule');\n\nvar _KeyframesRule2 = _interopRequireDefault(_KeyframesRule);\n\nvar _ConditionalRule = require('../rules/ConditionalRule');\n\nvar _ConditionalRule2 = _interopRequireDefault(_ConditionalRule);\n\nvar _FontFaceRule = require('../rules/FontFaceRule');\n\nvar _FontFaceRule2 = _interopRequireDefault(_FontFaceRule);\n\nvar _ViewportRule = require('../rules/ViewportRule');\n\nvar _ViewportRule2 = _interopRequireDefault(_ViewportRule);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar classes = {\n '@charset': _SimpleRule2['default'],\n '@import': _SimpleRule2['default'],\n '@namespace': _SimpleRule2['default'],\n '@keyframes': _KeyframesRule2['default'],\n '@media': _ConditionalRule2['default'],\n '@supports': _ConditionalRule2['default'],\n '@font-face': _FontFaceRule2['default'],\n '@viewport': _ViewportRule2['default'],\n '@-ms-viewport': _ViewportRule2['default']\n\n /**\n * Generate plugins which will register all rules.\n */\n};\nexports['default'] = Object.keys(classes).map(function (key) {\n // https://jsperf.com/indexof-vs-substr-vs-regex-at-the-beginning-3\n var re = new RegExp('^' + key);\n var onCreateRule = function onCreateRule(name, decl, options) {\n return re.test(name) ? new classes[key](name, decl, options) : null;\n };\n return { onCreateRule: onCreateRule };\n});","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _warning = require('warning');\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nvar _sheets = require('../sheets');\n\nvar _sheets2 = _interopRequireDefault(_sheets);\n\nvar _StyleRule = require('../rules/StyleRule');\n\nvar _StyleRule2 = _interopRequireDefault(_StyleRule);\n\nvar _toCssValue = require('../utils/toCssValue');\n\nvar _toCssValue2 = _interopRequireDefault(_toCssValue);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Cache the value from the first time a function is called.\n */\nvar memoize = function memoize(fn) {\n var value = void 0;\n return function () {\n if (!value) value = fn();\n return value;\n };\n};\n\n/**\n * Get a style property value.\n */\nfunction getPropertyValue(cssRule, prop) {\n try {\n return cssRule.style.getPropertyValue(prop);\n } catch (err) {\n // IE may throw if property is unknown.\n return '';\n }\n}\n\n/**\n * Set a style property.\n */\nfunction setProperty(cssRule, prop, value) {\n try {\n var cssValue = value;\n\n if (Array.isArray(value)) {\n cssValue = (0, _toCssValue2['default'])(value, true);\n\n if (value[value.length - 1] === '!important') {\n cssRule.style.setProperty(prop, cssValue, 'important');\n return true;\n }\n }\n\n cssRule.style.setProperty(prop, cssValue);\n } catch (err) {\n // IE may throw if property is unknown.\n return false;\n }\n return true;\n}\n\n/**\n * Remove a style property.\n */\nfunction removeProperty(cssRule, prop) {\n try {\n cssRule.style.removeProperty(prop);\n } catch (err) {\n (0, _warning2['default'])(false, '[JSS] DOMException \"%s\" was thrown. Tried to remove property \"%s\".', err.message, prop);\n }\n}\n\nvar CSSRuleTypes = {\n STYLE_RULE: 1,\n KEYFRAMES_RULE: 7\n\n /**\n * Get the CSS Rule key.\n */\n\n};var getKey = function () {\n var extractKey = function extractKey(cssText) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n return cssText.substr(from, cssText.indexOf('{') - 1);\n };\n\n return function (cssRule) {\n if (cssRule.type === CSSRuleTypes.STYLE_RULE) return cssRule.selectorText;\n if (cssRule.type === CSSRuleTypes.KEYFRAMES_RULE) {\n var name = cssRule.name;\n\n if (name) return '@keyframes ' + name;\n\n // There is no rule.name in the following browsers:\n // - IE 9\n // - Safari 7.1.8\n // - Mobile Safari 9.0.0\n var cssText = cssRule.cssText;\n\n return '@' + extractKey(cssText, cssText.indexOf('keyframes'));\n }\n\n // Conditionals.\n return extractKey(cssRule.cssText);\n };\n}();\n\n/**\n * Set the selector.\n */\nfunction setSelector(cssRule, selectorText) {\n cssRule.selectorText = selectorText;\n\n // Return false if setter was not successful.\n // Currently works in chrome only.\n return cssRule.selectorText === selectorText;\n}\n\n/**\n * Gets the `head` element upon the first call and caches it.\n */\nvar getHead = memoize(function () {\n return document.head || document.getElementsByTagName('head')[0];\n});\n\n/**\n * Gets a map of rule keys, where the property is an unescaped key and value\n * is a potentially escaped one.\n * It is used to identify CSS rules and the corresponding JSS rules. As an identifier\n * for CSSStyleRule we normally use `selectorText`. Though if original selector text\n * contains escaped code points e.g. `:not(#\\\\20)`, CSSOM will compile it to `:not(# )`\n * and so CSS rule's `selectorText` won't match JSS rule selector.\n *\n * https://www.w3.org/International/questions/qa-escapes#cssescapes\n */\nvar getUnescapedKeysMap = function () {\n var style = void 0;\n var isAttached = false;\n\n return function (rules) {\n var map = {};\n // https://github.com/facebook/flow/issues/2696\n if (!style) style = document.createElement('style');\n for (var i = 0; i < rules.length; i++) {\n var rule = rules[i];\n if (!(rule instanceof _StyleRule2['default'])) continue;\n var selector = rule.selector;\n // Only unescape selector over CSSOM if it contains a back slash.\n\n if (selector && selector.indexOf('\\\\') !== -1) {\n // Lazilly attach when needed.\n if (!isAttached) {\n getHead().appendChild(style);\n isAttached = true;\n }\n style.textContent = selector + ' {}';\n var _style = style,\n sheet = _style.sheet;\n\n if (sheet) {\n var cssRules = sheet.cssRules;\n\n if (cssRules) map[cssRules[0].selectorText] = rule.key;\n }\n }\n }\n if (isAttached) {\n getHead().removeChild(style);\n isAttached = false;\n }\n return map;\n };\n}();\n\n/**\n * Find attached sheet with an index higher than the passed one.\n */\nfunction findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}\n\n/**\n * Find attached sheet with the highest index.\n */\nfunction findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n return null;\n}\n\n/**\n * Find a comment with \"jss\" inside.\n */\nfunction findCommentNode(text) {\n var head = getHead();\n for (var i = 0; i < head.childNodes.length; i++) {\n var node = head.childNodes[i];\n if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n return node;\n }\n }\n return null;\n}\n\n/**\n * Find a node before which we can insert the sheet.\n */\nfunction findPrevNode(options) {\n var registry = _sheets2['default'].registry;\n\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n if (sheet) return sheet.renderer.element;\n\n // Otherwise insert after the last attached.\n sheet = findHighestSheet(registry, options);\n if (sheet) return sheet.renderer.element.nextElementSibling;\n }\n\n // Try to find a comment placeholder if registry is empty.\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n if (comment) return comment.nextSibling;\n // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n (0, _warning2['default'])(insertionPoint === 'jss', '[JSS] Insertion point \"%s\" not found.', insertionPoint);\n }\n\n return null;\n}\n\n/**\n * Insert style element into the DOM.\n */\nfunction insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n\n var prevNode = findPrevNode(options);\n\n if (prevNode) {\n var parentNode = prevNode.parentNode;\n\n if (parentNode) parentNode.insertBefore(style, prevNode);\n return;\n }\n\n // Works with iframes and any node types.\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var _parentNode = insertionPointElement.parentNode;\n\n if (_parentNode) _parentNode.insertBefore(style, insertionPointElement.nextSibling);else (0, _warning2['default'])(false, '[JSS] Insertion point is not in the DOM.');\n return;\n }\n\n getHead().insertBefore(style, prevNode);\n}\n\n/**\n * Read jss nonce setting from the page if the user has set it.\n */\nvar getNonce = memoize(function () {\n var node = document.querySelector('meta[property=\"csp-nonce\"]');\n return node ? node.getAttribute('content') : null;\n});\n\nvar DomRenderer = function () {\n function DomRenderer(sheet) {\n _classCallCheck(this, DomRenderer);\n\n this.getPropertyValue = getPropertyValue;\n this.setProperty = setProperty;\n this.removeProperty = removeProperty;\n this.setSelector = setSelector;\n this.getKey = getKey;\n this.getUnescapedKeysMap = getUnescapedKeysMap;\n this.hasInsertedRules = false;\n\n // There is no sheet when the renderer is used from a standalone StyleRule.\n if (sheet) _sheets2['default'].add(sheet);\n\n this.sheet = sheet;\n\n var _ref = this.sheet ? this.sheet.options : {},\n media = _ref.media,\n meta = _ref.meta,\n element = _ref.element;\n\n this.element = element || document.createElement('style');\n this.element.type = 'text/css';\n this.element.setAttribute('data-jss', '');\n if (media) this.element.setAttribute('media', media);\n if (meta) this.element.setAttribute('data-meta', meta);\n var nonce = getNonce();\n if (nonce) this.element.setAttribute('nonce', nonce);\n }\n\n /**\n * Insert style element into render tree.\n */\n\n\n // HTMLStyleElement needs fixing https://github.com/facebook/flow/issues/2696\n\n\n _createClass(DomRenderer, [{\n key: 'attach',\n value: function attach() {\n // In the case the element node is external and it is already in the DOM.\n if (this.element.parentNode || !this.sheet) return;\n\n // When rules are inserted using `insertRule` API, after `sheet.detach().attach()`\n // browsers remove those rules.\n // TODO figure out if its a bug and if it is known.\n // Workaround is to redeploy the sheet before attaching as a string.\n if (this.hasInsertedRules) {\n this.deploy();\n this.hasInsertedRules = false;\n }\n\n insertStyle(this.element, this.sheet.options);\n }\n\n /**\n * Remove style element from render tree.\n */\n\n }, {\n key: 'detach',\n value: function detach() {\n this.element.parentNode.removeChild(this.element);\n }\n\n /**\n * Inject CSS string into element.\n */\n\n }, {\n key: 'deploy',\n value: function deploy() {\n if (!this.sheet) return;\n this.element.textContent = '\\n' + this.sheet.toString() + '\\n';\n }\n\n /**\n * Insert a rule into element.\n */\n\n }, {\n key: 'insertRule',\n value: function insertRule(rule, index) {\n var sheet = this.element.sheet;\n var cssRules = sheet.cssRules;\n\n var str = rule.toString();\n if (!index) index = cssRules.length;\n\n if (!str) return false;\n\n try {\n sheet.insertRule(str, index);\n } catch (err) {\n (0, _warning2['default'])(false, '[JSS] Can not insert an unsupported rule \\n\\r%s', rule);\n return false;\n }\n this.hasInsertedRules = true;\n\n return cssRules[index];\n }\n\n /**\n * Delete a rule.\n */\n\n }, {\n key: 'deleteRule',\n value: function deleteRule(cssRule) {\n var sheet = this.element.sheet;\n\n var index = this.indexOf(cssRule);\n if (index === -1) return false;\n sheet.deleteRule(index);\n return true;\n }\n\n /**\n * Get index of a CSS Rule.\n */\n\n }, {\n key: 'indexOf',\n value: function indexOf(cssRule) {\n var cssRules = this.element.sheet.cssRules;\n\n for (var _index = 0; _index < cssRules.length; _index++) {\n if (cssRule === cssRules[_index]) return _index;\n }\n return -1;\n }\n\n /**\n * Generate a new CSS rule and replace the existing one.\n */\n\n }, {\n key: 'replaceRule',\n value: function replaceRule(cssRule, rule) {\n var index = this.indexOf(cssRule);\n var newCssRule = this.insertRule(rule, index);\n this.element.sheet.deleteRule(index);\n return newCssRule;\n }\n\n /**\n * Get all rules elements.\n */\n\n }, {\n key: 'getRules',\n value: function getRules() {\n return this.element.sheet.cssRules;\n }\n }]);\n\n return DomRenderer;\n}();\n\nexports['default'] = DomRenderer;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/* eslint-disable class-methods-use-this */\n\n/**\n * Rendering backend to do nothing in nodejs.\n */\nvar VirtualRenderer = function () {\n function VirtualRenderer() {\n _classCallCheck(this, VirtualRenderer);\n }\n\n _createClass(VirtualRenderer, [{\n key: 'setProperty',\n value: function setProperty() {\n return true;\n }\n }, {\n key: 'getPropertyValue',\n value: function getPropertyValue() {\n return '';\n }\n }, {\n key: 'removeProperty',\n value: function removeProperty() {}\n }, {\n key: 'setSelector',\n value: function setSelector() {\n return true;\n }\n }, {\n key: 'getKey',\n value: function getKey() {\n return '';\n }\n }, {\n key: 'attach',\n value: function attach() {}\n }, {\n key: 'detach',\n value: function detach() {}\n }, {\n key: 'deploy',\n value: function deploy() {}\n }, {\n key: 'insertRule',\n value: function insertRule() {\n return false;\n }\n }, {\n key: 'deleteRule',\n value: function deleteRule() {\n return true;\n }\n }, {\n key: 'replaceRule',\n value: function replaceRule() {\n return false;\n }\n }, {\n key: 'getRules',\n value: function getRules() {}\n }, {\n key: 'indexOf',\n value: function indexOf() {\n return -1;\n }\n }]);\n\n return VirtualRenderer;\n}();\n\nexports['default'] = VirtualRenderer;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _RuleList = require('../RuleList');\n\nvar _RuleList2 = _interopRequireDefault(_RuleList);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Conditional rule for @media, @supports\n */\nvar ConditionalRule = function () {\n function ConditionalRule(key, styles, options) {\n _classCallCheck(this, ConditionalRule);\n\n this.type = 'conditional';\n this.isProcessed = false;\n\n this.key = key;\n this.options = options;\n this.rules = new _RuleList2['default'](_extends({}, options, { parent: this }));\n\n for (var name in styles) {\n this.rules.add(name, styles[name]);\n }\n\n this.rules.process();\n }\n\n /**\n * Get a rule.\n */\n\n\n _createClass(ConditionalRule, [{\n key: 'getRule',\n value: function getRule(name) {\n return this.rules.get(name);\n }\n\n /**\n * Get index of a rule.\n */\n\n }, {\n key: 'indexOf',\n value: function indexOf(rule) {\n return this.rules.indexOf(rule);\n }\n\n /**\n * Create and register rule, run plugins.\n */\n\n }, {\n key: 'addRule',\n value: function addRule(name, style, options) {\n var rule = this.rules.add(name, style, options);\n this.options.jss.plugins.onProcessRule(rule);\n return rule;\n }\n\n /**\n * Generates a CSS string.\n */\n\n }, {\n key: 'toString',\n value: function toString() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { indent: 1 };\n\n var inner = this.rules.toString(options);\n return inner ? this.key + ' {\\n' + inner + '\\n}' : '';\n }\n }]);\n\n return ConditionalRule;\n}();\n\nexports['default'] = ConditionalRule;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _toCss = require('../utils/toCss');\n\nvar _toCss2 = _interopRequireDefault(_toCss);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar FontFaceRule = function () {\n function FontFaceRule(key, style, options) {\n _classCallCheck(this, FontFaceRule);\n\n this.type = 'font-face';\n this.isProcessed = false;\n\n this.key = key;\n this.style = style;\n this.options = options;\n }\n\n /**\n * Generates a CSS string.\n */\n\n\n _createClass(FontFaceRule, [{\n key: 'toString',\n value: function toString(options) {\n if (Array.isArray(this.style)) {\n var str = '';\n for (var index = 0; index < this.style.length; index++) {\n str += (0, _toCss2['default'])(this.key, this.style[index]);\n if (this.style[index + 1]) str += '\\n';\n }\n return str;\n }\n\n return (0, _toCss2['default'])(this.key, this.style, options);\n }\n }]);\n\n return FontFaceRule;\n}();\n\nexports['default'] = FontFaceRule;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _RuleList = require('../RuleList');\n\nvar _RuleList2 = _interopRequireDefault(_RuleList);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Rule for @keyframes\n */\nvar KeyframesRule = function () {\n function KeyframesRule(key, frames, options) {\n _classCallCheck(this, KeyframesRule);\n\n this.type = 'keyframes';\n this.isProcessed = false;\n\n this.key = key;\n this.options = options;\n this.rules = new _RuleList2['default'](_extends({}, options, { parent: this }));\n\n for (var name in frames) {\n this.rules.add(name, frames[name], _extends({}, this.options, {\n parent: this,\n selector: name\n }));\n }\n\n this.rules.process();\n }\n\n /**\n * Generates a CSS string.\n */\n\n\n _createClass(KeyframesRule, [{\n key: 'toString',\n value: function toString() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { indent: 1 };\n\n var inner = this.rules.toString(options);\n if (inner) inner += '\\n';\n return this.key + ' {\\n' + inner + '}';\n }\n }]);\n\n return KeyframesRule;\n}();\n\nexports['default'] = KeyframesRule;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar SimpleRule = function () {\n function SimpleRule(key, value, options) {\n _classCallCheck(this, SimpleRule);\n\n this.type = 'simple';\n this.isProcessed = false;\n\n this.key = key;\n this.value = value;\n this.options = options;\n }\n\n /**\n * Generates a CSS string.\n */\n // eslint-disable-next-line no-unused-vars\n\n\n _createClass(SimpleRule, [{\n key: 'toString',\n value: function toString(options) {\n if (Array.isArray(this.value)) {\n var str = '';\n for (var index = 0; index < this.value.length; index++) {\n str += this.key + ' ' + this.value[index] + ';';\n if (this.value[index + 1]) str += '\\n';\n }\n return str;\n }\n\n return this.key + ' ' + this.value + ';';\n }\n }]);\n\n return SimpleRule;\n}();\n\nexports['default'] = SimpleRule;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _warning = require('warning');\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nvar _toCss = require('../utils/toCss');\n\nvar _toCss2 = _interopRequireDefault(_toCss);\n\nvar _toCssValue = require('../utils/toCssValue');\n\nvar _toCssValue2 = _interopRequireDefault(_toCssValue);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar StyleRule = function () {\n function StyleRule(key, style, options) {\n _classCallCheck(this, StyleRule);\n\n this.type = 'style';\n this.isProcessed = false;\n var sheet = options.sheet,\n Renderer = options.Renderer,\n selector = options.selector;\n\n this.key = key;\n this.options = options;\n this.style = style;\n if (selector) this.selectorText = selector;\n this.renderer = sheet ? sheet.renderer : new Renderer();\n }\n\n /**\n * Set selector string.\n * Attention: use this with caution. Most browsers didn't implement\n * selectorText setter, so this may result in rerendering of entire Style Sheet.\n */\n\n\n _createClass(StyleRule, [{\n key: 'prop',\n\n\n /**\n * Get or set a style property.\n */\n value: function prop(name, value) {\n // It's a getter.\n if (value === undefined) return this.style[name];\n\n // Don't do anything if the value has not changed.\n if (this.style[name] === value) return this;\n\n value = this.options.jss.plugins.onChangeValue(value, name, this);\n\n var isEmpty = value == null || value === false;\n var isDefined = name in this.style;\n\n // Value is empty and wasn't defined before.\n if (isEmpty && !isDefined) return this;\n\n // We are going to remove this value.\n var remove = isEmpty && isDefined;\n\n if (remove) delete this.style[name];else this.style[name] = value;\n\n // Renderable is defined if StyleSheet option `link` is true.\n if (this.renderable) {\n if (remove) this.renderer.removeProperty(this.renderable, name);else this.renderer.setProperty(this.renderable, name, value);\n return this;\n }\n\n var sheet = this.options.sheet;\n\n if (sheet && sheet.attached) {\n (0, _warning2['default'])(false, 'Rule is not linked. Missing sheet option \"link: true\".');\n }\n return this;\n }\n\n /**\n * Apply rule to an element inline.\n */\n\n }, {\n key: 'applyTo',\n value: function applyTo(renderable) {\n var json = this.toJSON();\n for (var prop in json) {\n this.renderer.setProperty(renderable, prop, json[prop]);\n }return this;\n }\n\n /**\n * Returns JSON representation of the rule.\n * Fallbacks are not supported.\n * Useful for inline styles.\n */\n\n }, {\n key: 'toJSON',\n value: function toJSON() {\n var json = {};\n for (var prop in this.style) {\n var value = this.style[prop];\n if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== 'object') json[prop] = value;else if (Array.isArray(value)) json[prop] = (0, _toCssValue2['default'])(value);\n }\n return json;\n }\n\n /**\n * Generates a CSS string.\n */\n\n }, {\n key: 'toString',\n value: function toString(options) {\n var sheet = this.options.sheet;\n\n var link = sheet ? sheet.options.link : false;\n var opts = link ? _extends({}, options, { allowEmpty: true }) : options;\n return (0, _toCss2['default'])(this.selector, this.style, opts);\n }\n }, {\n key: 'selector',\n set: function set(selector) {\n if (selector === this.selectorText) return;\n\n this.selectorText = selector;\n\n if (!this.renderable) return;\n\n var hasChanged = this.renderer.setSelector(this.renderable, selector);\n\n // If selector setter is not implemented, rerender the rule.\n if (!hasChanged && this.renderable) {\n var renderable = this.renderer.replaceRule(this.renderable, this);\n if (renderable) this.renderable = renderable;\n }\n }\n\n /**\n * Get selector string.\n */\n ,\n get: function get() {\n return this.selectorText;\n }\n }]);\n\n return StyleRule;\n}();\n\nexports['default'] = StyleRule;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _toCss = require('../utils/toCss');\n\nvar _toCss2 = _interopRequireDefault(_toCss);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar ViewportRule = function () {\n function ViewportRule(key, style, options) {\n _classCallCheck(this, ViewportRule);\n\n this.type = 'viewport';\n this.isProcessed = false;\n\n this.key = key;\n this.style = style;\n this.options = options;\n }\n\n /**\n * Generates a CSS string.\n */\n\n\n _createClass(ViewportRule, [{\n key: 'toString',\n value: function toString(options) {\n return (0, _toCss2['default'])(this.key, this.style, options);\n }\n }]);\n\n return ViewportRule;\n}();\n\nexports['default'] = ViewportRule;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _SheetsRegistry = require('./SheetsRegistry');\n\nvar _SheetsRegistry2 = _interopRequireDefault(_SheetsRegistry);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\n/**\n * This is a global sheets registry. Only DomRenderer will add sheets to it.\n * On the server one should use an own SheetsRegistry instance and add the\n * sheets to it, because you need to make sure to create a new registry for\n * each request in order to not leak sheets across requests.\n */\nexports['default'] = new _SheetsRegistry2['default']();","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nexports['default'] = cloneStyle;\n\nvar _isObservable = require('./isObservable');\n\nvar _isObservable2 = _interopRequireDefault(_isObservable);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar isArray = Array.isArray;\nfunction cloneStyle(style) {\n // Support empty values in case user ends up with them by accident.\n if (style == null) return style;\n\n // Support string value for SimpleRule.\n var typeOfStyle = typeof style === 'undefined' ? 'undefined' : _typeof(style);\n\n if (typeOfStyle === 'string' || typeOfStyle === 'number' || typeOfStyle === 'function') {\n return style;\n }\n\n // Support array for FontFaceRule.\n if (isArray(style)) return style.map(cloneStyle);\n\n // Support Observable styles. Observables are immutable, so we don't need to\n // copy them.\n if ((0, _isObservable2['default'])(style)) return style;\n\n var newStyle = {};\n for (var name in style) {\n var value = style[name];\n if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object') {\n newStyle[name] = cloneStyle(value);\n continue;\n }\n newStyle[name] = value;\n }\n\n return newStyle;\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _warning = require('warning');\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nvar _StyleSheet = require('../StyleSheet');\n\nvar _StyleSheet2 = _interopRequireDefault(_StyleSheet);\n\nvar _moduleId = require('./moduleId');\n\nvar _moduleId2 = _interopRequireDefault(_moduleId);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar maxRules = 1e10;\n\n\nvar env = process.env.NODE_ENV;\n\n/**\n * Returns a function which generates unique class names based on counters.\n * When new generator function is created, rule counter is reseted.\n * We need to reset the rule counter for SSR for each request.\n */\n\nexports['default'] = function () {\n var ruleCounter = 0;\n var defaultPrefix = env === 'production' ? 'c' : '';\n\n return function (rule, sheet) {\n ruleCounter += 1;\n\n if (ruleCounter > maxRules) {\n (0, _warning2['default'])(false, '[JSS] You might have a memory leak. Rule counter is at %s.', ruleCounter);\n }\n\n var prefix = defaultPrefix;\n var jssId = '';\n\n if (sheet) {\n prefix = sheet.options.classNamePrefix || defaultPrefix;\n if (sheet.options.jss.id != null) jssId += sheet.options.jss.id;\n }\n\n if (env === 'production') {\n return '' + prefix + _moduleId2['default'] + jssId + ruleCounter;\n }\n\n return prefix + rule.key + '-' + _moduleId2['default'] + (jssId && '-' + jssId) + '-' + ruleCounter;\n };\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports['default'] = createRule;\n\nvar _warning = require('warning');\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nvar _StyleRule = require('../rules/StyleRule');\n\nvar _StyleRule2 = _interopRequireDefault(_StyleRule);\n\nvar _cloneStyle = require('../utils/cloneStyle');\n\nvar _cloneStyle2 = _interopRequireDefault(_cloneStyle);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\n/**\n * Create a rule instance.\n */\nfunction createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar CSS = global.CSS;\n\nvar env = process.env.NODE_ENV;\n\nvar escapeRegex = /([[\\].#*$><+~=|^:(),\"'`])/g;\n\nexports['default'] = function (str) {\n // We don't need to escape it in production, because we are not using user's\n // input for selectors, we are generating a valid selector.\n if (env === 'production') return str;\n\n if (!CSS || !CSS.escape) {\n return str.replace(escapeRegex, '\\\\$1');\n }\n\n return CSS.escape(str);\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\n/**\n * Extracts a styles object with only props that contain function values.\n */\nexports['default'] = function (styles) {\n // eslint-disable-next-line no-shadow\n function extract(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = extract(value);\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n }\n\n return extract(styles);\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _symbolObservable = require('symbol-observable');\n\nvar _symbolObservable2 = _interopRequireDefault(_symbolObservable);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nexports['default'] = function (value) {\n return value && value[_symbolObservable2['default']] && value === value[_symbolObservable2['default']]();\n};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = linkRule;\n/**\n * Link rule with CSSStyleRule and nested rules with corresponding nested cssRules if both exists.\n */\nfunction linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar ns = '2f1acc6c3a606b082e5eef5e54414ffb';\nif (global[ns] == null) global[ns] = 0;\n\n// Bundle may contain multiple JSS versions at the same time. In order to identify\n// the current version with just one short number and use it for classes generation\n// we use a counter. Also it is more accurate, because user can manually reevaluate\n// the module.\nexports['default'] = global[ns]++;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports['default'] = toCss;\n\nvar _toCssValue = require('./toCssValue');\n\nvar _toCssValue2 = _interopRequireDefault(_toCssValue);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\n/**\n * Indent a string.\n * http://jsperf.com/array-join-vs-for\n */\nfunction indentStr(str, indent) {\n var result = '';\n for (var index = 0; index < indent; index++) {\n result += ' ';\n }return result + str;\n}\n\n/**\n * Converts a Rule to CSS string.\n */\n\nfunction toCss(selector, style) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n var result = '';\n\n if (!style) return result;\n\n var _options$indent = options.indent,\n indent = _options$indent === undefined ? 0 : _options$indent;\n var fallbacks = style.fallbacks;\n\n\n indent++;\n\n // Apply fallbacks first.\n if (fallbacks) {\n // Array syntax {fallbacks: [{prop: value}]}\n if (Array.isArray(fallbacks)) {\n for (var index = 0; index < fallbacks.length; index++) {\n var fallback = fallbacks[index];\n for (var prop in fallback) {\n var value = fallback[prop];\n if (value != null) {\n result += '\\n' + indentStr(prop + ': ' + (0, _toCssValue2['default'])(value) + ';', indent);\n }\n }\n }\n } else {\n // Object syntax {fallbacks: {prop: value}}\n for (var _prop in fallbacks) {\n var _value = fallbacks[_prop];\n if (_value != null) {\n result += '\\n' + indentStr(_prop + ': ' + (0, _toCssValue2['default'])(_value) + ';', indent);\n }\n }\n }\n }\n\n for (var _prop2 in style) {\n var _value2 = style[_prop2];\n if (_value2 != null && _prop2 !== 'fallbacks') {\n result += '\\n' + indentStr(_prop2 + ': ' + (0, _toCssValue2['default'])(_value2) + ';', indent);\n }\n }\n\n // Allow empty style in this case, because properties will be added dynamically.\n if (!result && !options.allowEmpty) return result;\n\n indent--;\n result = indentStr(selector + ' {' + result + '\\n', indent) + indentStr('}', indent);\n\n return result;\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports['default'] = toCssValue;\nvar join = function join(value, by) {\n var result = '';\n for (var i = 0; i < value.length; i++) {\n // Remove !important from the value, it will be readded later.\n if (value[i] === '!important') break;\n if (result) result += by;\n result += value[i];\n }\n return result;\n};\n\n/**\n * Converts array values to string.\n *\n * `margin: [['5px', '10px']]` > `margin: 5px 10px;`\n * `border: ['1px', '2px']` > `border: 1px, 2px;`\n * `margin: [['5px', '10px'], '!important']` > `margin: 5px 10px !important;`\n * `color: ['red', !important]` > `color: red !important;`\n */\nfunction toCssValue(value) {\n var ignoreImportant = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (!Array.isArray(value)) return value;\n\n var cssValue = '';\n\n // Support space separated values via `[['5px', '10px']]`.\n if (Array.isArray(value[0])) {\n for (var i = 0; i < value.length; i++) {\n if (value[i] === '!important') break;\n if (cssValue) cssValue += ', ';\n cssValue += join(value[i], ' ');\n }\n } else cssValue = join(value, ', ');\n\n // Add !important, because it was ignored.\n if (!ignoreImportant && value[value.length - 1] === '!important') {\n cssValue += ' !important';\n }\n\n return cssValue;\n}","/* global window */\nimport ponyfill from './ponyfill.js';\n\nvar root;\n\nif (typeof self !== 'undefined') {\n root = self;\n} else if (typeof window !== 'undefined') {\n root = window;\n} else if (typeof global !== 'undefined') {\n root = global;\n} else if (typeof module !== 'undefined') {\n root = module;\n} else {\n root = Function('return this')();\n}\n\nvar result = ponyfill(root);\nexport default result;\n","export default function symbolObservablePonyfill(root) {\n\tvar result;\n\tvar Symbol = root.Symbol;\n\n\tif (typeof Symbol === 'function') {\n\t\tif (Symbol.observable) {\n\t\t\tresult = Symbol.observable;\n\t\t} else {\n\t\t\tresult = Symbol('observable');\n\t\t\tSymbol.observable = result;\n\t\t}\n\t} else {\n\t\tresult = '@@observable';\n\t}\n\n\treturn result;\n};\n","// Source: http://jsfiddle.net/vWx8V/\n// http://stackoverflow.com/questions/5603195/full-list-of-javascript-keycodes\n\n/**\n * Conenience method returns corresponding value for given keyName or keyCode.\n *\n * @param {Mixed} keyCode {Number} or keyName {String}\n * @return {Mixed}\n * @api public\n */\n\nexports = module.exports = function(searchInput) {\n // Keyboard Events\n if (searchInput && 'object' === typeof searchInput) {\n var hasKeyCode = searchInput.which || searchInput.keyCode || searchInput.charCode\n if (hasKeyCode) searchInput = hasKeyCode\n }\n\n // Numbers\n if ('number' === typeof searchInput) return names[searchInput]\n\n // Everything else (cast to string)\n var search = String(searchInput)\n\n // check codes\n var foundNamedKey = codes[search.toLowerCase()]\n if (foundNamedKey) return foundNamedKey\n\n // check aliases\n var foundNamedKey = aliases[search.toLowerCase()]\n if (foundNamedKey) return foundNamedKey\n\n // weird character?\n if (search.length === 1) return search.charCodeAt(0)\n\n return undefined\n}\n\n/**\n * Get by name\n *\n * exports.code['enter'] // => 13\n */\n\nvar codes = exports.code = exports.codes = {\n 'backspace': 8,\n 'tab': 9,\n 'enter': 13,\n 'shift': 16,\n 'ctrl': 17,\n 'alt': 18,\n 'pause/break': 19,\n 'caps lock': 20,\n 'esc': 27,\n 'space': 32,\n 'page up': 33,\n 'page down': 34,\n 'end': 35,\n 'home': 36,\n 'left': 37,\n 'up': 38,\n 'right': 39,\n 'down': 40,\n 'insert': 45,\n 'delete': 46,\n 'command': 91,\n 'left command': 91,\n 'right command': 93,\n 'numpad *': 106,\n 'numpad +': 107,\n 'numpad -': 109,\n 'numpad .': 110,\n 'numpad /': 111,\n 'num lock': 144,\n 'scroll lock': 145,\n 'my computer': 182,\n 'my calculator': 183,\n ';': 186,\n '=': 187,\n ',': 188,\n '-': 189,\n '.': 190,\n '/': 191,\n '`': 192,\n '[': 219,\n '\\\\': 220,\n ']': 221,\n \"'\": 222\n}\n\n// Helper aliases\n\nvar aliases = exports.aliases = {\n 'windows': 91,\n '⇧': 16,\n '⌥': 18,\n '⌃': 17,\n '⌘': 91,\n 'ctl': 17,\n 'control': 17,\n 'option': 18,\n 'pause': 19,\n 'break': 19,\n 'caps': 20,\n 'return': 13,\n 'escape': 27,\n 'spc': 32,\n 'pgup': 33,\n 'pgdn': 34,\n 'ins': 45,\n 'del': 46,\n 'cmd': 91\n}\n\n\n/*!\n * Programatically add the following\n */\n\n// lower case chars\nfor (i = 97; i < 123; i++) codes[String.fromCharCode(i)] = i - 32\n\n// numbers\nfor (var i = 48; i < 58; i++) codes[i - 48] = i\n\n// function keys\nfor (i = 1; i < 13; i++) codes['f'+i] = i + 111\n\n// numpad keys\nfor (i = 0; i < 10; i++) codes['numpad '+i] = i + 96\n\n/**\n * Get by code\n *\n * exports.name[13] // => 'Enter'\n */\n\nvar names = exports.names = exports.title = {} // title for backward compat\n\n// Create reverse mapping\nfor (i in codes) names[codes[i]] = i\n\n// Add aliases\nfor (var alias in aliases) {\n codes[alias] = aliases[alias]\n}\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","var isObject = require('./isObject'),\n now = require('./now'),\n toNumber = require('./toNumber');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nmodule.exports = debounce;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n","var root = require('./_root');\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\nmodule.exports = now;\n","var isObject = require('./isObject'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = toNumber;\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.styles = undefined;\n\nvar _defineProperty2 = require('babel-runtime/helpers/defineProperty');\n\nvar _defineProperty3 = _interopRequireDefault(_defineProperty2);\n\nvar _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');\n\nvar _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _classnames = require('classnames');\n\nvar _classnames2 = _interopRequireDefault(_classnames);\n\nvar _withStyles = require('../styles/withStyles');\n\nvar _withStyles2 = _interopRequireDefault(_withStyles);\n\nvar _colorManipulator = require('../styles/colorManipulator');\n\nvar _ButtonBase = require('../ButtonBase');\n\nvar _ButtonBase2 = _interopRequireDefault(_ButtonBase);\n\nvar _helpers = require('../utils/helpers');\n\nvar _reactHelpers = require('../utils/reactHelpers');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// @inheritedComponent ButtonBase\n\nvar styles = exports.styles = function styles(theme) {\n return {\n root: (0, _extends3.default)({}, theme.typography.button, {\n lineHeight: '1.4em', // Improve readability for multiline button.\n boxSizing: 'border-box',\n minWidth: theme.spacing.unit * 11,\n minHeight: 36,\n padding: theme.spacing.unit + 'px ' + theme.spacing.unit * 2 + 'px',\n borderRadius: 2,\n color: theme.palette.text.primary,\n transition: theme.transitions.create(['background-color', 'box-shadow'], {\n duration: theme.transitions.duration.short\n }),\n '&:hover': {\n textDecoration: 'none',\n // Reset on mouse devices\n backgroundColor: (0, _colorManipulator.fade)(theme.palette.text.primary, 0.12),\n '@media (hover: none)': {\n backgroundColor: 'transparent'\n },\n '&$disabled': {\n backgroundColor: 'transparent'\n }\n }\n }),\n label: {\n width: '100%',\n display: 'inherit',\n alignItems: 'inherit',\n justifyContent: 'inherit'\n },\n flatPrimary: {\n color: theme.palette.primary.main,\n '&:hover': {\n backgroundColor: (0, _colorManipulator.fade)(theme.palette.primary.main, 0.12),\n // Reset on mouse devices\n '@media (hover: none)': {\n backgroundColor: 'transparent'\n }\n }\n },\n flatSecondary: {\n color: theme.palette.secondary.main,\n '&:hover': {\n backgroundColor: (0, _colorManipulator.fade)(theme.palette.secondary.main, 0.12),\n // Reset on mouse devices\n '@media (hover: none)': {\n backgroundColor: 'transparent'\n }\n }\n },\n colorInherit: {\n color: 'inherit'\n },\n raised: {\n color: theme.palette.getContrastText(theme.palette.grey[300]),\n backgroundColor: theme.palette.grey[300],\n boxShadow: theme.shadows[2],\n '&$keyboardFocused': {\n boxShadow: theme.shadows[6]\n },\n '&:active': {\n boxShadow: theme.shadows[8]\n },\n '&$disabled': {\n boxShadow: theme.shadows[0],\n backgroundColor: theme.palette.action.disabledBackground\n },\n '&:hover': {\n backgroundColor: theme.palette.grey.A100,\n // Reset on mouse devices\n '@media (hover: none)': {\n backgroundColor: theme.palette.grey[300]\n },\n '&$disabled': {\n backgroundColor: theme.palette.action.disabledBackground\n }\n }\n },\n keyboardFocused: {},\n raisedPrimary: {\n color: theme.palette.primary.contrastText,\n backgroundColor: theme.palette.primary.main,\n '&:hover': {\n backgroundColor: theme.palette.primary.dark,\n // Reset on mouse devices\n '@media (hover: none)': {\n backgroundColor: theme.palette.primary.main\n }\n }\n },\n raisedSecondary: {\n color: theme.palette.secondary.contrastText,\n backgroundColor: theme.palette.secondary.main,\n '&:hover': {\n backgroundColor: theme.palette.secondary.dark,\n // Reset on mouse devices\n '@media (hover: none)': {\n backgroundColor: theme.palette.secondary.main\n }\n }\n },\n disabled: {\n color: theme.palette.action.disabled\n },\n fab: {\n borderRadius: '50%',\n padding: 0,\n minWidth: 0,\n width: 56,\n fontSize: 24,\n height: 56,\n boxShadow: theme.shadows[6],\n '&:active': {\n boxShadow: theme.shadows[12]\n }\n },\n mini: {\n width: 40,\n height: 40\n },\n sizeSmall: {\n padding: theme.spacing.unit - 1 + 'px ' + theme.spacing.unit + 'px',\n minWidth: theme.spacing.unit * 8,\n minHeight: 32,\n fontSize: theme.typography.pxToRem(theme.typography.fontSize - 1)\n },\n sizeLarge: {\n padding: theme.spacing.unit + 'px ' + theme.spacing.unit * 3 + 'px',\n minWidth: theme.spacing.unit * 14,\n minHeight: 40,\n fontSize: theme.typography.pxToRem(theme.typography.fontSize + 1)\n },\n fullWidth: {\n width: '100%'\n }\n };\n};\n\nfunction Button(props) {\n var _classNames;\n\n var childrenProp = props.children,\n classes = props.classes,\n classNameProp = props.className,\n color = props.color,\n disabled = props.disabled,\n disableFocusRipple = props.disableFocusRipple,\n fullWidth = props.fullWidth,\n mini = props.mini,\n size = props.size,\n variant = props.variant,\n other = (0, _objectWithoutProperties3.default)(props, ['children', 'classes', 'className', 'color', 'disabled', 'disableFocusRipple', 'fullWidth', 'mini', 'size', 'variant']);\n\n\n var fab = variant === 'fab';\n var raised = variant === 'raised';\n var flat = !raised && !fab;\n var className = (0, _classnames2.default)(classes.root, (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes.raised, raised || fab), (0, _defineProperty3.default)(_classNames, classes.fab, fab), (0, _defineProperty3.default)(_classNames, classes.mini, fab && mini), (0, _defineProperty3.default)(_classNames, classes.colorInherit, color === 'inherit'), (0, _defineProperty3.default)(_classNames, classes.flatPrimary, flat && color === 'primary'), (0, _defineProperty3.default)(_classNames, classes.flatSecondary, flat && color === 'secondary'), (0, _defineProperty3.default)(_classNames, classes.raisedPrimary, !flat && color === 'primary'), (0, _defineProperty3.default)(_classNames, classes.raisedSecondary, !flat && color === 'secondary'), (0, _defineProperty3.default)(_classNames, classes['size' + (0, _helpers.capitalize)(size)], size !== 'medium'), (0, _defineProperty3.default)(_classNames, classes.disabled, disabled), (0, _defineProperty3.default)(_classNames, classes.fullWidth, fullWidth), _classNames), classNameProp);\n\n var children = childrenProp;\n\n if (fab) {\n children = _react2.default.Children.map(children, function (child) {\n if ((0, _reactHelpers.isMuiElement)(child, ['Icon', 'SvgIcon'])) {\n return _react2.default.cloneElement(child, { fontSize: true });\n }\n return child;\n });\n }\n\n return _react2.default.createElement(\n _ButtonBase2.default,\n (0, _extends3.default)({\n className: className,\n disabled: disabled,\n focusRipple: !disableFocusRipple,\n keyboardFocusedClassName: classes.keyboardFocused\n }, other),\n _react2.default.createElement(\n 'span',\n { className: classes.label },\n children\n )\n );\n}\n\nButton.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * The content of the button.\n */\n children: _propTypes2.default.node.isRequired,\n /**\n * Useful to extend the style applied to components.\n */\n classes: _propTypes2.default.object.isRequired,\n /**\n * @ignore\n */\n className: _propTypes2.default.string,\n /**\n * The color of the component. It supports those theme colors that make sense for this component.\n */\n color: _propTypes2.default.oneOf(['default', 'inherit', 'primary', 'secondary']),\n /**\n * The component used for the root node.\n * Either a string to use a DOM element or a component.\n * The default value is a `button`.\n */\n component: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]),\n /**\n * If `true`, the button will be disabled.\n */\n disabled: _propTypes2.default.bool,\n /**\n * If `true`, the keyboard focus ripple will be disabled.\n * `disableRipple` must also be true.\n */\n disableFocusRipple: _propTypes2.default.bool,\n /**\n * If `true`, the ripple effect will be disabled.\n */\n disableRipple: _propTypes2.default.bool,\n /**\n * If `true`, the button will take up the full width of its container.\n */\n fullWidth: _propTypes2.default.bool,\n /**\n * The URL to link to when the button is clicked.\n * If defined, an `a` element will be used as the root node.\n */\n href: _propTypes2.default.string,\n /**\n * If `true`, and `variant` is `'fab'`, will use mini floating action button styling.\n */\n mini: _propTypes2.default.bool,\n /**\n * The size of the button.\n * `small` is equivalent to the dense button styling.\n */\n size: _propTypes2.default.oneOf(['small', 'medium', 'large']),\n /**\n * @ignore\n */\n type: _propTypes2.default.string,\n /**\n * The color of the component. It supports those theme colors that make sense for this component.\n */\n variant: _propTypes2.default.oneOf(['flat', 'raised', 'fab'])\n} : {};\n\nButton.defaultProps = {\n color: 'default',\n disabled: false,\n disableFocusRipple: false,\n disableRipple: false,\n fullWidth: false,\n mini: false,\n size: 'medium',\n type: 'button',\n variant: 'flat'\n};\n\nexports.default = (0, _withStyles2.default)(styles, { name: 'MuiButton' })(Button);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _Button = require('./Button');\n\nObject.defineProperty(exports, 'default', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_Button).default;\n }\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.styles = undefined;\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _defineProperty2 = require('babel-runtime/helpers/defineProperty');\n\nvar _defineProperty3 = _interopRequireDefault(_defineProperty2);\n\nvar _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');\n\nvar _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);\n\nvar _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = require('babel-runtime/helpers/createClass');\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = require('babel-runtime/helpers/inherits');\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _reactDom = require('react-dom');\n\nvar _classnames = require('classnames');\n\nvar _classnames2 = _interopRequireDefault(_classnames);\n\nvar _keycode = require('keycode');\n\nvar _keycode2 = _interopRequireDefault(_keycode);\n\nvar _ownerWindow = require('dom-helpers/ownerWindow');\n\nvar _ownerWindow2 = _interopRequireDefault(_ownerWindow);\n\nvar _withStyles = require('../styles/withStyles');\n\nvar _withStyles2 = _interopRequireDefault(_withStyles);\n\nvar _keyboardFocus = require('../utils/keyboardFocus');\n\nvar _TouchRipple = require('./TouchRipple');\n\nvar _TouchRipple2 = _interopRequireDefault(_TouchRipple);\n\nvar _createRippleHandler = require('./createRippleHandler');\n\nvar _createRippleHandler2 = _interopRequireDefault(_createRippleHandler);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar styles = exports.styles = {\n root: {\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n position: 'relative',\n // Remove grey highlight\n WebkitTapHighlightColor: 'transparent',\n backgroundColor: 'transparent', // Reset default value\n outline: 'none',\n border: 0,\n margin: 0, // Remove the margin in Safari\n borderRadius: 0,\n padding: 0, // Remove the padding in Firefox\n cursor: 'pointer',\n userSelect: 'none',\n verticalAlign: 'middle',\n '-moz-appearance': 'none', // Reset\n '-webkit-appearance': 'none', // Reset\n textDecoration: 'none',\n // So we take precedent over the style of a native element.\n color: 'inherit',\n '&::-moz-focus-inner': {\n borderStyle: 'none' // Remove Firefox dotted outline.\n }\n },\n disabled: {\n pointerEvents: 'none', // Disable link interactions\n cursor: 'default'\n }\n};\n\n/**\n * `ButtonBase` contains as few styles as possible.\n * It aims to be a simple building block for creating a button.\n * It contains a load of style reset and some focus/ripple logic.\n */\n\nvar ButtonBase = function (_React$Component) {\n (0, _inherits3.default)(ButtonBase, _React$Component);\n\n function ButtonBase() {\n var _ref;\n\n var _temp, _this, _ret;\n\n (0, _classCallCheck3.default)(this, ButtonBase);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = ButtonBase.__proto__ || (0, _getPrototypeOf2.default)(ButtonBase)).call.apply(_ref, [this].concat(args))), _this), _this.state = {\n keyboardFocused: false\n }, _this.onKeyboardFocusHandler = function (event) {\n _this.keyDown = false;\n _this.setState({ keyboardFocused: true });\n\n if (_this.props.onKeyboardFocus) {\n _this.props.onKeyboardFocus(event);\n }\n }, _this.onRippleRef = function (node) {\n _this.ripple = node;\n }, _this.ripple = null, _this.keyDown = false, _this.button = null, _this.keyboardFocusTimeout = null, _this.keyboardFocusCheckTime = 50, _this.keyboardFocusMaxCheckTimes = 5, _this.handleKeyDown = function (event) {\n var _this$props = _this.props,\n component = _this$props.component,\n focusRipple = _this$props.focusRipple,\n onKeyDown = _this$props.onKeyDown,\n onClick = _this$props.onClick;\n\n var key = (0, _keycode2.default)(event);\n\n // Check if key is already down to avoid repeats being counted as multiple activations\n if (focusRipple && !_this.keyDown && _this.state.keyboardFocused && _this.ripple && key === 'space') {\n _this.keyDown = true;\n event.persist();\n _this.ripple.stop(event, function () {\n _this.ripple.start(event);\n });\n }\n\n if (onKeyDown) {\n onKeyDown(event);\n }\n\n // Keyboard accessibility for non interactive elements\n if (event.target === event.currentTarget && component && component !== 'button' && (key === 'space' || key === 'enter')) {\n event.preventDefault();\n if (onClick) {\n onClick(event);\n }\n }\n }, _this.handleKeyUp = function (event) {\n if (_this.props.focusRipple && (0, _keycode2.default)(event) === 'space' && _this.ripple && _this.state.keyboardFocused) {\n _this.keyDown = false;\n event.persist();\n _this.ripple.stop(event, function () {\n return _this.ripple.pulsate(event);\n });\n }\n if (_this.props.onKeyUp) {\n _this.props.onKeyUp(event);\n }\n }, _this.handleMouseDown = (0, _createRippleHandler2.default)(_this, 'MouseDown', 'start', function () {\n clearTimeout(_this.keyboardFocusTimeout);\n (0, _keyboardFocus.focusKeyPressed)(false);\n if (_this.state.keyboardFocused) {\n _this.setState({ keyboardFocused: false });\n }\n }), _this.handleMouseUp = (0, _createRippleHandler2.default)(_this, 'MouseUp', 'stop'), _this.handleMouseLeave = (0, _createRippleHandler2.default)(_this, 'MouseLeave', 'stop', function (event) {\n if (_this.state.keyboardFocused) {\n event.preventDefault();\n }\n }), _this.handleTouchStart = (0, _createRippleHandler2.default)(_this, 'TouchStart', 'start'), _this.handleTouchEnd = (0, _createRippleHandler2.default)(_this, 'TouchEnd', 'stop'), _this.handleTouchMove = (0, _createRippleHandler2.default)(_this, 'TouchEnd', 'stop'), _this.handleBlur = (0, _createRippleHandler2.default)(_this, 'Blur', 'stop', function () {\n clearTimeout(_this.keyboardFocusTimeout);\n (0, _keyboardFocus.focusKeyPressed)(false);\n _this.setState({ keyboardFocused: false });\n }), _this.handleFocus = function (event) {\n if (_this.props.disabled) {\n return;\n }\n\n // Fix for https://github.com/facebook/react/issues/7769\n if (!_this.button) {\n _this.button = event.currentTarget;\n }\n\n event.persist();\n (0, _keyboardFocus.detectKeyboardFocus)(_this, _this.button, function () {\n _this.onKeyboardFocusHandler(event);\n });\n\n if (_this.props.onFocus) {\n _this.props.onFocus(event);\n }\n }, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret);\n }\n\n (0, _createClass3.default)(ButtonBase, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.button = (0, _reactDom.findDOMNode)(this);\n (0, _keyboardFocus.listenForFocusKeys)((0, _ownerWindow2.default)(this.button));\n }\n }, {\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps(nextProps) {\n // The blur won't fire when the disabled state is set on a focused input.\n // We need to book keep the focused state manually.\n if (!this.props.disabled && nextProps.disabled && this.state.keyboardFocused) {\n this.setState({\n keyboardFocused: false\n });\n }\n }\n }, {\n key: 'componentWillUpdate',\n value: function componentWillUpdate(nextProps, nextState) {\n if (this.props.focusRipple && nextState.keyboardFocused && !this.state.keyboardFocused && !this.props.disableRipple) {\n this.ripple.pulsate();\n }\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n this.button = null;\n clearTimeout(this.keyboardFocusTimeout);\n } // Used to help track keyboard activation keyDown\n\n }, {\n key: 'render',\n value: function render() {\n var _classNames;\n\n var _props = this.props,\n buttonRef = _props.buttonRef,\n centerRipple = _props.centerRipple,\n children = _props.children,\n classes = _props.classes,\n classNameProp = _props.className,\n component = _props.component,\n disabled = _props.disabled,\n disableRipple = _props.disableRipple,\n focusRipple = _props.focusRipple,\n keyboardFocusedClassName = _props.keyboardFocusedClassName,\n onBlur = _props.onBlur,\n onFocus = _props.onFocus,\n onKeyboardFocus = _props.onKeyboardFocus,\n onKeyDown = _props.onKeyDown,\n onKeyUp = _props.onKeyUp,\n onMouseDown = _props.onMouseDown,\n onMouseLeave = _props.onMouseLeave,\n onMouseUp = _props.onMouseUp,\n onTouchEnd = _props.onTouchEnd,\n onTouchMove = _props.onTouchMove,\n onTouchStart = _props.onTouchStart,\n tabIndex = _props.tabIndex,\n type = _props.type,\n other = (0, _objectWithoutProperties3.default)(_props, ['buttonRef', 'centerRipple', 'children', 'classes', 'className', 'component', 'disabled', 'disableRipple', 'focusRipple', 'keyboardFocusedClassName', 'onBlur', 'onFocus', 'onKeyboardFocus', 'onKeyDown', 'onKeyUp', 'onMouseDown', 'onMouseLeave', 'onMouseUp', 'onTouchEnd', 'onTouchMove', 'onTouchStart', 'tabIndex', 'type']);\n\n\n var className = (0, _classnames2.default)(classes.root, (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes.disabled, disabled), (0, _defineProperty3.default)(_classNames, keyboardFocusedClassName || '', this.state.keyboardFocused), _classNames), classNameProp);\n\n var buttonProps = {};\n\n var ComponentProp = component;\n\n if (!ComponentProp) {\n if (other.href) {\n ComponentProp = 'a';\n } else {\n ComponentProp = 'button';\n }\n }\n\n if (ComponentProp === 'button') {\n buttonProps.type = type || 'button';\n buttonProps.disabled = disabled;\n } else {\n buttonProps.role = 'button';\n }\n\n return _react2.default.createElement(\n ComponentProp,\n (0, _extends3.default)({\n onBlur: this.handleBlur,\n onFocus: this.handleFocus,\n onKeyDown: this.handleKeyDown,\n onKeyUp: this.handleKeyUp,\n onMouseDown: this.handleMouseDown,\n onMouseLeave: this.handleMouseLeave,\n onMouseUp: this.handleMouseUp,\n onTouchEnd: this.handleTouchEnd,\n onTouchMove: this.handleTouchMove,\n onTouchStart: this.handleTouchStart,\n tabIndex: disabled ? '-1' : tabIndex,\n className: className,\n ref: buttonRef\n }, buttonProps, other),\n children,\n !disableRipple && !disabled ? _react2.default.createElement(_TouchRipple2.default, { innerRef: this.onRippleRef, center: centerRipple }) : null\n );\n }\n }]);\n return ButtonBase;\n}(_react2.default.Component);\n\nButtonBase.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * Use that property to pass a ref callback to the native button component.\n */\n buttonRef: _propTypes2.default.func,\n /**\n * If `true`, the ripples will be centered.\n * They won't start at the cursor interaction position.\n */\n centerRipple: _propTypes2.default.bool,\n /**\n * The content of the component.\n */\n children: _propTypes2.default.node,\n /**\n * Useful to extend the style applied to components.\n */\n classes: _propTypes2.default.object.isRequired,\n /**\n * @ignore\n */\n className: _propTypes2.default.string,\n /**\n * The component used for the root node.\n * Either a string to use a DOM element or a component.\n * The default value is a `button`.\n */\n component: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]),\n /**\n * If `true`, the base button will be disabled.\n */\n disabled: _propTypes2.default.bool,\n /**\n * If `true`, the ripple effect will be disabled.\n */\n disableRipple: _propTypes2.default.bool,\n /**\n * If `true`, the base button will have a keyboard focus ripple.\n * `disableRipple` must also be `false`.\n */\n focusRipple: _propTypes2.default.bool,\n /**\n * The CSS class applied while the component is keyboard focused.\n */\n keyboardFocusedClassName: _propTypes2.default.string,\n /**\n * @ignore\n */\n onBlur: _propTypes2.default.func,\n /**\n * @ignore\n */\n onClick: _propTypes2.default.func,\n /**\n * @ignore\n */\n onFocus: _propTypes2.default.func,\n /**\n * Callback fired when the component is focused with a keyboard.\n * We trigger a `onFocus` callback too.\n */\n onKeyboardFocus: _propTypes2.default.func,\n /**\n * @ignore\n */\n onKeyDown: _propTypes2.default.func,\n /**\n * @ignore\n */\n onKeyUp: _propTypes2.default.func,\n /**\n * @ignore\n */\n onMouseDown: _propTypes2.default.func,\n /**\n * @ignore\n */\n onMouseLeave: _propTypes2.default.func,\n /**\n * @ignore\n */\n onMouseUp: _propTypes2.default.func,\n /**\n * @ignore\n */\n onTouchEnd: _propTypes2.default.func,\n /**\n * @ignore\n */\n onTouchMove: _propTypes2.default.func,\n /**\n * @ignore\n */\n onTouchStart: _propTypes2.default.func,\n /**\n * @ignore\n */\n role: _propTypes2.default.string,\n /**\n * @ignore\n */\n tabIndex: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.string]),\n /**\n * @ignore\n */\n type: _propTypes2.default.string\n} : {};\n\nButtonBase.defaultProps = {\n centerRipple: false,\n disableRipple: false,\n focusRipple: false,\n tabIndex: '0',\n type: 'button'\n};\n\nexports.default = (0, _withStyles2.default)(styles, { name: 'MuiButtonBase' })(ButtonBase);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _defineProperty2 = require('babel-runtime/helpers/defineProperty');\n\nvar _defineProperty3 = _interopRequireDefault(_defineProperty2);\n\nvar _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');\n\nvar _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);\n\nvar _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = require('babel-runtime/helpers/createClass');\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = require('babel-runtime/helpers/inherits');\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _classnames = require('classnames');\n\nvar _classnames2 = _interopRequireDefault(_classnames);\n\nvar _Transition = require('react-transition-group/Transition');\n\nvar _Transition2 = _interopRequireDefault(_Transition);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @ignore - internal component.\n */\nvar Ripple = function (_React$Component) {\n (0, _inherits3.default)(Ripple, _React$Component);\n\n function Ripple() {\n var _ref;\n\n var _temp, _this, _ret;\n\n (0, _classCallCheck3.default)(this, Ripple);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = Ripple.__proto__ || (0, _getPrototypeOf2.default)(Ripple)).call.apply(_ref, [this].concat(args))), _this), _this.state = {\n rippleVisible: false,\n rippleLeaving: false\n }, _this.handleEnter = function () {\n _this.setState({\n rippleVisible: true\n });\n }, _this.handleExit = function () {\n _this.setState({\n rippleLeaving: true\n });\n }, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret);\n }\n\n (0, _createClass3.default)(Ripple, [{\n key: 'render',\n value: function render() {\n var _classNames, _classNames2;\n\n var _props = this.props,\n classes = _props.classes,\n classNameProp = _props.className,\n pulsate = _props.pulsate,\n rippleX = _props.rippleX,\n rippleY = _props.rippleY,\n rippleSize = _props.rippleSize,\n other = (0, _objectWithoutProperties3.default)(_props, ['classes', 'className', 'pulsate', 'rippleX', 'rippleY', 'rippleSize']);\n var _state = this.state,\n rippleVisible = _state.rippleVisible,\n rippleLeaving = _state.rippleLeaving;\n\n\n var className = (0, _classnames2.default)(classes.wrapper, (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes.wrapperLeaving, rippleLeaving), (0, _defineProperty3.default)(_classNames, classes.wrapperPulsating, pulsate), _classNames), classNameProp);\n\n var rippleClassName = (0, _classnames2.default)(classes.ripple, (_classNames2 = {}, (0, _defineProperty3.default)(_classNames2, classes.rippleVisible, rippleVisible), (0, _defineProperty3.default)(_classNames2, classes.rippleFast, pulsate), _classNames2));\n\n var rippleStyles = {\n width: rippleSize,\n height: rippleSize,\n top: -(rippleSize / 2) + rippleY,\n left: -(rippleSize / 2) + rippleX\n };\n\n return _react2.default.createElement(\n _Transition2.default,\n (0, _extends3.default)({ onEnter: this.handleEnter, onExit: this.handleExit }, other),\n _react2.default.createElement(\n 'span',\n { className: className },\n _react2.default.createElement('span', { className: rippleClassName, style: rippleStyles })\n )\n );\n }\n }]);\n return Ripple;\n}(_react2.default.Component);\n\nRipple.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * Useful to extend the style applied to components.\n */\n classes: _propTypes2.default.object.isRequired,\n /**\n * @ignore\n */\n className: _propTypes2.default.string,\n /**\n * If `true`, the ripple pulsates, typically indicating the keyboard focus state of an element.\n */\n pulsate: _propTypes2.default.bool,\n /**\n * Diameter of the ripple.\n */\n rippleSize: _propTypes2.default.number,\n /**\n * Horizontal position of the ripple center.\n */\n rippleX: _propTypes2.default.number,\n /**\n * Vertical position of the ripple center.\n */\n rippleY: _propTypes2.default.number\n} : {};\n\nRipple.defaultProps = {\n pulsate: false\n};\n\nexports.default = Ripple;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.styles = exports.DELAY_RIPPLE = undefined;\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');\n\nvar _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);\n\nvar _toConsumableArray2 = require('babel-runtime/helpers/toConsumableArray');\n\nvar _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);\n\nvar _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = require('babel-runtime/helpers/createClass');\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = require('babel-runtime/helpers/inherits');\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _reactDom = require('react-dom');\n\nvar _reactDom2 = _interopRequireDefault(_reactDom);\n\nvar _TransitionGroup = require('react-transition-group/TransitionGroup');\n\nvar _TransitionGroup2 = _interopRequireDefault(_TransitionGroup);\n\nvar _classnames = require('classnames');\n\nvar _classnames2 = _interopRequireDefault(_classnames);\n\nvar _withStyles = require('../styles/withStyles');\n\nvar _withStyles2 = _interopRequireDefault(_withStyles);\n\nvar _Ripple = require('./Ripple');\n\nvar _Ripple2 = _interopRequireDefault(_Ripple);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar DURATION = 550;\nvar DELAY_RIPPLE = exports.DELAY_RIPPLE = 80;\n\nvar styles = exports.styles = function styles(theme) {\n return {\n root: {\n display: 'block',\n position: 'absolute',\n overflow: 'hidden',\n borderRadius: 'inherit',\n width: '100%',\n height: '100%',\n left: 0,\n top: 0,\n pointerEvents: 'none',\n zIndex: 0\n },\n wrapper: {\n opacity: 1\n },\n wrapperLeaving: {\n opacity: 0,\n animation: 'mui-ripple-exit ' + DURATION + 'ms ' + theme.transitions.easing.easeInOut\n },\n wrapperPulsating: {\n position: 'absolute',\n left: 0,\n top: 0,\n display: 'block',\n width: '100%',\n height: '100%',\n animation: 'mui-ripple-pulsate 2500ms ' + theme.transitions.easing.easeInOut + ' 200ms infinite'\n },\n '@keyframes mui-ripple-enter': {\n '0%': {\n transform: 'scale(0)'\n },\n '100%': {\n transform: 'scale(1)'\n }\n },\n '@keyframes mui-ripple-exit': {\n '0%': {\n opacity: 1\n },\n '100%': {\n opacity: 0\n }\n },\n '@keyframes mui-ripple-pulsate': {\n '0%': {\n transform: 'scale(1)'\n },\n '50%': {\n transform: 'scale(0.92)'\n },\n '100%': {\n transform: 'scale(1)'\n }\n },\n ripple: {\n width: 50,\n height: 50,\n left: 0,\n top: 0,\n opacity: 0,\n position: 'absolute',\n borderRadius: '50%',\n background: 'currentColor'\n },\n rippleVisible: {\n opacity: 0.3,\n transform: 'scale(1)',\n animation: 'mui-ripple-enter ' + DURATION + 'ms ' + theme.transitions.easing.easeInOut\n },\n rippleFast: {\n animationDuration: '200ms'\n }\n };\n};\n\n/**\n * @ignore - internal component.\n */\n\nvar TouchRipple = function (_React$Component) {\n (0, _inherits3.default)(TouchRipple, _React$Component);\n\n function TouchRipple() {\n var _ref;\n\n var _temp, _this, _ret;\n\n (0, _classCallCheck3.default)(this, TouchRipple);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = TouchRipple.__proto__ || (0, _getPrototypeOf2.default)(TouchRipple)).call.apply(_ref, [this].concat(args))), _this), _this.state = {\n nextKey: 0,\n ripples: []\n }, _this.ignoringMouseDown = false, _this.startTimer = null, _this.startTimerCommit = null, _this.pulsate = function () {\n _this.start({}, { pulsate: true });\n }, _this.start = function () {\n var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var cb = arguments[2];\n var _options$pulsate = options.pulsate,\n pulsate = _options$pulsate === undefined ? false : _options$pulsate,\n _options$center = options.center,\n center = _options$center === undefined ? _this.props.center || options.pulsate : _options$center,\n _options$fakeElement = options.fakeElement,\n fakeElement = _options$fakeElement === undefined ? false : _options$fakeElement;\n\n\n if (event.type === 'mousedown' && _this.ignoringMouseDown) {\n _this.ignoringMouseDown = false;\n return;\n }\n\n if (event.type === 'touchstart') {\n _this.ignoringMouseDown = true;\n }\n\n var element = fakeElement ? null : _reactDom2.default.findDOMNode(_this);\n var rect = element ? element.getBoundingClientRect() : {\n width: 0,\n height: 0,\n left: 0,\n top: 0\n };\n\n // Get the size of the ripple\n var rippleX = void 0;\n var rippleY = void 0;\n var rippleSize = void 0;\n\n if (center || event.clientX === 0 && event.clientY === 0 || !event.clientX && !event.touches) {\n rippleX = Math.round(rect.width / 2);\n rippleY = Math.round(rect.height / 2);\n } else {\n var clientX = event.clientX ? event.clientX : event.touches[0].clientX;\n var clientY = event.clientY ? event.clientY : event.touches[0].clientY;\n rippleX = Math.round(clientX - rect.left);\n rippleY = Math.round(clientY - rect.top);\n }\n\n if (center) {\n rippleSize = Math.sqrt((2 * Math.pow(rect.width, 2) + Math.pow(rect.height, 2)) / 3);\n\n // For some reason the animation is broken on Mobile Chrome if the size if even.\n if (rippleSize % 2 === 0) {\n rippleSize += 1;\n }\n } else {\n var sizeX = Math.max(Math.abs((element ? element.clientWidth : 0) - rippleX), rippleX) * 2 + 2;\n var sizeY = Math.max(Math.abs((element ? element.clientHeight : 0) - rippleY), rippleY) * 2 + 2;\n rippleSize = Math.sqrt(Math.pow(sizeX, 2) + Math.pow(sizeY, 2));\n }\n\n // Touche devices\n if (event.touches) {\n // Prepare the ripple effect.\n _this.startTimerCommit = function () {\n _this.startCommit({ pulsate: pulsate, rippleX: rippleX, rippleY: rippleY, rippleSize: rippleSize, cb: cb });\n };\n // Deplay the execution of the ripple effect.\n _this.startTimer = setTimeout(function () {\n _this.startTimerCommit();\n _this.startTimerCommit = null;\n }, DELAY_RIPPLE); // We have to make a tradeoff with this value.\n } else {\n _this.startCommit({ pulsate: pulsate, rippleX: rippleX, rippleY: rippleY, rippleSize: rippleSize, cb: cb });\n }\n }, _this.startCommit = function (params) {\n var pulsate = params.pulsate,\n rippleX = params.rippleX,\n rippleY = params.rippleY,\n rippleSize = params.rippleSize,\n cb = params.cb;\n\n var ripples = _this.state.ripples;\n\n // Add a ripple to the ripples array.\n ripples = [].concat((0, _toConsumableArray3.default)(ripples), [_react2.default.createElement(_Ripple2.default, {\n key: _this.state.nextKey,\n classes: _this.props.classes,\n timeout: {\n exit: DURATION,\n enter: DURATION\n },\n pulsate: pulsate,\n rippleX: rippleX,\n rippleY: rippleY,\n rippleSize: rippleSize\n })]);\n\n _this.setState({\n nextKey: _this.state.nextKey + 1,\n ripples: ripples\n }, cb);\n }, _this.stop = function (event, cb) {\n clearTimeout(_this.startTimer);\n var ripples = _this.state.ripples;\n\n // The touch interaction occures to quickly.\n // We still want to show ripple effect.\n\n if (event.type === 'touchend' && _this.startTimerCommit) {\n event.persist();\n _this.startTimerCommit();\n _this.startTimerCommit = null;\n _this.startTimer = setTimeout(function () {\n _this.stop(event, cb);\n }, 0);\n return;\n }\n\n _this.startTimerCommit = null;\n\n if (ripples && ripples.length) {\n _this.setState({\n ripples: ripples.slice(1)\n }, cb);\n }\n }, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret);\n }\n\n (0, _createClass3.default)(TouchRipple, [{\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n clearTimeout(this.startTimer);\n }\n\n // Used to filter out mouse emulated events on mobile.\n\n // We use a timer in order to only show the ripples for touch \"click\" like events.\n // We don't want to display the ripple for touch scroll events.\n\n // This is the hook called once the previous timeout is ready.\n\n }, {\n key: 'render',\n value: function render() {\n var _props = this.props,\n center = _props.center,\n classes = _props.classes,\n className = _props.className,\n other = (0, _objectWithoutProperties3.default)(_props, ['center', 'classes', 'className']);\n\n\n return _react2.default.createElement(\n _TransitionGroup2.default,\n (0, _extends3.default)({\n component: 'span',\n enter: true,\n exit: true,\n className: (0, _classnames2.default)(classes.root, className)\n }, other),\n this.state.ripples\n );\n }\n }]);\n return TouchRipple;\n}(_react2.default.Component);\n\nTouchRipple.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * If `true`, the ripple starts at the center of the component\n * rather than at the point of interaction.\n */\n center: _propTypes2.default.bool,\n /**\n * Useful to extend the style applied to components.\n */\n classes: _propTypes2.default.object.isRequired,\n /**\n * @ignore\n */\n className: _propTypes2.default.string\n} : {};\n\nTouchRipple.defaultProps = {\n center: false\n};\n\nexports.default = (0, _withStyles2.default)(styles, { flip: false, name: 'MuiTouchRipple' })(TouchRipple);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nfunction createRippleHandler(instance, eventName, action, cb) {\n return function handleEvent(event) {\n if (cb) {\n cb.call(instance, event);\n }\n\n if (event.defaultPrevented) {\n return false;\n }\n\n if (instance.ripple) {\n instance.ripple[action](event);\n }\n\n if (instance.props && typeof instance.props['on' + eventName] === 'function') {\n instance.props['on' + eventName](event);\n }\n\n return true;\n };\n}\n\nexports.default = createRippleHandler;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _ButtonBase = require('./ButtonBase');\n\nObject.defineProperty(exports, 'default', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_ButtonBase).default;\n }\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.styles = undefined;\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _defineProperty2 = require('babel-runtime/helpers/defineProperty');\n\nvar _defineProperty3 = _interopRequireDefault(_defineProperty2);\n\nvar _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');\n\nvar _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);\n\nvar _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = require('babel-runtime/helpers/createClass');\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = require('babel-runtime/helpers/inherits');\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _classnames = require('classnames');\n\nvar _classnames2 = _interopRequireDefault(_classnames);\n\nvar _withStyles = require('../styles/withStyles');\n\nvar _withStyles2 = _interopRequireDefault(_withStyles);\n\nvar _Input = require('../Input/Input');\n\nvar _helpers = require('../utils/helpers');\n\nvar _reactHelpers = require('../utils/reactHelpers');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar styles = exports.styles = function styles(theme) {\n return {\n root: {\n display: 'inline-flex',\n flexDirection: 'column',\n position: 'relative',\n // Reset fieldset default style\n minWidth: 0,\n padding: 0,\n margin: 0,\n border: 0\n },\n marginNormal: {\n marginTop: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit\n },\n marginDense: {\n marginTop: theme.spacing.unit,\n marginBottom: theme.spacing.unit / 2\n },\n fullWidth: {\n width: '100%'\n }\n };\n};\n\n/**\n * Provides context such as dirty/focused/error/required for form inputs.\n * Relying on the context provides high flexibilty and ensures that the state always stay\n * consitent across the children of the `FormControl`.\n * This context is used by the following components:\n * - FormLabel\n * - FormHelperText\n * - Input\n * - InputLabel\n */\n\nvar FormControl = function (_React$Component) {\n (0, _inherits3.default)(FormControl, _React$Component);\n\n function FormControl(props, context) {\n (0, _classCallCheck3.default)(this, FormControl);\n\n // We need to iterate through the children and find the Input in order\n // to fully support server side rendering.\n var _this = (0, _possibleConstructorReturn3.default)(this, (FormControl.__proto__ || (0, _getPrototypeOf2.default)(FormControl)).call(this, props, context));\n\n _this.state = {\n adornedStart: false,\n dirty: false,\n focused: false\n };\n\n _this.handleFocus = function (event) {\n if (_this.props.onFocus) {\n _this.props.onFocus(event);\n }\n _this.setState(function (state) {\n return !state.focused ? { focused: true } : null;\n });\n };\n\n _this.handleBlur = function (event) {\n // The event might be undefined.\n // For instance, a child component might call this hook\n // when an input is disabled but still having the focus.\n if (_this.props.onBlur && event) {\n _this.props.onBlur(event);\n }\n _this.setState(function (state) {\n return state.focused ? { focused: false } : null;\n });\n };\n\n _this.handleDirty = function () {\n if (!_this.state.dirty) {\n _this.setState({ dirty: true });\n }\n };\n\n _this.handleClean = function () {\n if (_this.state.dirty) {\n _this.setState({ dirty: false });\n }\n };\n\n var children = _this.props.children;\n\n if (children) {\n _react2.default.Children.forEach(children, function (child) {\n if ((0, _reactHelpers.isMuiElement)(child, ['Input', 'Select']) && (0, _Input.isDirty)(child.props, true)) {\n _this.state.dirty = true;\n }\n if ((0, _reactHelpers.isMuiElement)(child, ['Input']) && (0, _Input.isAdornedStart)(child.props)) {\n _this.state.adornedStart = true;\n }\n });\n }\n return _this;\n }\n\n (0, _createClass3.default)(FormControl, [{\n key: 'getChildContext',\n value: function getChildContext() {\n var _props = this.props,\n disabled = _props.disabled,\n error = _props.error,\n required = _props.required,\n margin = _props.margin;\n var _state = this.state,\n adornedStart = _state.adornedStart,\n dirty = _state.dirty,\n focused = _state.focused;\n\n\n return {\n muiFormControl: {\n adornedStart: adornedStart,\n dirty: dirty,\n disabled: disabled,\n error: error,\n focused: focused,\n margin: margin,\n required: required,\n onDirty: this.handleDirty,\n onClean: this.handleClean,\n onFocus: this.handleFocus,\n onBlur: this.handleBlur\n }\n };\n }\n }, {\n key: 'render',\n value: function render() {\n var _classNames;\n\n var _props2 = this.props,\n classes = _props2.classes,\n className = _props2.className,\n Component = _props2.component,\n disabled = _props2.disabled,\n error = _props2.error,\n fullWidth = _props2.fullWidth,\n margin = _props2.margin,\n required = _props2.required,\n other = (0, _objectWithoutProperties3.default)(_props2, ['classes', 'className', 'component', 'disabled', 'error', 'fullWidth', 'margin', 'required']);\n\n\n return _react2.default.createElement(Component, (0, _extends3.default)({\n className: (0, _classnames2.default)(classes.root, (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes['margin' + (0, _helpers.capitalize)(margin)], margin !== 'none'), (0, _defineProperty3.default)(_classNames, classes.fullWidth, fullWidth), _classNames), className)\n }, other, {\n onFocus: this.handleFocus,\n onBlur: this.handleBlur\n }));\n }\n }]);\n return FormControl;\n}(_react2.default.Component);\n\nFormControl.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * The contents of the form control.\n */\n children: _propTypes2.default.node,\n /**\n * Useful to extend the style applied to components.\n */\n classes: _propTypes2.default.object.isRequired,\n /**\n * @ignore\n */\n className: _propTypes2.default.string,\n /**\n * The component used for the root node.\n * Either a string to use a DOM element or a component.\n */\n component: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]),\n /**\n * If `true`, the label, input and helper text should be displayed in a disabled state.\n */\n disabled: _propTypes2.default.bool,\n /**\n * If `true`, the label should be displayed in an error state.\n */\n error: _propTypes2.default.bool,\n /**\n * If `true`, the component will take up the full width of its container.\n */\n fullWidth: _propTypes2.default.bool,\n /**\n * If `dense` or `normal`, will adjust vertical spacing of this and contained components.\n */\n margin: _propTypes2.default.oneOf(['none', 'dense', 'normal']),\n /**\n * @ignore\n */\n onBlur: _propTypes2.default.func,\n /**\n * @ignore\n */\n onFocus: _propTypes2.default.func,\n /**\n * If `true`, the label will indicate that the input is required.\n */\n required: _propTypes2.default.bool\n} : {};\n\nFormControl.defaultProps = {\n component: 'div',\n disabled: false,\n error: false,\n fullWidth: false,\n margin: 'none',\n required: false\n};\n\nFormControl.childContextTypes = {\n muiFormControl: _propTypes2.default.object\n};\n\nexports.default = (0, _withStyles2.default)(styles, { name: 'MuiFormControl' })(FormControl);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.styles = undefined;\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _defineProperty2 = require('babel-runtime/helpers/defineProperty');\n\nvar _defineProperty3 = _interopRequireDefault(_defineProperty2);\n\nvar _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');\n\nvar _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _classnames = require('classnames');\n\nvar _classnames2 = _interopRequireDefault(_classnames);\n\nvar _withStyles = require('../styles/withStyles');\n\nvar _withStyles2 = _interopRequireDefault(_withStyles);\n\nvar _Typography = require('../Typography');\n\nvar _Typography2 = _interopRequireDefault(_Typography);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar styles = exports.styles = function styles(theme) {\n return {\n root: {\n display: 'inline-flex',\n alignItems: 'center',\n cursor: 'pointer',\n // For correct alignment with the text.\n verticalAlign: 'middle',\n // Remove grey highlight\n WebkitTapHighlightColor: 'transparent',\n marginLeft: -14,\n marginRight: theme.spacing.unit * 2 // used for row presentation of radio/checkbox\n },\n disabled: {\n color: theme.palette.text.disabled,\n cursor: 'default'\n },\n label: {}\n };\n};\n\n/**\n * Drop in replacement of the `Radio`, `Switch` and `Checkbox` component.\n * Use this component if you want to display an extra label.\n */\n/* eslint-disable jsx-a11y/label-has-for */\n\nfunction FormControlLabel(props, context) {\n var checked = props.checked,\n classes = props.classes,\n classNameProp = props.className,\n control = props.control,\n disabledProp = props.disabled,\n inputRef = props.inputRef,\n label = props.label,\n name = props.name,\n onChange = props.onChange,\n value = props.value,\n other = (0, _objectWithoutProperties3.default)(props, ['checked', 'classes', 'className', 'control', 'disabled', 'inputRef', 'label', 'name', 'onChange', 'value']);\n var muiFormControl = context.muiFormControl;\n\n var disabled = disabledProp;\n\n if (typeof control.props.disabled !== 'undefined') {\n if (typeof disabled === 'undefined') {\n disabled = control.props.disabled;\n }\n }\n\n if (muiFormControl) {\n if (typeof disabled === 'undefined') {\n disabled = muiFormControl.disabled;\n }\n }\n\n var className = (0, _classnames2.default)(classes.root, (0, _defineProperty3.default)({}, classes.disabled, disabled), classNameProp);\n\n return _react2.default.createElement(\n 'label',\n (0, _extends3.default)({ className: className }, other),\n _react2.default.cloneElement(control, {\n disabled: disabled,\n checked: typeof control.props.checked === 'undefined' ? checked : control.props.checked,\n name: control.props.name || name,\n onChange: control.props.onChange || onChange,\n value: control.props.value || value,\n inputRef: control.props.inputRef || inputRef\n }),\n _react2.default.createElement(\n _Typography2.default,\n { component: 'span', className: classes.label },\n label\n )\n );\n}\n\nFormControlLabel.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * If `true`, the component appears selected.\n */\n checked: _propTypes2.default.oneOfType([_propTypes2.default.bool, _propTypes2.default.string]),\n /**\n * Useful to extend the style applied to components.\n */\n classes: _propTypes2.default.object.isRequired,\n /**\n * @ignore\n */\n className: _propTypes2.default.string,\n /**\n * A control element. For instance, it can be be a `Radio`, a `Switch` or a `Checkbox`.\n */\n control: _propTypes2.default.element,\n /**\n * If `true`, the control will be disabled.\n */\n disabled: _propTypes2.default.bool,\n /**\n * Use that property to pass a ref callback to the native input component.\n */\n inputRef: _propTypes2.default.func,\n /**\n * The text to be used in an enclosing label element.\n */\n label: _propTypes2.default.node,\n /*\n * @ignore\n */\n name: _propTypes2.default.string,\n /**\n * Callback fired when the state is changed.\n *\n * @param {object} event The event source of the callback\n * @param {boolean} checked The `checked` value of the switch\n */\n onChange: _propTypes2.default.func,\n /**\n * The value of the component.\n */\n value: _propTypes2.default.string\n} : {};\n\nFormControlLabel.contextTypes = {\n muiFormControl: _propTypes2.default.object\n};\n\nexports.default = (0, _withStyles2.default)(styles, { name: 'MuiFormControlLabel' })(FormControlLabel);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.styles = undefined;\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _defineProperty2 = require('babel-runtime/helpers/defineProperty');\n\nvar _defineProperty3 = _interopRequireDefault(_defineProperty2);\n\nvar _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');\n\nvar _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _classnames = require('classnames');\n\nvar _classnames2 = _interopRequireDefault(_classnames);\n\nvar _withStyles = require('../styles/withStyles');\n\nvar _withStyles2 = _interopRequireDefault(_withStyles);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar styles = exports.styles = {\n root: {\n display: 'flex',\n flexDirection: 'column',\n flexWrap: 'wrap'\n },\n row: {\n flexDirection: 'row'\n }\n};\n\n/**\n * `FormGroup` wraps controls such as `Checkbox` and `Switch`.\n * It provides compact row layout.\n * For the `Radio`, you should be using the `RadioGroup` component instead of this one.\n */\nfunction FormGroup(props) {\n var classes = props.classes,\n className = props.className,\n children = props.children,\n row = props.row,\n other = (0, _objectWithoutProperties3.default)(props, ['classes', 'className', 'children', 'row']);\n\n var rootClassName = (0, _classnames2.default)(classes.root, (0, _defineProperty3.default)({}, classes.row, row), className);\n\n return _react2.default.createElement(\n 'div',\n (0, _extends3.default)({ className: rootClassName }, other),\n children\n );\n}\n\nFormGroup.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * The content of the component.\n */\n children: _propTypes2.default.node,\n /**\n * Useful to extend the style applied to components.\n */\n classes: _propTypes2.default.object.isRequired,\n /**\n * @ignore\n */\n className: _propTypes2.default.string,\n /**\n * Display group of elements in a compact row.\n */\n row: _propTypes2.default.bool\n} : {};\n\nFormGroup.defaultProps = {\n row: false\n};\n\nexports.default = (0, _withStyles2.default)(styles, { name: 'MuiFormGroup' })(FormGroup);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.styles = undefined;\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _defineProperty2 = require('babel-runtime/helpers/defineProperty');\n\nvar _defineProperty3 = _interopRequireDefault(_defineProperty2);\n\nvar _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');\n\nvar _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _classnames = require('classnames');\n\nvar _classnames2 = _interopRequireDefault(_classnames);\n\nvar _withStyles = require('../styles/withStyles');\n\nvar _withStyles2 = _interopRequireDefault(_withStyles);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar styles = exports.styles = function styles(theme) {\n return {\n root: {\n color: theme.palette.text.secondary,\n fontFamily: theme.typography.fontFamily,\n fontSize: theme.typography.pxToRem(12),\n textAlign: 'left',\n marginTop: theme.spacing.unit,\n lineHeight: '1em',\n minHeight: '1em',\n margin: 0\n },\n dense: {\n marginTop: theme.spacing.unit / 2\n },\n error: {\n color: theme.palette.error.main\n },\n disabled: {\n color: theme.palette.text.disabled\n }\n };\n};\n\nfunction FormHelperText(props, context) {\n var _classNames;\n\n var classes = props.classes,\n classNameProp = props.className,\n disabledProp = props.disabled,\n errorProp = props.error,\n marginProp = props.margin,\n Component = props.component,\n other = (0, _objectWithoutProperties3.default)(props, ['classes', 'className', 'disabled', 'error', 'margin', 'component']);\n var muiFormControl = context.muiFormControl;\n\n\n var disabled = disabledProp;\n var error = errorProp;\n var margin = marginProp;\n\n if (muiFormControl) {\n if (typeof disabled === 'undefined') {\n disabled = muiFormControl.disabled;\n }\n\n if (typeof error === 'undefined') {\n error = muiFormControl.error;\n }\n\n if (typeof margin === 'undefined') {\n margin = muiFormControl.margin;\n }\n }\n\n var className = (0, _classnames2.default)(classes.root, (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes.disabled, disabled), (0, _defineProperty3.default)(_classNames, classes.error, error), (0, _defineProperty3.default)(_classNames, classes.dense, margin === 'dense'), _classNames), classNameProp);\n\n return _react2.default.createElement(Component, (0, _extends3.default)({ className: className }, other));\n}\n\nFormHelperText.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * The content of the component.\n */\n children: _propTypes2.default.node,\n /**\n * Useful to extend the style applied to components.\n */\n classes: _propTypes2.default.object.isRequired,\n /**\n * @ignore\n */\n className: _propTypes2.default.string,\n /**\n * The component used for the root node.\n * Either a string to use a DOM element or a component.\n */\n component: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]),\n /**\n * If `true`, the helper text should be displayed in a disabled state.\n */\n disabled: _propTypes2.default.bool,\n /**\n * If `true`, helper text should be displayed in an error state.\n */\n error: _propTypes2.default.bool,\n /**\n * If `dense`, will adjust vertical spacing. This is normally obtained via context from\n * FormControl.\n */\n margin: _propTypes2.default.oneOf(['dense'])\n} : {};\n\nFormHelperText.defaultProps = {\n component: 'p'\n};\n\nFormHelperText.contextTypes = {\n muiFormControl: _propTypes2.default.object\n};\n\nexports.default = (0, _withStyles2.default)(styles, { name: 'MuiFormHelperText' })(FormHelperText);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.styles = undefined;\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _defineProperty2 = require('babel-runtime/helpers/defineProperty');\n\nvar _defineProperty3 = _interopRequireDefault(_defineProperty2);\n\nvar _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');\n\nvar _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _classnames = require('classnames');\n\nvar _classnames2 = _interopRequireDefault(_classnames);\n\nvar _withStyles = require('../styles/withStyles');\n\nvar _withStyles2 = _interopRequireDefault(_withStyles);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar styles = exports.styles = function styles(theme) {\n return {\n root: {\n fontFamily: theme.typography.fontFamily,\n color: theme.palette.text.secondary,\n fontSize: theme.typography.pxToRem(16),\n lineHeight: 1,\n padding: 0\n },\n focused: {\n color: theme.palette.primary[theme.palette.type === 'light' ? 'dark' : 'light']\n },\n error: {\n color: theme.palette.error.main\n },\n disabled: {\n color: theme.palette.text.disabled\n }\n };\n};\n\nfunction FormLabel(props, context) {\n var _classNames;\n\n var children = props.children,\n classes = props.classes,\n classNameProp = props.className,\n Component = props.component,\n disabledProp = props.disabled,\n errorProp = props.error,\n focusedProp = props.focused,\n requiredProp = props.required,\n other = (0, _objectWithoutProperties3.default)(props, ['children', 'classes', 'className', 'component', 'disabled', 'error', 'focused', 'required']);\n var muiFormControl = context.muiFormControl;\n\n\n var required = requiredProp;\n var focused = focusedProp;\n var disabled = disabledProp;\n var error = errorProp;\n\n if (muiFormControl) {\n if (typeof required === 'undefined') {\n required = muiFormControl.required;\n }\n if (typeof focused === 'undefined') {\n focused = muiFormControl.focused;\n }\n if (typeof disabled === 'undefined') {\n disabled = muiFormControl.disabled;\n }\n if (typeof error === 'undefined') {\n error = muiFormControl.error;\n }\n }\n\n var className = (0, _classnames2.default)(classes.root, (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes.focused, focused), (0, _defineProperty3.default)(_classNames, classes.disabled, disabled), (0, _defineProperty3.default)(_classNames, classes.error, error), _classNames), classNameProp);\n\n var asteriskClassName = (0, _classnames2.default)((0, _defineProperty3.default)({}, classes.error, error));\n\n return _react2.default.createElement(\n Component,\n (0, _extends3.default)({ className: className }, other),\n children,\n required && _react2.default.createElement(\n 'span',\n { className: asteriskClassName },\n '\\u2009*'\n )\n );\n}\n\nFormLabel.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * The content of the component.\n */\n children: _propTypes2.default.node,\n /**\n * Useful to extend the style applied to components.\n */\n classes: _propTypes2.default.object.isRequired,\n /**\n * @ignore\n */\n className: _propTypes2.default.string,\n /**\n * The component used for the root node.\n * Either a string to use a DOM element or a component.\n */\n component: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]),\n /**\n * If `true`, the label should be displayed in a disabled state.\n */\n disabled: _propTypes2.default.bool,\n /**\n * If `true`, the label should be displayed in an error state.\n */\n error: _propTypes2.default.bool,\n /**\n * If `true`, the input of this label is focused (used by `FormGroup` components).\n */\n focused: _propTypes2.default.bool,\n /**\n * If `true`, the label will indicate that the input is required.\n */\n required: _propTypes2.default.bool\n} : {};\n\nFormLabel.defaultProps = {\n component: 'label'\n};\n\nFormLabel.contextTypes = {\n muiFormControl: _propTypes2.default.object\n};\n\nexports.default = (0, _withStyles2.default)(styles, { name: 'MuiFormLabel' })(FormLabel);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _FormGroup = require('./FormGroup');\n\nObject.defineProperty(exports, 'FormGroup', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_FormGroup).default;\n }\n});\n\nvar _FormLabel = require('./FormLabel');\n\nObject.defineProperty(exports, 'FormLabel', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_FormLabel).default;\n }\n});\n\nvar _FormControl = require('./FormControl');\n\nObject.defineProperty(exports, 'FormControl', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_FormControl).default;\n }\n});\n\nvar _FormHelperText = require('./FormHelperText');\n\nObject.defineProperty(exports, 'FormHelperText', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_FormHelperText).default;\n }\n});\n\nvar _FormControlLabel = require('./FormControlLabel');\n\nObject.defineProperty(exports, 'FormControlLabel', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_FormControlLabel).default;\n }\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.styles = undefined;\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _defineProperty2 = require('babel-runtime/helpers/defineProperty');\n\nvar _defineProperty3 = _interopRequireDefault(_defineProperty2);\n\nvar _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');\n\nvar _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);\n\nvar _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = require('babel-runtime/helpers/createClass');\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = require('babel-runtime/helpers/inherits');\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nexports.hasValue = hasValue;\nexports.isDirty = isDirty;\nexports.isAdornedStart = isAdornedStart;\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _classnames = require('classnames');\n\nvar _classnames2 = _interopRequireDefault(_classnames);\n\nvar _withStyles = require('../styles/withStyles');\n\nvar _withStyles2 = _interopRequireDefault(_withStyles);\n\nvar _Textarea = require('./Textarea');\n\nvar _Textarea2 = _interopRequireDefault(_Textarea);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// Supports determination of isControlled().\n// Controlled input accepts its current value as a prop.\n//\n// @see https://facebook.github.io/react/docs/forms.html#controlled-components\n// @param value\n// @returns {boolean} true if string (including '') or number (including zero)\nfunction hasValue(value) {\n return value != null && !(Array.isArray(value) && value.length === 0);\n}\n\n// Determine if field is dirty (a.k.a. filled).\n//\n// Response determines if label is presented above field or as placeholder.\n//\n// @param obj\n// @param SSR\n// @returns {boolean} False when not present or empty string.\n// True when any number or string with length.\nfunction isDirty(obj) {\n var SSR = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n return obj && (hasValue(obj.value) && obj.value !== '' || SSR && hasValue(obj.defaultValue) && obj.defaultValue !== '');\n}\n\n// Determine if an Input is adorned on start.\n// It's corresponding to the left with LTR.\n//\n// @param obj\n// @returns {boolean} False when no adornments.\n// True when adorned at the start.\nfunction isAdornedStart(obj) {\n return obj.startAdornment;\n}\n\nvar styles = exports.styles = function styles(theme) {\n var light = theme.palette.type === 'light';\n var placeholder = {\n color: 'currentColor',\n opacity: light ? 0.42 : 0.5,\n transition: theme.transitions.create('opacity', {\n duration: theme.transitions.duration.shorter\n })\n };\n var placeholderHidden = {\n opacity: 0\n };\n var placeholderVisible = {\n opacity: light ? 0.42 : 0.5\n };\n var bottomLineColor = light ? 'rgba(0, 0, 0, 0.42)' : 'rgba(255, 255, 255, 0.7)';\n\n return {\n root: {\n // Mimics the default input display property used by browsers for an input.\n display: 'inline-flex',\n position: 'relative',\n fontFamily: theme.typography.fontFamily,\n color: light ? 'rgba(0, 0, 0, 0.87)' : theme.palette.common.white,\n fontSize: theme.typography.pxToRem(16),\n lineHeight: '1.1875em' // Reset (19px), match the native input line-height\n },\n formControl: {\n 'label + &': {\n marginTop: theme.spacing.unit * 2\n }\n },\n inkbar: {\n '&:after': {\n backgroundColor: theme.palette.primary[light ? 'dark' : 'light'],\n left: 0,\n bottom: 0,\n // Doing the other way around crash on IE11 \"''\" https://github.com/cssinjs/jss/issues/242\n content: '\"\"',\n height: 2,\n position: 'absolute',\n right: 0,\n transform: 'scaleX(0)',\n transition: theme.transitions.create('transform', {\n duration: theme.transitions.duration.shorter,\n easing: theme.transitions.easing.easeOut\n }),\n pointerEvents: 'none' // Transparent to the hover style.\n },\n '&$focused:after': {\n transform: 'scaleX(1)'\n }\n },\n error: {\n '&:after': {\n backgroundColor: theme.palette.error.main,\n transform: 'scaleX(1)' // error is always underlined in red\n }\n },\n focused: {},\n disabled: {\n color: theme.palette.text.disabled\n },\n underline: {\n '&:before': {\n backgroundColor: bottomLineColor,\n left: 0,\n bottom: 0,\n // Doing the other way around crash on IE11 \"''\" https://github.com/cssinjs/jss/issues/242\n content: '\"\"',\n height: 1,\n position: 'absolute',\n right: 0,\n transition: theme.transitions.create('background-color', {\n duration: theme.transitions.duration.shorter\n }),\n pointerEvents: 'none' // Transparent to the hover style.\n },\n '&:hover:not($disabled):before': {\n backgroundColor: theme.palette.text.primary,\n height: 2\n },\n '&$disabled:before': {\n background: 'transparent',\n backgroundImage: 'linear-gradient(to right, ' + bottomLineColor + ' 33%, transparent 0%)',\n backgroundPosition: 'left top',\n backgroundRepeat: 'repeat-x',\n backgroundSize: '5px 1px'\n }\n },\n multiline: {\n padding: theme.spacing.unit - 2 + 'px 0 ' + (theme.spacing.unit - 1) + 'px'\n },\n fullWidth: {\n width: '100%'\n },\n input: {\n font: 'inherit',\n color: 'currentColor',\n padding: theme.spacing.unit - 2 + 'px 0 ' + (theme.spacing.unit - 1) + 'px',\n border: 0,\n boxSizing: 'content-box',\n verticalAlign: 'middle',\n background: 'none',\n margin: 0, // Reset for Safari\n // Remove grey highlight\n WebkitTapHighlightColor: 'transparent',\n display: 'block',\n // Make the flex item shrink with Firefox\n minWidth: 0,\n width: '100%',\n '&::-webkit-input-placeholder': placeholder,\n '&::-moz-placeholder': placeholder, // Firefox 19+\n '&:-ms-input-placeholder': placeholder, // IE 11\n '&::-ms-input-placeholder': placeholder, // Edge\n '&:focus': {\n outline: 0\n },\n // Reset Firefox invalid required input style\n '&:invalid': {\n boxShadow: 'none'\n },\n '&::-webkit-search-decoration': {\n // Remove the padding when type=search.\n '-webkit-appearance': 'none'\n },\n // Show and hide the placeholder logic\n 'label[data-shrink=false] + $formControl &': {\n '&::-webkit-input-placeholder': placeholderHidden,\n '&::-moz-placeholder': placeholderHidden, // Firefox 19+\n '&:-ms-input-placeholder': placeholderHidden, // IE 11\n '&::-ms-input-placeholder': placeholderHidden, // Edge\n '&:focus::-webkit-input-placeholder': placeholderVisible,\n '&:focus::-moz-placeholder': placeholderVisible, // Firefox 19+\n '&:focus:-ms-input-placeholder': placeholderVisible, // IE 11\n '&:focus::-ms-input-placeholder': placeholderVisible // Edge\n }\n },\n inputDense: {\n paddingTop: theme.spacing.unit / 2 - 1\n },\n inputDisabled: {\n opacity: 1 // Reset iOS opacity\n },\n inputType: {\n // type=\"date\" or type=\"time\", etc. have specific styles we need to reset.\n height: '1.1875em' // Reset (19px), match the native input line-height\n },\n inputMultiline: {\n resize: 'none',\n padding: 0\n },\n inputSearch: {\n // Improve type search style.\n '-moz-appearance': 'textfield',\n '-webkit-appearance': 'textfield'\n }\n };\n};\n\nfunction formControlState(props, context) {\n var disabled = props.disabled;\n var error = props.error;\n var margin = props.margin;\n\n if (context && context.muiFormControl) {\n if (typeof disabled === 'undefined') {\n disabled = context.muiFormControl.disabled;\n }\n\n if (typeof error === 'undefined') {\n error = context.muiFormControl.error;\n }\n\n if (typeof margin === 'undefined') {\n margin = context.muiFormControl.margin;\n }\n }\n\n return {\n disabled: disabled,\n error: error,\n margin: margin\n };\n}\n\nvar Input = function (_React$Component) {\n (0, _inherits3.default)(Input, _React$Component);\n\n function Input() {\n var _ref;\n\n var _temp, _this, _ret;\n\n (0, _classCallCheck3.default)(this, Input);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = Input.__proto__ || (0, _getPrototypeOf2.default)(Input)).call.apply(_ref, [this].concat(args))), _this), _this.state = {\n focused: false\n }, _this.input = null, _this.handleFocus = function (event) {\n // Fix an bug with IE11 where the focus/blur events are triggered\n // while the input is disabled.\n if (formControlState(_this.props, _this.context).disabled) {\n event.stopPropagation();\n return;\n }\n\n _this.setState({ focused: true });\n if (_this.props.onFocus) {\n _this.props.onFocus(event);\n }\n }, _this.handleBlur = function (event) {\n _this.setState({ focused: false });\n if (_this.props.onBlur) {\n _this.props.onBlur(event);\n }\n }, _this.handleChange = function (event) {\n if (!_this.isControlled) {\n _this.checkDirty(_this.input);\n }\n\n // Perform in the willUpdate\n if (_this.props.onChange) {\n _this.props.onChange(event);\n }\n }, _this.handleRefInput = function (node) {\n _this.input = node;\n\n if (_this.props.inputRef) {\n _this.props.inputRef(node);\n } else if (_this.props.inputProps && _this.props.inputProps.ref) {\n _this.props.inputProps.ref(node);\n }\n }, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret);\n }\n\n (0, _createClass3.default)(Input, [{\n key: 'getChildContext',\n value: function getChildContext() {\n // We are consuming the parent muiFormControl context.\n // We don't want a child to consume it a second time.\n return {\n muiFormControl: null\n };\n }\n }, {\n key: 'componentWillMount',\n value: function componentWillMount() {\n this.isControlled = this.props.value != null;\n\n if (this.isControlled) {\n this.checkDirty(this.props);\n }\n }\n }, {\n key: 'componentDidMount',\n value: function componentDidMount() {\n if (!this.isControlled) {\n this.checkDirty(this.input);\n }\n }\n }, {\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps(nextProps, nextContext) {\n // The blur won't fire when the disabled state is set on a focused input.\n // We need to book keep the focused state manually.\n if (!formControlState(this.props, this.context).disabled && formControlState(nextProps, nextContext).disabled) {\n this.setState({\n focused: false\n });\n }\n }\n }, {\n key: 'componentWillUpdate',\n value: function componentWillUpdate(nextProps, nextState, nextContext) {\n if (this.isControlled) {\n this.checkDirty(nextProps);\n } // else performed in the onChange\n\n // Book keep the focused state.\n if (!formControlState(this.props, this.context).disabled && formControlState(nextProps, nextContext).disabled) {\n var muiFormControl = this.context.muiFormControl;\n\n if (muiFormControl && muiFormControl.onBlur) {\n muiFormControl.onBlur();\n }\n }\n }\n\n // Holds the input reference\n\n }, {\n key: 'checkDirty',\n value: function checkDirty(obj) {\n var muiFormControl = this.context.muiFormControl;\n\n\n if (isDirty(obj)) {\n if (muiFormControl && muiFormControl.onDirty) {\n muiFormControl.onDirty();\n }\n if (this.props.onDirty) {\n this.props.onDirty();\n }\n return;\n }\n\n if (muiFormControl && muiFormControl.onClean) {\n muiFormControl.onClean();\n }\n if (this.props.onClean) {\n this.props.onClean();\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var _classNames, _classNames2;\n\n var _props = this.props,\n autoComplete = _props.autoComplete,\n autoFocus = _props.autoFocus,\n classes = _props.classes,\n classNameProp = _props.className,\n defaultValue = _props.defaultValue,\n disabledProp = _props.disabled,\n disableUnderline = _props.disableUnderline,\n endAdornment = _props.endAdornment,\n errorProp = _props.error,\n fullWidth = _props.fullWidth,\n id = _props.id,\n inputComponent = _props.inputComponent,\n _props$inputProps = _props.inputProps;\n _props$inputProps = _props$inputProps === undefined ? {} : _props$inputProps;\n var inputPropsClassName = _props$inputProps.className,\n inputPropsProp = (0, _objectWithoutProperties3.default)(_props$inputProps, ['className']),\n inputRef = _props.inputRef,\n marginProp = _props.margin,\n multiline = _props.multiline,\n name = _props.name,\n onBlur = _props.onBlur,\n onChange = _props.onChange,\n onClean = _props.onClean,\n onDirty = _props.onDirty,\n onFocus = _props.onFocus,\n onKeyDown = _props.onKeyDown,\n onKeyUp = _props.onKeyUp,\n placeholder = _props.placeholder,\n readOnly = _props.readOnly,\n rows = _props.rows,\n rowsMax = _props.rowsMax,\n startAdornment = _props.startAdornment,\n type = _props.type,\n value = _props.value,\n other = (0, _objectWithoutProperties3.default)(_props, ['autoComplete', 'autoFocus', 'classes', 'className', 'defaultValue', 'disabled', 'disableUnderline', 'endAdornment', 'error', 'fullWidth', 'id', 'inputComponent', 'inputProps', 'inputRef', 'margin', 'multiline', 'name', 'onBlur', 'onChange', 'onClean', 'onDirty', 'onFocus', 'onKeyDown', 'onKeyUp', 'placeholder', 'readOnly', 'rows', 'rowsMax', 'startAdornment', 'type', 'value']);\n var muiFormControl = this.context.muiFormControl;\n\n var _formControlState = formControlState(this.props, this.context),\n disabled = _formControlState.disabled,\n error = _formControlState.error,\n margin = _formControlState.margin;\n\n var className = (0, _classnames2.default)(classes.root, (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes.disabled, disabled), (0, _defineProperty3.default)(_classNames, classes.error, error), (0, _defineProperty3.default)(_classNames, classes.fullWidth, fullWidth), (0, _defineProperty3.default)(_classNames, classes.focused, this.state.focused), (0, _defineProperty3.default)(_classNames, classes.formControl, muiFormControl), (0, _defineProperty3.default)(_classNames, classes.inkbar, !disableUnderline), (0, _defineProperty3.default)(_classNames, classes.multiline, multiline), (0, _defineProperty3.default)(_classNames, classes.underline, !disableUnderline), _classNames), classNameProp);\n\n var inputClassName = (0, _classnames2.default)(classes.input, (_classNames2 = {}, (0, _defineProperty3.default)(_classNames2, classes.inputDisabled, disabled), (0, _defineProperty3.default)(_classNames2, classes.inputType, type !== 'text'), (0, _defineProperty3.default)(_classNames2, classes.inputMultiline, multiline), (0, _defineProperty3.default)(_classNames2, classes.inputSearch, type === 'search'), (0, _defineProperty3.default)(_classNames2, classes.inputDense, margin === 'dense'), _classNames2), inputPropsClassName);\n\n var required = muiFormControl && muiFormControl.required === true;\n\n var InputComponent = 'input';\n var inputProps = (0, _extends3.default)({}, inputPropsProp, {\n ref: this.handleRefInput\n });\n\n if (inputComponent) {\n InputComponent = inputComponent;\n inputProps = (0, _extends3.default)({\n // Rename ref to inputRef as we don't know the\n // provided `inputComponent` structure.\n inputRef: this.handleRefInput\n }, inputProps, {\n ref: null\n });\n } else if (multiline) {\n if (rows && !rowsMax) {\n InputComponent = 'textarea';\n } else {\n inputProps = (0, _extends3.default)({\n rowsMax: rowsMax,\n textareaRef: this.handleRefInput\n }, inputProps, {\n ref: null\n });\n InputComponent = _Textarea2.default;\n }\n }\n\n return _react2.default.createElement(\n 'div',\n (0, _extends3.default)({ onBlur: this.handleBlur, onFocus: this.handleFocus, className: className }, other),\n startAdornment,\n _react2.default.createElement(InputComponent, (0, _extends3.default)({\n autoComplete: autoComplete,\n autoFocus: autoFocus,\n className: inputClassName,\n onChange: this.handleChange,\n onKeyUp: onKeyUp,\n onKeyDown: onKeyDown,\n disabled: disabled,\n required: required ? true : undefined,\n value: value,\n id: id,\n name: name,\n defaultValue: defaultValue,\n placeholder: placeholder,\n type: type,\n readOnly: readOnly,\n rows: rows,\n 'aria-required': required,\n 'aria-invalid': error\n }, inputProps)),\n endAdornment\n );\n }\n }]);\n return Input;\n}(_react2.default.Component);\n\nInput.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * This property helps users to fill forms faster, especially on mobile devices.\n * The name can be confusing, as it's more like an autofill.\n * You can learn more about it here:\n * https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill\n */\n autoComplete: _propTypes2.default.string,\n /**\n * If `true`, the input will be focused during the first mount.\n */\n autoFocus: _propTypes2.default.bool,\n /**\n * Useful to extend the style applied to components.\n */\n classes: _propTypes2.default.object.isRequired,\n /**\n * The CSS class name of the wrapper element.\n */\n className: _propTypes2.default.string,\n /**\n * The default input value, useful when not controlling the component.\n */\n defaultValue: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]),\n /**\n * If `true`, the input will be disabled.\n */\n disabled: _propTypes2.default.bool,\n /**\n * If `true`, the input will not have an underline.\n */\n disableUnderline: _propTypes2.default.bool,\n /**\n * End `InputAdornment` for this component.\n */\n endAdornment: _propTypes2.default.node,\n /**\n * If `true`, the input will indicate an error. This is normally obtained via context from\n * FormControl.\n */\n error: _propTypes2.default.bool,\n /**\n * If `true`, the input will take up the full width of its container.\n */\n fullWidth: _propTypes2.default.bool,\n /**\n * The id of the `input` element.\n */\n id: _propTypes2.default.string,\n /**\n * The component used for the native input.\n * Either a string to use a DOM element or a component.\n */\n inputComponent: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]),\n /**\n * Properties applied to the `input` element.\n */\n inputProps: _propTypes2.default.object,\n /**\n * Use that property to pass a ref callback to the native input component.\n */\n inputRef: _propTypes2.default.func,\n /**\n * If `dense`, will adjust vertical spacing. This is normally obtained via context from\n * FormControl.\n */\n margin: _propTypes2.default.oneOf(['dense', 'none']),\n /**\n * If `true`, a textarea element will be rendered.\n */\n multiline: _propTypes2.default.bool,\n /**\n * Name attribute of the `input` element.\n */\n name: _propTypes2.default.string,\n /**\n * @ignore\n */\n onBlur: _propTypes2.default.func,\n /**\n * Callback fired when the value is changed.\n *\n * @param {object} event The event source of the callback\n */\n onChange: _propTypes2.default.func,\n /**\n * TODO\n */\n onClean: _propTypes2.default.func,\n /**\n * TODO\n */\n onDirty: _propTypes2.default.func,\n /**\n * @ignore\n */\n onFocus: _propTypes2.default.func,\n /**\n * @ignore\n */\n onKeyDown: _propTypes2.default.func,\n /**\n * @ignore\n */\n onKeyUp: _propTypes2.default.func,\n /**\n * The short hint displayed in the input before the user enters a value.\n */\n placeholder: _propTypes2.default.string,\n /**\n * @ignore\n */\n readOnly: _propTypes2.default.bool,\n /**\n * Number of rows to display when multiline option is set to true.\n */\n rows: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]),\n /**\n * Maximum number of rows to display when multiline option is set to true.\n */\n rowsMax: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]),\n /**\n * Start `InputAdornment` for this component.\n */\n startAdornment: _propTypes2.default.node,\n /**\n * Type of the input element. It should be a valid HTML5 input type.\n */\n type: _propTypes2.default.string,\n /**\n * The input value, required for a controlled component.\n */\n value: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number, _propTypes2.default.arrayOf(_propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]))])\n} : {};\n\nInput.muiName = 'Input';\n\nInput.defaultProps = {\n disableUnderline: false,\n fullWidth: false,\n multiline: false,\n type: 'text'\n};\n\nInput.contextTypes = {\n muiFormControl: _propTypes2.default.object\n};\n\nInput.childContextTypes = {\n muiFormControl: _propTypes2.default.object\n};\n\nexports.default = (0, _withStyles2.default)(styles, { name: 'MuiInput' })(Input);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.styles = undefined;\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _defineProperty2 = require('babel-runtime/helpers/defineProperty');\n\nvar _defineProperty3 = _interopRequireDefault(_defineProperty2);\n\nvar _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');\n\nvar _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _classnames = require('classnames');\n\nvar _classnames2 = _interopRequireDefault(_classnames);\n\nvar _Typography = require('../Typography');\n\nvar _Typography2 = _interopRequireDefault(_Typography);\n\nvar _withStyles = require('../styles/withStyles');\n\nvar _withStyles2 = _interopRequireDefault(_withStyles);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar styles = exports.styles = function styles(theme) {\n return {\n root: {\n display: 'flex',\n maxHeight: '2em',\n alignItems: 'center'\n },\n positionStart: {\n marginRight: theme.spacing.unit\n },\n positionEnd: {\n marginLeft: theme.spacing.unit\n }\n };\n};\n\nfunction InputAdornment(props) {\n var _classNames;\n\n var children = props.children,\n Component = props.component,\n classes = props.classes,\n className = props.className,\n disableTypography = props.disableTypography,\n position = props.position,\n other = (0, _objectWithoutProperties3.default)(props, ['children', 'component', 'classes', 'className', 'disableTypography', 'position']);\n\n\n return _react2.default.createElement(\n Component,\n (0, _extends3.default)({\n className: (0, _classnames2.default)(classes.root, (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes.positionStart, position === 'start'), (0, _defineProperty3.default)(_classNames, classes.positionEnd, position === 'end'), _classNames), className)\n }, other),\n typeof children === 'string' && !disableTypography ? _react2.default.createElement(\n _Typography2.default,\n { color: 'textSecondary' },\n children\n ) : children\n );\n}\n\nInputAdornment.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * The content of the component, normally an `IconButton` or string.\n */\n children: _propTypes2.default.node.isRequired,\n /**\n * Useful to extend the style applied to components.\n */\n classes: _propTypes2.default.object.isRequired,\n /**\n * @ignore\n */\n className: _propTypes2.default.string,\n /**\n * The component used for the root node.\n * Either a string to use a DOM element or a component.\n */\n component: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]),\n /**\n * If children is a string then disable wrapping in a Typography component.\n */\n disableTypography: _propTypes2.default.bool,\n /**\n * The position this adornment should appear relative to the `Input`.\n */\n position: _propTypes2.default.oneOf(['start', 'end'])\n} : {};\n\nInputAdornment.defaultProps = {\n component: 'div',\n disableTypography: false\n};\n\nexports.default = (0, _withStyles2.default)(styles, { name: 'MuiInputAdornment' })(InputAdornment);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.styles = undefined;\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _defineProperty2 = require('babel-runtime/helpers/defineProperty');\n\nvar _defineProperty3 = _interopRequireDefault(_defineProperty2);\n\nvar _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');\n\nvar _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _classnames = require('classnames');\n\nvar _classnames2 = _interopRequireDefault(_classnames);\n\nvar _withStyles = require('../styles/withStyles');\n\nvar _withStyles2 = _interopRequireDefault(_withStyles);\n\nvar _Form = require('../Form');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar styles = exports.styles = function styles(theme) {\n return {\n root: {\n transformOrigin: 'top left'\n },\n formControl: {\n position: 'absolute',\n left: 0,\n top: 0,\n // slight alteration to spec spacing to match visual spec result\n transform: 'translate(0, ' + theme.spacing.unit * 3 + 'px) scale(1)'\n },\n labelDense: {\n // Compensation for the `Input.inputDense` style.\n transform: 'translate(0, ' + (theme.spacing.unit * 2.5 + 1) + 'px) scale(1)'\n },\n shrink: {\n transform: 'translate(0, 1.5px) scale(0.75)',\n transformOrigin: 'top left'\n },\n animated: {\n transition: theme.transitions.create('transform', {\n duration: theme.transitions.duration.shorter,\n easing: theme.transitions.easing.easeOut\n })\n },\n disabled: {\n color: theme.palette.text.disabled\n }\n };\n}; // @inheritedComponent FormLabel\n\nfunction InputLabel(props, context) {\n var _classNames;\n\n var children = props.children,\n classes = props.classes,\n classNameProp = props.className,\n disableAnimation = props.disableAnimation,\n disabled = props.disabled,\n FormControlClasses = props.FormControlClasses,\n marginProp = props.margin,\n shrinkProp = props.shrink,\n other = (0, _objectWithoutProperties3.default)(props, ['children', 'classes', 'className', 'disableAnimation', 'disabled', 'FormControlClasses', 'margin', 'shrink']);\n var muiFormControl = context.muiFormControl;\n\n var shrink = shrinkProp;\n\n if (typeof shrink === 'undefined' && muiFormControl) {\n shrink = muiFormControl.dirty || muiFormControl.focused || muiFormControl.adornedStart;\n }\n\n var margin = marginProp;\n if (typeof margin === 'undefined' && muiFormControl) {\n margin = muiFormControl.margin;\n }\n\n var className = (0, _classnames2.default)(classes.root, (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes.formControl, muiFormControl), (0, _defineProperty3.default)(_classNames, classes.animated, !disableAnimation), (0, _defineProperty3.default)(_classNames, classes.shrink, shrink), (0, _defineProperty3.default)(_classNames, classes.disabled, disabled), (0, _defineProperty3.default)(_classNames, classes.labelDense, margin === 'dense'), _classNames), classNameProp);\n\n return _react2.default.createElement(\n _Form.FormLabel,\n (0, _extends3.default)({ 'data-shrink': shrink, className: className, classes: FormControlClasses }, other),\n children\n );\n}\n\nInputLabel.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * The contents of the `InputLabel`.\n */\n children: _propTypes2.default.node,\n /**\n * Useful to extend the style applied to components.\n */\n classes: _propTypes2.default.object.isRequired,\n /**\n * @ignore\n */\n className: _propTypes2.default.string,\n /**\n * If `true`, the transition animation is disabled.\n */\n disableAnimation: _propTypes2.default.bool,\n /**\n * If `true`, apply disabled class.\n */\n disabled: _propTypes2.default.bool,\n /**\n * If `true`, the label will be displayed in an error state.\n */\n error: _propTypes2.default.bool,\n /**\n * If `true`, the input of this label is focused.\n */\n focused: _propTypes2.default.bool,\n /**\n * `classes` property applied to the `FormControl` element.\n */\n FormControlClasses: _propTypes2.default.object,\n /**\n * If `dense`, will adjust vertical spacing. This is normally obtained via context from\n * FormControl.\n */\n margin: _propTypes2.default.oneOf(['dense']),\n /**\n * if `true`, the label will indicate that the input is required.\n */\n required: _propTypes2.default.bool,\n /**\n * If `true`, the label is shrunk.\n */\n shrink: _propTypes2.default.bool\n} : {};\n\nInputLabel.defaultProps = {\n disabled: false,\n disableAnimation: false\n};\n\nInputLabel.contextTypes = {\n muiFormControl: _propTypes2.default.object\n};\n\nexports.default = (0, _withStyles2.default)(styles, { name: 'MuiInputLabel' })(InputLabel);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.styles = undefined;\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');\n\nvar _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);\n\nvar _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = require('babel-runtime/helpers/createClass');\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = require('babel-runtime/helpers/inherits');\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _classnames = require('classnames');\n\nvar _classnames2 = _interopRequireDefault(_classnames);\n\nvar _debounce = require('lodash/debounce');\n\nvar _debounce2 = _interopRequireDefault(_debounce);\n\nvar _reactEventListener = require('react-event-listener');\n\nvar _reactEventListener2 = _interopRequireDefault(_reactEventListener);\n\nvar _withStyles = require('../styles/withStyles');\n\nvar _withStyles2 = _interopRequireDefault(_withStyles);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar ROWS_HEIGHT = 19;\n\nvar styles = exports.styles = {\n root: {\n position: 'relative', // because the shadow has position: 'absolute',\n width: '100%'\n },\n textarea: {\n width: '100%',\n height: '100%',\n resize: 'none',\n font: 'inherit',\n padding: 0,\n cursor: 'inherit',\n boxSizing: 'border-box',\n lineHeight: 'inherit',\n border: 'none',\n outline: 'none',\n background: 'transparent'\n },\n shadow: {\n resize: 'none',\n // Overflow also needed to here to remove the extra row\n // added to textareas in Firefox.\n overflow: 'hidden',\n // Visibility needed to hide the extra text area on ipads\n visibility: 'hidden',\n position: 'absolute',\n height: 'auto',\n whiteSpace: 'pre-wrap'\n }\n};\n\n/**\n * @ignore - internal component.\n */\n\nvar Textarea = function (_React$Component) {\n (0, _inherits3.default)(Textarea, _React$Component);\n\n function Textarea() {\n var _ref;\n\n var _temp, _this, _ret;\n\n (0, _classCallCheck3.default)(this, Textarea);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = Textarea.__proto__ || (0, _getPrototypeOf2.default)(Textarea)).call.apply(_ref, [this].concat(args))), _this), _this.state = {\n height: null\n }, _this.shadow = null, _this.singlelineShadow = null, _this.input = null, _this.value = null, _this.handleResize = (0, _debounce2.default)(function (event) {\n _this.syncHeightWithShadow(event);\n }, 166), _this.handleRefInput = function (node) {\n _this.input = node;\n if (_this.props.textareaRef) {\n _this.props.textareaRef(node);\n }\n }, _this.handleRefSinglelineShadow = function (node) {\n _this.singlelineShadow = node;\n }, _this.handleRefShadow = function (node) {\n _this.shadow = node;\n }, _this.handleChange = function (event) {\n _this.value = event.target.value;\n\n if (typeof _this.props.value === 'undefined' && _this.shadow) {\n // The component is not controlled, we need to update the shallow value.\n _this.shadow.value = _this.value;\n _this.syncHeightWithShadow(event);\n }\n\n if (_this.props.onChange) {\n _this.props.onChange(event);\n }\n }, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret);\n }\n\n (0, _createClass3.default)(Textarea, [{\n key: 'componentWillMount',\n value: function componentWillMount() {\n // expects the components it renders to respond to 'value'\n // so that it can check whether they are dirty\n this.value = this.props.value || this.props.defaultValue || '';\n this.setState({\n height: Number(this.props.rows) * ROWS_HEIGHT\n });\n }\n }, {\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.syncHeightWithShadow(null);\n }\n }, {\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps(nextProps) {\n if (nextProps.value !== this.props.value || Number(nextProps.rowsMax) !== Number(this.props.rowsMax)) {\n this.syncHeightWithShadow(null, nextProps);\n }\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n this.handleResize.cancel();\n }\n }, {\n key: 'syncHeightWithShadow',\n value: function syncHeightWithShadow(event) {\n var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.props;\n\n if (this.shadow && this.singlelineShadow) {\n // The component is controlled, we need to update the shallow value.\n if (typeof this.props.value !== 'undefined') {\n this.shadow.value = props.value == null ? '' : String(props.value);\n }\n\n var lineHeight = this.singlelineShadow.scrollHeight;\n var newHeight = this.shadow.scrollHeight;\n\n // Guarding for jsdom, where scrollHeight isn't present.\n // See https://github.com/tmpvar/jsdom/issues/1013\n if (newHeight === undefined) {\n return;\n }\n\n if (Number(props.rowsMax) >= Number(props.rows)) {\n newHeight = Math.min(Number(props.rowsMax) * lineHeight, newHeight);\n }\n\n newHeight = Math.max(newHeight, lineHeight);\n\n if (this.state.height !== newHeight) {\n this.setState({\n height: newHeight\n });\n }\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var _props = this.props,\n classes = _props.classes,\n className = _props.className,\n defaultValue = _props.defaultValue,\n onChange = _props.onChange,\n rows = _props.rows,\n rowsMax = _props.rowsMax,\n textareaRef = _props.textareaRef,\n value = _props.value,\n other = (0, _objectWithoutProperties3.default)(_props, ['classes', 'className', 'defaultValue', 'onChange', 'rows', 'rowsMax', 'textareaRef', 'value']);\n\n\n return _react2.default.createElement(\n 'div',\n { className: classes.root, style: { height: this.state.height } },\n _react2.default.createElement(_reactEventListener2.default, { target: 'window', onResize: this.handleResize }),\n _react2.default.createElement('textarea', {\n ref: this.handleRefSinglelineShadow,\n className: (0, _classnames2.default)(classes.shadow, classes.textarea),\n tabIndex: -1,\n rows: '1',\n readOnly: true,\n 'aria-hidden': 'true',\n value: ''\n }),\n _react2.default.createElement('textarea', {\n ref: this.handleRefShadow,\n className: (0, _classnames2.default)(classes.shadow, classes.textarea),\n tabIndex: -1,\n rows: rows,\n 'aria-hidden': 'true',\n readOnly: true,\n defaultValue: defaultValue,\n value: value\n }),\n _react2.default.createElement('textarea', (0, _extends3.default)({\n rows: rows,\n className: (0, _classnames2.default)(classes.textarea, className),\n defaultValue: defaultValue,\n value: value,\n onChange: this.handleChange,\n ref: this.handleRefInput\n }, other))\n );\n }\n }]);\n return Textarea;\n}(_react2.default.Component);\n\nTextarea.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * Useful to extend the style applied to components.\n */\n classes: _propTypes2.default.object.isRequired,\n /**\n * @ignore\n */\n className: _propTypes2.default.string,\n /**\n * @ignore\n */\n defaultValue: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]),\n /**\n * @ignore\n */\n disabled: _propTypes2.default.bool,\n /**\n * @ignore\n */\n onChange: _propTypes2.default.func,\n /**\n * Number of rows to display when multiline option is set to true.\n */\n rows: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]),\n /**\n * Maximum number of rows to display when multiline option is set to true.\n */\n rowsMax: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]),\n /**\n * Use that property to pass a ref callback to the native textarea element.\n */\n textareaRef: _propTypes2.default.func,\n /**\n * @ignore\n */\n value: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number])\n} : {};\n\nTextarea.defaultProps = {\n rows: 1\n};\n\nexports.default = (0, _withStyles2.default)(styles, { name: 'MuiTextarea' })(Textarea);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _Input = require('./Input');\n\nObject.defineProperty(exports, 'default', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_Input).default;\n }\n});\n\nvar _InputAdornment = require('./InputAdornment');\n\nObject.defineProperty(exports, 'InputAdornment', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_InputAdornment).default;\n }\n});\n\nvar _InputLabel = require('./InputLabel');\n\nObject.defineProperty(exports, 'InputLabel', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_InputLabel).default;\n }\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.styles = undefined;\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _defineProperty2 = require('babel-runtime/helpers/defineProperty');\n\nvar _defineProperty3 = _interopRequireDefault(_defineProperty2);\n\nvar _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');\n\nvar _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);\n\nvar _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = require('babel-runtime/helpers/createClass');\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = require('babel-runtime/helpers/inherits');\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _classnames = require('classnames');\n\nvar _classnames2 = _interopRequireDefault(_classnames);\n\nvar _withStyles = require('../styles/withStyles');\n\nvar _withStyles2 = _interopRequireDefault(_withStyles);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar styles = exports.styles = function styles(theme) {\n return {\n root: {\n listStyle: 'none',\n margin: 0,\n padding: 0,\n position: 'relative'\n },\n padding: {\n paddingTop: theme.spacing.unit,\n paddingBottom: theme.spacing.unit\n },\n dense: {\n paddingTop: theme.spacing.unit / 2,\n paddingBottom: theme.spacing.unit / 2\n },\n subheader: {\n paddingTop: 0\n }\n };\n};\n\nvar List = function (_React$Component) {\n (0, _inherits3.default)(List, _React$Component);\n\n function List() {\n (0, _classCallCheck3.default)(this, List);\n return (0, _possibleConstructorReturn3.default)(this, (List.__proto__ || (0, _getPrototypeOf2.default)(List)).apply(this, arguments));\n }\n\n (0, _createClass3.default)(List, [{\n key: 'getChildContext',\n value: function getChildContext() {\n return {\n dense: this.props.dense\n };\n }\n }, {\n key: 'render',\n value: function render() {\n var _classNames;\n\n var _props = this.props,\n children = _props.children,\n classes = _props.classes,\n classNameProp = _props.className,\n Component = _props.component,\n dense = _props.dense,\n disablePadding = _props.disablePadding,\n subheader = _props.subheader,\n other = (0, _objectWithoutProperties3.default)(_props, ['children', 'classes', 'className', 'component', 'dense', 'disablePadding', 'subheader']);\n\n var className = (0, _classnames2.default)(classes.root, (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes.dense, dense && !disablePadding), (0, _defineProperty3.default)(_classNames, classes.padding, !disablePadding), (0, _defineProperty3.default)(_classNames, classes.subheader, subheader), _classNames), classNameProp);\n\n return _react2.default.createElement(\n Component,\n (0, _extends3.default)({ className: className }, other),\n subheader,\n children\n );\n }\n }]);\n return List;\n}(_react2.default.Component);\n\nList.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * The content of the component.\n */\n children: _propTypes2.default.node,\n /**\n * Useful to extend the style applied to components.\n */\n classes: _propTypes2.default.object.isRequired,\n /**\n * @ignore\n */\n className: _propTypes2.default.string,\n /**\n * The component used for the root node.\n * Either a string to use a DOM element or a component.\n */\n component: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]),\n /**\n * If `true`, compact vertical padding designed for keyboard and mouse input will be used for\n * the list and list items. The property is available to descendant components as the\n * `dense` context.\n */\n dense: _propTypes2.default.bool,\n /**\n * If `true`, vertical padding will be removed from the list.\n */\n disablePadding: _propTypes2.default.bool,\n /**\n * The content of the subheader, normally `ListSubheader`.\n */\n subheader: _propTypes2.default.node\n} : {};\n\nList.defaultProps = {\n component: 'ul',\n dense: false,\n disablePadding: false\n};\n\nList.childContextTypes = {\n dense: _propTypes2.default.bool\n};\n\nexports.default = (0, _withStyles2.default)(styles, { name: 'MuiList' })(List);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.styles = undefined;\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _defineProperty2 = require('babel-runtime/helpers/defineProperty');\n\nvar _defineProperty3 = _interopRequireDefault(_defineProperty2);\n\nvar _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');\n\nvar _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);\n\nvar _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = require('babel-runtime/helpers/createClass');\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = require('babel-runtime/helpers/inherits');\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _classnames = require('classnames');\n\nvar _classnames2 = _interopRequireDefault(_classnames);\n\nvar _withStyles = require('../styles/withStyles');\n\nvar _withStyles2 = _interopRequireDefault(_withStyles);\n\nvar _ButtonBase = require('../ButtonBase');\n\nvar _ButtonBase2 = _interopRequireDefault(_ButtonBase);\n\nvar _reactHelpers = require('../utils/reactHelpers');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar styles = exports.styles = function styles(theme) {\n return {\n root: {\n display: 'flex',\n justifyContent: 'flex-start',\n alignItems: 'center',\n position: 'relative',\n textDecoration: 'none',\n width: '100%',\n boxSizing: 'border-box',\n textAlign: 'left'\n },\n container: {\n position: 'relative'\n },\n keyboardFocused: {\n backgroundColor: theme.palette.action.hover\n },\n default: {\n paddingTop: 12,\n paddingBottom: 12\n },\n dense: {\n paddingTop: theme.spacing.unit,\n paddingBottom: theme.spacing.unit\n },\n disabled: {\n opacity: 0.5\n },\n divider: {\n borderBottom: '1px solid ' + theme.palette.divider,\n backgroundClip: 'padding-box'\n },\n gutters: {\n paddingLeft: theme.spacing.unit * 2,\n paddingRight: theme.spacing.unit * 2\n },\n button: {\n transition: theme.transitions.create('background-color', {\n duration: theme.transitions.duration.shortest\n }),\n '&:hover': {\n textDecoration: 'none',\n backgroundColor: theme.palette.action.hover,\n // Reset on mouse devices\n '@media (hover: none)': {\n backgroundColor: 'transparent'\n }\n }\n },\n secondaryAction: {\n // Add some space to avoid collision as `ListItemSecondaryAction`\n // is absolutely positionned.\n paddingRight: theme.spacing.unit * 4\n }\n };\n};\n\nvar ListItem = function (_React$Component) {\n (0, _inherits3.default)(ListItem, _React$Component);\n\n function ListItem() {\n (0, _classCallCheck3.default)(this, ListItem);\n return (0, _possibleConstructorReturn3.default)(this, (ListItem.__proto__ || (0, _getPrototypeOf2.default)(ListItem)).apply(this, arguments));\n }\n\n (0, _createClass3.default)(ListItem, [{\n key: 'getChildContext',\n value: function getChildContext() {\n return {\n dense: this.props.dense || this.context.dense || false\n };\n }\n }, {\n key: 'render',\n value: function render() {\n var _classNames;\n\n var _props = this.props,\n button = _props.button,\n childrenProp = _props.children,\n classes = _props.classes,\n classNameProp = _props.className,\n componentProp = _props.component,\n ContainerComponent = _props.ContainerComponent,\n ContainerProps = _props.ContainerProps,\n dense = _props.dense,\n disabled = _props.disabled,\n disableGutters = _props.disableGutters,\n divider = _props.divider,\n other = (0, _objectWithoutProperties3.default)(_props, ['button', 'children', 'classes', 'className', 'component', 'ContainerComponent', 'ContainerProps', 'dense', 'disabled', 'disableGutters', 'divider']);\n\n\n var isDense = dense || this.context.dense || false;\n var children = _react2.default.Children.toArray(childrenProp);\n var hasAvatar = children.some(function (value) {\n return (0, _reactHelpers.isMuiElement)(value, ['ListItemAvatar']);\n });\n var hasSecondaryAction = children.length && (0, _reactHelpers.isMuiElement)(children[children.length - 1], ['ListItemSecondaryAction']);\n\n var className = (0, _classnames2.default)(classes.root, isDense || hasAvatar ? classes.dense : classes.default, (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes.gutters, !disableGutters), (0, _defineProperty3.default)(_classNames, classes.divider, divider), (0, _defineProperty3.default)(_classNames, classes.disabled, disabled), (0, _defineProperty3.default)(_classNames, classes.button, button), (0, _defineProperty3.default)(_classNames, classes.secondaryAction, hasSecondaryAction), _classNames), classNameProp);\n\n var componentProps = (0, _extends3.default)({ className: className, disabled: disabled }, other);\n var Component = componentProp || 'li';\n\n if (button) {\n componentProps.component = componentProp || 'div';\n componentProps.keyboardFocusedClassName = classes.keyboardFocused;\n Component = _ButtonBase2.default;\n }\n\n if (hasSecondaryAction) {\n Component = Component !== _ButtonBase2.default && !componentProp ? 'div' : Component;\n\n return _react2.default.createElement(\n ContainerComponent,\n (0, _extends3.default)({ className: classes.container }, ContainerProps),\n _react2.default.createElement(\n Component,\n componentProps,\n children\n ),\n children.pop()\n );\n }\n\n return _react2.default.createElement(\n Component,\n componentProps,\n children\n );\n }\n }]);\n return ListItem;\n}(_react2.default.Component);\n\nListItem.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * If `true`, the list item will be a button (using `ButtonBase`).\n */\n button: _propTypes2.default.bool,\n /**\n * The content of the component.\n */\n children: _propTypes2.default.node,\n /**\n * Useful to extend the style applied to components.\n */\n classes: _propTypes2.default.object.isRequired,\n /**\n * @ignore\n */\n className: _propTypes2.default.string,\n /**\n * The component used for the root node.\n * Either a string to use a DOM element or a component.\n * By default, it's a `li` when `button` is `false` and a `div` when `button` is `true`.\n */\n component: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]),\n /**\n * The container component. Useful when a `ListItemSecondaryAction` is rendered.\n */\n ContainerComponent: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]),\n /**\n * Properties applied to the container element when the component\n * is used to display a `ListItemSecondaryAction`.\n */\n ContainerProps: _propTypes2.default.object,\n /**\n * If `true`, compact vertical padding designed for keyboard and mouse input will be used.\n */\n dense: _propTypes2.default.bool,\n /**\n * @ignore\n */\n disabled: _propTypes2.default.bool,\n /**\n * If `true`, the left and right padding is removed.\n */\n disableGutters: _propTypes2.default.bool,\n /**\n * If `true`, a 1px light border is added to the bottom of the list item.\n */\n divider: _propTypes2.default.bool\n} : {};\n\nListItem.defaultProps = {\n button: false,\n ContainerComponent: 'li',\n dense: false,\n disabled: false,\n disableGutters: false,\n divider: false\n};\n\nListItem.contextTypes = {\n dense: _propTypes2.default.bool\n};\n\nListItem.childContextTypes = {\n dense: _propTypes2.default.bool\n};\n\nexports.default = (0, _withStyles2.default)(styles, { name: 'MuiListItem' })(ListItem);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.styles = undefined;\n\nvar _defineProperty2 = require('babel-runtime/helpers/defineProperty');\n\nvar _defineProperty3 = _interopRequireDefault(_defineProperty2);\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');\n\nvar _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _classnames = require('classnames');\n\nvar _classnames2 = _interopRequireDefault(_classnames);\n\nvar _warning = require('warning');\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nvar _withStyles = require('../styles/withStyles');\n\nvar _withStyles2 = _interopRequireDefault(_withStyles);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar styles = exports.styles = function styles(theme) {\n return {\n root: {\n width: 36,\n height: 36,\n fontSize: theme.typography.pxToRem(18),\n marginRight: 4\n },\n icon: {\n width: 20,\n height: 20,\n fontSize: theme.typography.pxToRem(20)\n }\n };\n};\n\n/**\n * It's a simple wrapper to apply the `dense` mode styles to `Avatar`.\n */\nfunction ListItemAvatar(props, context) {\n var children = props.children,\n classes = props.classes,\n classNameProp = props.className,\n other = (0, _objectWithoutProperties3.default)(props, ['children', 'classes', 'className']);\n\n\n if (context.dense === undefined) {\n process.env.NODE_ENV !== \"production\" ? (0, _warning2.default)(false, 'Material-UI: is a simple wrapper to apply the dense styles\\n to . You do not need it unless you are controlling the dense property.') : void 0;\n return props.children;\n }\n\n return _react2.default.cloneElement(children, (0, _extends3.default)({\n className: (0, _classnames2.default)((0, _defineProperty3.default)({}, classes.root, context.dense), classNameProp, children.props.className),\n childrenClassName: (0, _classnames2.default)((0, _defineProperty3.default)({}, classes.icon, context.dense), children.props.childrenClassName)\n }, other));\n}\n\nListItemAvatar.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * The content of the component, normally `Avatar`.\n */\n children: _propTypes2.default.element.isRequired,\n /**\n * Useful to extend the style applied to components.\n */\n classes: _propTypes2.default.object.isRequired,\n /**\n * @ignore\n */\n className: _propTypes2.default.string\n} : {};\n\nListItemAvatar.contextTypes = {\n dense: _propTypes2.default.bool\n};\n\nListItemAvatar.muiName = 'ListItemAvatar';\n\nexports.default = (0, _withStyles2.default)(styles, { name: 'MuiListItemAvatar' })(ListItemAvatar);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.styles = undefined;\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');\n\nvar _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _classnames = require('classnames');\n\nvar _classnames2 = _interopRequireDefault(_classnames);\n\nvar _withStyles = require('../styles/withStyles');\n\nvar _withStyles2 = _interopRequireDefault(_withStyles);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar styles = exports.styles = function styles(theme) {\n return {\n root: {\n height: 24,\n marginRight: theme.spacing.unit * 2,\n width: 24,\n color: theme.palette.action.active,\n flexShrink: 0\n }\n };\n};\n\n/**\n * A simple wrapper to apply `List` styles to an `Icon` or `SvgIcon`.\n */\nfunction ListItemIcon(props) {\n var children = props.children,\n classes = props.classes,\n classNameProp = props.className,\n other = (0, _objectWithoutProperties3.default)(props, ['children', 'classes', 'className']);\n\n\n return _react2.default.cloneElement(children, (0, _extends3.default)({\n className: (0, _classnames2.default)(classes.root, classNameProp, children.props.className)\n }, other));\n}\n\nListItemIcon.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * The content of the component, normally `Icon`, `SvgIcon`,\n * or a `material-ui-icons` SVG icon component.\n */\n children: _propTypes2.default.element.isRequired,\n /**\n * Useful to extend the style applied to components.\n */\n classes: _propTypes2.default.object.isRequired,\n /**\n * @ignore\n */\n className: _propTypes2.default.string\n} : {};\n\nexports.default = (0, _withStyles2.default)(styles, { name: 'MuiListItemIcon' })(ListItemIcon);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.styles = undefined;\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');\n\nvar _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _classnames = require('classnames');\n\nvar _classnames2 = _interopRequireDefault(_classnames);\n\nvar _withStyles = require('../styles/withStyles');\n\nvar _withStyles2 = _interopRequireDefault(_withStyles);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar styles = exports.styles = function styles(theme) {\n return {\n root: {\n position: 'absolute',\n right: 4,\n top: '50%',\n marginTop: -theme.spacing.unit * 3\n }\n };\n};\n\nfunction ListItemSecondaryAction(props) {\n var children = props.children,\n classes = props.classes,\n className = props.className,\n other = (0, _objectWithoutProperties3.default)(props, ['children', 'classes', 'className']);\n\n\n return _react2.default.createElement(\n 'div',\n (0, _extends3.default)({ className: (0, _classnames2.default)(classes.root, className) }, other),\n children\n );\n}\n\nListItemSecondaryAction.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * The content of the component, normally an `IconButton` or selection control.\n */\n children: _propTypes2.default.node,\n /**\n * Useful to extend the style applied to components.\n */\n classes: _propTypes2.default.object.isRequired,\n /**\n * @ignore\n */\n className: _propTypes2.default.string\n} : {};\n\nListItemSecondaryAction.muiName = 'ListItemSecondaryAction';\n\nexports.default = (0, _withStyles2.default)(styles, { name: 'MuiListItemSecondaryAction' })(ListItemSecondaryAction);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.styles = undefined;\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _defineProperty2 = require('babel-runtime/helpers/defineProperty');\n\nvar _defineProperty3 = _interopRequireDefault(_defineProperty2);\n\nvar _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');\n\nvar _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _classnames = require('classnames');\n\nvar _classnames2 = _interopRequireDefault(_classnames);\n\nvar _withStyles = require('../styles/withStyles');\n\nvar _withStyles2 = _interopRequireDefault(_withStyles);\n\nvar _Typography = require('../Typography');\n\nvar _Typography2 = _interopRequireDefault(_Typography);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar styles = exports.styles = function styles(theme) {\n return {\n root: {\n flex: '1 1 auto',\n minWidth: 0,\n padding: '0 16px',\n '&:first-child': {\n paddingLeft: 0\n }\n },\n inset: {\n '&:first-child': {\n paddingLeft: theme.spacing.unit * 7\n }\n },\n dense: {\n fontSize: theme.typography.pxToRem(13)\n },\n primary: {\n '&$textDense': {\n fontSize: 'inherit'\n }\n },\n secondary: {\n '&$textDense': {\n fontSize: 'inherit'\n }\n },\n textDense: {}\n };\n};\n\nfunction ListItemText(props, context) {\n var _classNames;\n\n var classes = props.classes,\n classNameProp = props.className,\n disableTypography = props.disableTypography,\n inset = props.inset,\n primary = props.primary,\n secondary = props.secondary,\n other = (0, _objectWithoutProperties3.default)(props, ['classes', 'className', 'disableTypography', 'inset', 'primary', 'secondary']);\n var dense = context.dense;\n\n var className = (0, _classnames2.default)(classes.root, (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes.dense, dense), (0, _defineProperty3.default)(_classNames, classes.inset, inset), _classNames), classNameProp);\n\n return _react2.default.createElement(\n 'div',\n (0, _extends3.default)({ className: className }, other),\n primary && (disableTypography ? primary : _react2.default.createElement(\n _Typography2.default,\n {\n variant: 'subheading',\n className: (0, _classnames2.default)(classes.primary, (0, _defineProperty3.default)({}, classes.textDense, dense))\n },\n primary\n )),\n secondary && (disableTypography ? secondary : _react2.default.createElement(\n _Typography2.default,\n {\n variant: 'body1',\n className: (0, _classnames2.default)(classes.secondary, (0, _defineProperty3.default)({}, classes.textDense, dense)),\n color: 'textSecondary'\n },\n secondary\n ))\n );\n}\n\nListItemText.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * Useful to extend the style applied to components.\n */\n classes: _propTypes2.default.object.isRequired,\n /**\n * @ignore\n */\n className: _propTypes2.default.string,\n /**\n * If `true`, the children won't be wrapped by a typography component.\n * For instance, that can be useful to can render an h4 instead of a\n */\n disableTypography: _propTypes2.default.bool,\n /**\n * If `true`, the children will be indented.\n * This should be used if there is no left avatar or left icon.\n */\n inset: _propTypes2.default.bool,\n primary: _propTypes2.default.node,\n secondary: _propTypes2.default.node\n} : {};\n\nListItemText.defaultProps = {\n disableTypography: false,\n inset: false,\n primary: false,\n secondary: false\n};\n\nListItemText.contextTypes = {\n dense: _propTypes2.default.bool\n};\n\nexports.default = (0, _withStyles2.default)(styles, { name: 'MuiListItemText' })(ListItemText);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.styles = undefined;\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _defineProperty2 = require('babel-runtime/helpers/defineProperty');\n\nvar _defineProperty3 = _interopRequireDefault(_defineProperty2);\n\nvar _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');\n\nvar _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _classnames = require('classnames');\n\nvar _classnames2 = _interopRequireDefault(_classnames);\n\nvar _withStyles = require('../styles/withStyles');\n\nvar _withStyles2 = _interopRequireDefault(_withStyles);\n\nvar _helpers = require('../utils/helpers');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar styles = exports.styles = function styles(theme) {\n return {\n root: {\n boxSizing: 'border-box',\n lineHeight: '48px',\n listStyle: 'none',\n paddingLeft: theme.spacing.unit * 2,\n paddingRight: theme.spacing.unit * 2,\n color: theme.palette.text.secondary,\n fontFamily: theme.typography.fontFamily,\n fontWeight: theme.typography.fontWeightMedium,\n fontSize: theme.typography.pxToRem(theme.typography.fontSize)\n },\n colorPrimary: {\n color: theme.palette.primary.main\n },\n colorInherit: {\n color: 'inherit'\n },\n inset: {\n paddingLeft: theme.spacing.unit * 9\n },\n sticky: {\n position: 'sticky',\n top: 0,\n zIndex: 1,\n backgroundColor: 'inherit'\n }\n };\n};\n\nfunction ListSubheader(props) {\n var _classNames;\n\n var classes = props.classes,\n classNameProp = props.className,\n color = props.color,\n Component = props.component,\n disableSticky = props.disableSticky,\n inset = props.inset,\n other = (0, _objectWithoutProperties3.default)(props, ['classes', 'className', 'color', 'component', 'disableSticky', 'inset']);\n\n var className = (0, _classnames2.default)(classes.root, (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes['color' + (0, _helpers.capitalize)(color)], color !== 'default'), (0, _defineProperty3.default)(_classNames, classes.inset, inset), (0, _defineProperty3.default)(_classNames, classes.sticky, !disableSticky), _classNames), classNameProp);\n\n return _react2.default.createElement(Component, (0, _extends3.default)({ className: className }, other));\n}\n\nListSubheader.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * The content of the component.\n */\n children: _propTypes2.default.node,\n /**\n * Useful to extend the style applied to components.\n */\n classes: _propTypes2.default.object.isRequired,\n /**\n * @ignore\n */\n className: _propTypes2.default.string,\n /**\n * The color of the component. It supports those theme colors that make sense for this component.\n */\n color: _propTypes2.default.oneOf(['default', 'primary', 'inherit']),\n /**\n * The component used for the root node.\n * Either a string to use a DOM element or a component.\n */\n component: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]),\n /**\n * If `true`, the List Subheader will not stick to the top during scroll.\n */\n disableSticky: _propTypes2.default.bool,\n /**\n * If `true`, the List Subheader will be indented.\n */\n inset: _propTypes2.default.bool\n} : {};\n\nListSubheader.defaultProps = {\n color: 'default',\n component: 'li',\n disableSticky: false,\n inset: false\n};\n\nListSubheader.muiName = 'ListSubheader';\n\nexports.default = (0, _withStyles2.default)(styles, { name: 'MuiListSubheader' })(ListSubheader);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _List = require('./List');\n\nObject.defineProperty(exports, 'default', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_List).default;\n }\n});\n\nvar _ListItem = require('./ListItem');\n\nObject.defineProperty(exports, 'ListItem', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_ListItem).default;\n }\n});\n\nvar _ListItemAvatar = require('./ListItemAvatar');\n\nObject.defineProperty(exports, 'ListItemAvatar', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_ListItemAvatar).default;\n }\n});\n\nvar _ListItemText = require('./ListItemText');\n\nObject.defineProperty(exports, 'ListItemText', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_ListItemText).default;\n }\n});\n\nvar _ListItemIcon = require('./ListItemIcon');\n\nObject.defineProperty(exports, 'ListItemIcon', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_ListItemIcon).default;\n }\n});\n\nvar _ListItemSecondaryAction = require('./ListItemSecondaryAction');\n\nObject.defineProperty(exports, 'ListItemSecondaryAction', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_ListItemSecondaryAction).default;\n }\n});\n\nvar _ListSubheader = require('./ListSubheader');\n\nObject.defineProperty(exports, 'ListSubheader', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_ListSubheader).default;\n }\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.styles = undefined;\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');\n\nvar _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);\n\nvar _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = require('babel-runtime/helpers/createClass');\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = require('babel-runtime/helpers/inherits');\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _reactDom = require('react-dom');\n\nvar _scrollbarSize = require('dom-helpers/util/scrollbarSize');\n\nvar _scrollbarSize2 = _interopRequireDefault(_scrollbarSize);\n\nvar _withStyles = require('../styles/withStyles');\n\nvar _withStyles2 = _interopRequireDefault(_withStyles);\n\nvar _Popover = require('../Popover');\n\nvar _Popover2 = _interopRequireDefault(_Popover);\n\nvar _MenuList = require('./MenuList');\n\nvar _MenuList2 = _interopRequireDefault(_MenuList);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar RTL_ORIGIN = {\n vertical: 'top',\n horizontal: 'right'\n}; // @inheritedComponent Popover\n\nvar LTR_ORIGIN = {\n vertical: 'top',\n horizontal: 'left'\n};\n\nvar styles = exports.styles = {\n paper: {\n // specZ: The maximum height of a simple menu should be one or more rows less than the view\n // height. This ensures a tappable area outside of the simple menu with which to dismiss\n // the menu.\n maxHeight: 'calc(100vh - 96px)',\n // Add iOS momentum scrolling.\n WebkitOverflowScrolling: 'touch'\n }\n};\n\nvar Menu = function (_React$Component) {\n (0, _inherits3.default)(Menu, _React$Component);\n\n function Menu() {\n var _ref;\n\n var _temp, _this, _ret;\n\n (0, _classCallCheck3.default)(this, Menu);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = Menu.__proto__ || (0, _getPrototypeOf2.default)(Menu)).call.apply(_ref, [this].concat(args))), _this), _this.getContentAnchorEl = function () {\n if (!_this.menuList || !_this.menuList.selectedItem) {\n return (0, _reactDom.findDOMNode)(_this.menuList).firstChild;\n }\n\n return (0, _reactDom.findDOMNode)(_this.menuList.selectedItem);\n }, _this.menuList = undefined, _this.focus = function () {\n if (_this.menuList && _this.menuList.selectedItem) {\n (0, _reactDom.findDOMNode)(_this.menuList.selectedItem).focus();\n return;\n }\n\n var menuList = (0, _reactDom.findDOMNode)(_this.menuList);\n if (menuList && menuList.firstChild) {\n menuList.firstChild.focus();\n }\n }, _this.handleEnter = function (element) {\n var theme = _this.props.theme;\n\n var menuList = (0, _reactDom.findDOMNode)(_this.menuList);\n\n // Focus so the scroll computation of the Popover works as expected.\n _this.focus();\n\n // Let's ignore that piece of logic if users are already overriding the width\n // of the menu.\n if (menuList && element.clientHeight < menuList.clientHeight && !menuList.style.width) {\n var size = (0, _scrollbarSize2.default)() + 'px';\n menuList.style[theme.direction === 'rtl' ? 'paddingLeft' : 'paddingRight'] = size;\n menuList.style.width = 'calc(100% + ' + size + ')';\n }\n\n if (_this.props.onEnter) {\n _this.props.onEnter(element);\n }\n }, _this.handleListKeyDown = function (event, key) {\n if (key === 'tab') {\n event.preventDefault();\n\n if (_this.props.onClose) {\n _this.props.onClose(event);\n }\n }\n }, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret);\n }\n\n (0, _createClass3.default)(Menu, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n if (this.props.open) {\n this.focus();\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n var _props = this.props,\n children = _props.children,\n classes = _props.classes,\n MenuListProps = _props.MenuListProps,\n onEnter = _props.onEnter,\n _props$PaperProps = _props.PaperProps,\n PaperProps = _props$PaperProps === undefined ? {} : _props$PaperProps,\n PopoverClasses = _props.PopoverClasses,\n theme = _props.theme,\n other = (0, _objectWithoutProperties3.default)(_props, ['children', 'classes', 'MenuListProps', 'onEnter', 'PaperProps', 'PopoverClasses', 'theme']);\n\n\n return _react2.default.createElement(\n _Popover2.default,\n (0, _extends3.default)({\n getContentAnchorEl: this.getContentAnchorEl,\n classes: PopoverClasses,\n onEnter: this.handleEnter,\n anchorOrigin: theme.direction === 'rtl' ? RTL_ORIGIN : LTR_ORIGIN,\n transformOrigin: theme.direction === 'rtl' ? RTL_ORIGIN : LTR_ORIGIN,\n PaperProps: (0, _extends3.default)({}, PaperProps, {\n classes: (0, _extends3.default)({}, PaperProps.classes, {\n root: classes.paper\n })\n })\n }, other),\n _react2.default.createElement(\n _MenuList2.default,\n (0, _extends3.default)({\n role: 'menu',\n onKeyDown: this.handleListKeyDown\n }, MenuListProps, {\n ref: function ref(node) {\n _this2.menuList = node;\n }\n }),\n children\n )\n );\n }\n }]);\n return Menu;\n}(_react2.default.Component);\n\nMenu.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * The DOM element used to set the position of the menu.\n */\n anchorEl: _propTypes2.default.object,\n /**\n * Menu contents, normally `MenuItem`s.\n */\n children: _propTypes2.default.node,\n /**\n * Useful to extend the style applied to components.\n */\n classes: _propTypes2.default.object.isRequired,\n /**\n * Properties applied to the `MenuList` element.\n */\n MenuListProps: _propTypes2.default.object,\n /**\n * Callback fired when the component requests to be closed.\n *\n * @param {object} event The event source of the callback\n */\n onClose: _propTypes2.default.func,\n /**\n * Callback fired before the Menu enters.\n */\n onEnter: _propTypes2.default.func,\n /**\n * Callback fired when the Menu has entered.\n */\n onEntered: _propTypes2.default.func,\n /**\n * Callback fired when the Menu is entering.\n */\n onEntering: _propTypes2.default.func,\n /**\n * Callback fired before the Menu exits.\n */\n onExit: _propTypes2.default.func,\n /**\n * Callback fired when the Menu has exited.\n */\n onExited: _propTypes2.default.func,\n /**\n * Callback fired when the Menu is exiting.\n */\n onExiting: _propTypes2.default.func,\n /**\n * If `true`, the menu is visible.\n */\n open: _propTypes2.default.bool.isRequired,\n /**\n * @ignore\n */\n PaperProps: _propTypes2.default.object,\n /**\n * `classes` property applied to the `Popover` element.\n */\n PopoverClasses: _propTypes2.default.object,\n /**\n * @ignore\n */\n theme: _propTypes2.default.object.isRequired,\n /**\n * The length of the transition in `ms`, or 'auto'\n */\n transitionDuration: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.shape({ enter: _propTypes2.default.number, exit: _propTypes2.default.number }), _propTypes2.default.oneOf(['auto'])])\n} : {};\n\nMenu.defaultProps = {\n transitionDuration: 'auto'\n};\n\nexports.default = (0, _withStyles2.default)(styles, { name: 'MuiMenu', withTheme: true })(Menu);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');\n\nvar _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);\n\nvar _toConsumableArray2 = require('babel-runtime/helpers/toConsumableArray');\n\nvar _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);\n\nvar _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = require('babel-runtime/helpers/createClass');\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = require('babel-runtime/helpers/inherits');\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _reactDom = require('react-dom');\n\nvar _keycode = require('keycode');\n\nvar _keycode2 = _interopRequireDefault(_keycode);\n\nvar _contains = require('dom-helpers/query/contains');\n\nvar _contains2 = _interopRequireDefault(_contains);\n\nvar _activeElement = require('dom-helpers/activeElement');\n\nvar _activeElement2 = _interopRequireDefault(_activeElement);\n\nvar _ownerDocument = require('dom-helpers/ownerDocument');\n\nvar _ownerDocument2 = _interopRequireDefault(_ownerDocument);\n\nvar _List = require('../List');\n\nvar _List2 = _interopRequireDefault(_List);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// @inheritedComponent List\n\nvar MenuList = function (_React$Component) {\n (0, _inherits3.default)(MenuList, _React$Component);\n\n function MenuList() {\n var _ref;\n\n var _temp, _this, _ret;\n\n (0, _classCallCheck3.default)(this, MenuList);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = MenuList.__proto__ || (0, _getPrototypeOf2.default)(MenuList)).call.apply(_ref, [this].concat(args))), _this), _this.state = {\n currentTabIndex: undefined\n }, _this.list = undefined, _this.selectedItem = undefined, _this.blurTimer = undefined, _this.handleBlur = function (event) {\n _this.blurTimer = setTimeout(function () {\n if (_this.list) {\n var list = (0, _reactDom.findDOMNode)(_this.list);\n var currentFocus = (0, _activeElement2.default)((0, _ownerDocument2.default)(list));\n if (!(0, _contains2.default)(list, currentFocus)) {\n _this.resetTabIndex();\n }\n }\n }, 30);\n\n if (_this.props.onBlur) {\n _this.props.onBlur(event);\n }\n }, _this.handleKeyDown = function (event) {\n var list = (0, _reactDom.findDOMNode)(_this.list);\n var key = (0, _keycode2.default)(event);\n var currentFocus = (0, _activeElement2.default)((0, _ownerDocument2.default)(list));\n\n if ((key === 'up' || key === 'down') && (!currentFocus || currentFocus && !(0, _contains2.default)(list, currentFocus))) {\n if (_this.selectedItem) {\n (0, _reactDom.findDOMNode)(_this.selectedItem).focus();\n } else {\n list.firstChild.focus();\n }\n } else if (key === 'down') {\n event.preventDefault();\n if (currentFocus.nextElementSibling) {\n currentFocus.nextElementSibling.focus();\n }\n } else if (key === 'up') {\n event.preventDefault();\n if (currentFocus.previousElementSibling) {\n currentFocus.previousElementSibling.focus();\n }\n }\n\n if (_this.props.onKeyDown) {\n _this.props.onKeyDown(event, key);\n }\n }, _this.handleItemFocus = function (event) {\n var list = (0, _reactDom.findDOMNode)(_this.list);\n if (list) {\n for (var i = 0; i < list.children.length; i += 1) {\n if (list.children[i] === event.currentTarget) {\n _this.setTabIndex(i);\n break;\n }\n }\n }\n }, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret);\n }\n\n (0, _createClass3.default)(MenuList, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.resetTabIndex();\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n clearTimeout(this.blurTimer);\n }\n }, {\n key: 'setTabIndex',\n value: function setTabIndex(index) {\n this.setState({ currentTabIndex: index });\n }\n }, {\n key: 'focus',\n value: function focus() {\n var currentTabIndex = this.state.currentTabIndex;\n\n var list = (0, _reactDom.findDOMNode)(this.list);\n if (!list || !list.children || !list.firstChild) {\n return;\n }\n\n if (currentTabIndex && currentTabIndex >= 0) {\n list.children[currentTabIndex].focus();\n } else {\n list.firstChild.focus();\n }\n }\n }, {\n key: 'resetTabIndex',\n value: function resetTabIndex() {\n var list = (0, _reactDom.findDOMNode)(this.list);\n var currentFocus = (0, _activeElement2.default)((0, _ownerDocument2.default)(list));\n var items = [].concat((0, _toConsumableArray3.default)(list.children));\n var currentFocusIndex = items.indexOf(currentFocus);\n\n if (currentFocusIndex !== -1) {\n return this.setTabIndex(currentFocusIndex);\n }\n\n if (this.selectedItem) {\n return this.setTabIndex(items.indexOf((0, _reactDom.findDOMNode)(this.selectedItem)));\n }\n\n return this.setTabIndex(0);\n }\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n var _props = this.props,\n children = _props.children,\n className = _props.className,\n onBlur = _props.onBlur,\n onKeyDown = _props.onKeyDown,\n other = (0, _objectWithoutProperties3.default)(_props, ['children', 'className', 'onBlur', 'onKeyDown']);\n\n\n return _react2.default.createElement(\n _List2.default,\n (0, _extends3.default)({\n role: 'menu',\n ref: function ref(node) {\n _this2.list = node;\n },\n className: className,\n onKeyDown: this.handleKeyDown,\n onBlur: this.handleBlur\n }, other),\n _react2.default.Children.map(children, function (child, index) {\n if (!_react2.default.isValidElement(child)) {\n return null;\n }\n\n return _react2.default.cloneElement(child, {\n tabIndex: index === _this2.state.currentTabIndex ? 0 : -1,\n ref: child.props.selected ? function (node) {\n _this2.selectedItem = node;\n } : undefined,\n onFocus: _this2.handleItemFocus\n });\n })\n );\n }\n }]);\n return MenuList;\n}(_react2.default.Component);\n\nMenuList.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * MenuList contents, normally `MenuItem`s.\n */\n children: _propTypes2.default.node,\n /**\n * @ignore\n */\n className: _propTypes2.default.string,\n /**\n * @ignore\n */\n onBlur: _propTypes2.default.func,\n /**\n * @ignore\n */\n onKeyDown: _propTypes2.default.func\n} : {};\n\nexports.default = MenuList;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.styles = undefined;\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _defineProperty2 = require('babel-runtime/helpers/defineProperty');\n\nvar _defineProperty3 = _interopRequireDefault(_defineProperty2);\n\nvar _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');\n\nvar _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _classnames = require('classnames');\n\nvar _classnames2 = _interopRequireDefault(_classnames);\n\nvar _withStyles = require('../styles/withStyles');\n\nvar _withStyles2 = _interopRequireDefault(_withStyles);\n\nvar _Fade = require('../transitions/Fade');\n\nvar _Fade2 = _interopRequireDefault(_Fade);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar styles = exports.styles = {\n root: {\n zIndex: -1,\n width: '100%',\n height: '100%',\n position: 'fixed',\n top: 0,\n left: 0,\n // Remove grey highlight\n WebkitTapHighlightColor: 'transparent',\n willChange: 'opacity',\n backgroundColor: 'rgba(0, 0, 0, 0.5)'\n },\n invisible: {\n backgroundColor: 'transparent'\n }\n};\n\nfunction Backdrop(props) {\n var classes = props.classes,\n invisible = props.invisible,\n open = props.open,\n transitionDuration = props.transitionDuration,\n other = (0, _objectWithoutProperties3.default)(props, ['classes', 'invisible', 'open', 'transitionDuration']);\n\n\n var className = (0, _classnames2.default)(classes.root, (0, _defineProperty3.default)({}, classes.invisible, invisible));\n\n return _react2.default.createElement(\n _Fade2.default,\n (0, _extends3.default)({ appear: true, 'in': open, timeout: transitionDuration }, other),\n _react2.default.createElement('div', { className: className, 'aria-hidden': 'true' })\n );\n}\n\nBackdrop.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * Useful to extend the style applied to components.\n */\n classes: _propTypes2.default.object.isRequired,\n /**\n * If `true`, the backdrop is invisible.\n * It can be used when rendering a popover or a custom select component.\n */\n invisible: _propTypes2.default.bool,\n /**\n * If `true`, the backdrop is open.\n */\n open: _propTypes2.default.bool.isRequired,\n /**\n * The duration for the transition, in milliseconds.\n * You may specify a single timeout for all transitions, or individually with an object.\n */\n transitionDuration: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.shape({ enter: _propTypes2.default.number, exit: _propTypes2.default.number })])\n} : {};\n\nBackdrop.defaultProps = {\n invisible: false\n};\n\nexports.default = (0, _withStyles2.default)(styles, { name: 'MuiBackdrop' })(Backdrop);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.styles = undefined;\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _defineProperty2 = require('babel-runtime/helpers/defineProperty');\n\nvar _defineProperty3 = _interopRequireDefault(_defineProperty2);\n\nvar _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');\n\nvar _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);\n\nvar _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = require('babel-runtime/helpers/createClass');\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = require('babel-runtime/helpers/inherits');\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _reactDom = require('react-dom');\n\nvar _reactDom2 = _interopRequireDefault(_reactDom);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _classnames = require('classnames');\n\nvar _classnames2 = _interopRequireDefault(_classnames);\n\nvar _warning = require('warning');\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nvar _keycode = require('keycode');\n\nvar _keycode2 = _interopRequireDefault(_keycode);\n\nvar _activeElement = require('dom-helpers/activeElement');\n\nvar _activeElement2 = _interopRequireDefault(_activeElement);\n\nvar _contains = require('dom-helpers/query/contains');\n\nvar _contains2 = _interopRequireDefault(_contains);\n\nvar _inDOM = require('dom-helpers/util/inDOM');\n\nvar _inDOM2 = _interopRequireDefault(_inDOM);\n\nvar _ownerDocument = require('dom-helpers/ownerDocument');\n\nvar _ownerDocument2 = _interopRequireDefault(_ownerDocument);\n\nvar _RefHolder = require('../internal/RefHolder');\n\nvar _RefHolder2 = _interopRequireDefault(_RefHolder);\n\nvar _Portal = require('../Portal');\n\nvar _Portal2 = _interopRequireDefault(_Portal);\n\nvar _addEventListener = require('../utils/addEventListener');\n\nvar _addEventListener2 = _interopRequireDefault(_addEventListener);\n\nvar _helpers = require('../utils/helpers');\n\nvar _withStyles = require('../styles/withStyles');\n\nvar _withStyles2 = _interopRequireDefault(_withStyles);\n\nvar _ModalManager = require('./ModalManager');\n\nvar _ModalManager2 = _interopRequireDefault(_ModalManager);\n\nvar _Backdrop = require('./Backdrop');\n\nvar _Backdrop2 = _interopRequireDefault(_Backdrop);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction getContainer(container, defaultContainer) {\n container = typeof container === 'function' ? container() : container;\n return _reactDom2.default.findDOMNode(container) || defaultContainer;\n} // @inheritedComponent Portal\n\nfunction getHasTransition(props) {\n return props.children ? props.children.props.hasOwnProperty('in') : false;\n}\n\nvar styles = exports.styles = function styles(theme) {\n return {\n root: {\n display: 'flex',\n width: '100%',\n height: '100%',\n position: 'fixed',\n zIndex: theme.zIndex.modal,\n top: 0,\n left: 0\n },\n hidden: {\n visibility: 'hidden'\n }\n };\n};\n\nvar Modal = function (_React$Component) {\n (0, _inherits3.default)(Modal, _React$Component);\n\n function Modal(props, context) {\n (0, _classCallCheck3.default)(this, Modal);\n\n var _this = (0, _possibleConstructorReturn3.default)(this, (Modal.__proto__ || (0, _getPrototypeOf2.default)(Modal)).call(this, props, context));\n\n _this.dialog = null;\n _this.mounted = false;\n _this.mountNode = null;\n\n _this.handleRendered = function () {\n _this.autoFocus();\n\n if (_this.props.onRendered) {\n _this.props.onRendered();\n }\n };\n\n _this.handleOpen = function () {\n var doc = (0, _ownerDocument2.default)(_this.mountNode);\n var container = getContainer(_this.props.container, doc.body);\n\n _this.props.manager.add(_this, container);\n _this.onDocumentKeydownListener = (0, _addEventListener2.default)(doc, 'keydown', _this.handleDocumentKeyDown);\n _this.onFocusinListener = (0, _addEventListener2.default)(doc, 'focus', _this.enforceFocus, true);\n };\n\n _this.handleClose = function () {\n _this.props.manager.remove(_this);\n _this.onDocumentKeydownListener.remove();\n _this.onFocusinListener.remove();\n _this.restoreLastFocus();\n };\n\n _this.handleExited = function () {\n _this.setState({ exited: true });\n _this.handleClose();\n };\n\n _this.handleBackdropClick = function (event) {\n if (event.target !== event.currentTarget) {\n return;\n }\n\n if (_this.props.onBackdropClick) {\n _this.props.onBackdropClick(event);\n }\n\n if (!_this.props.disableBackdropClick && _this.props.onClose) {\n _this.props.onClose(event, 'backdropClick');\n }\n };\n\n _this.handleDocumentKeyDown = function (event) {\n if (!_this.isTopModal() || (0, _keycode2.default)(event) !== 'esc') {\n return;\n }\n\n if (_this.props.onEscapeKeyDown) {\n _this.props.onEscapeKeyDown(event);\n }\n\n if (!_this.props.disableEscapeKeyDown && _this.props.onClose) {\n _this.props.onClose(event, 'escapeKeyDown');\n }\n };\n\n _this.checkForFocus = function () {\n if (_inDOM2.default) {\n _this.lastFocus = (0, _activeElement2.default)();\n }\n };\n\n _this.enforceFocus = function () {\n if (_this.props.disableEnforceFocus || !_this.mounted || !_this.isTopModal()) {\n return;\n }\n\n var dialogElement = _this.getDialogElement();\n var currentActiveElement = (0, _activeElement2.default)((0, _ownerDocument2.default)(_this.mountNode));\n\n if (dialogElement && !(0, _contains2.default)(dialogElement, currentActiveElement)) {\n dialogElement.focus();\n }\n };\n\n _this.state = {\n exited: !_this.props.open\n };\n return _this;\n }\n\n (0, _createClass3.default)(Modal, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.mounted = true;\n if (this.props.open) {\n this.handleOpen();\n }\n }\n }, {\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps(nextProps) {\n if (nextProps.open) {\n this.setState({ exited: false });\n } else if (!getHasTransition(nextProps)) {\n // Otherwise let handleExited take care of marking exited.\n this.setState({ exited: true });\n }\n }\n }, {\n key: 'componentWillUpdate',\n value: function componentWillUpdate(nextProps) {\n if (!this.props.open && nextProps.open) {\n this.checkForFocus();\n }\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate(prevProps) {\n if (prevProps.open && !this.props.open && !getHasTransition(this.props)) {\n // Otherwise handleExited will call this.\n this.handleClose();\n } else if (!prevProps.open && this.props.open) {\n this.handleOpen();\n }\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n this.mounted = false;\n\n if (this.props.open || getHasTransition(this.props) && !this.state.exited) {\n this.handleClose();\n }\n }\n }, {\n key: 'getDialogElement',\n value: function getDialogElement() {\n return _reactDom2.default.findDOMNode(this.dialog);\n }\n }, {\n key: 'autoFocus',\n value: function autoFocus() {\n if (this.props.disableAutoFocus) {\n return;\n }\n\n var dialogElement = this.getDialogElement();\n var currentActiveElement = (0, _activeElement2.default)((0, _ownerDocument2.default)(this.mountNode));\n\n if (dialogElement && !(0, _contains2.default)(dialogElement, currentActiveElement)) {\n this.lastFocus = currentActiveElement;\n\n if (!dialogElement.hasAttribute('tabIndex')) {\n process.env.NODE_ENV !== \"production\" ? (0, _warning2.default)(false, ['Material-UI: the modal content node does not accept focus.', 'For the benefit of assistive technologies, ' + 'the tabIndex of the node is being set to \"-1\".'].join('\\n')) : void 0;\n dialogElement.setAttribute('tabIndex', -1);\n }\n\n dialogElement.focus();\n }\n }\n }, {\n key: 'restoreLastFocus',\n value: function restoreLastFocus() {\n if (this.props.disableRestoreFocus) {\n return;\n }\n\n if (this.lastFocus) {\n this.lastFocus.focus();\n this.lastFocus = null;\n }\n }\n }, {\n key: 'isTopModal',\n value: function isTopModal() {\n return this.props.manager.isTopModal(this);\n }\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n var _props = this.props,\n BackdropComponent = _props.BackdropComponent,\n BackdropProps = _props.BackdropProps,\n children = _props.children,\n classes = _props.classes,\n className = _props.className,\n container = _props.container,\n disableAutoFocus = _props.disableAutoFocus,\n disableBackdropClick = _props.disableBackdropClick,\n disableEnforceFocus = _props.disableEnforceFocus,\n disableEscapeKeyDown = _props.disableEscapeKeyDown,\n disableRestoreFocus = _props.disableRestoreFocus,\n hideBackdrop = _props.hideBackdrop,\n keepMounted = _props.keepMounted,\n onBackdropClick = _props.onBackdropClick,\n onClose = _props.onClose,\n onEscapeKeyDown = _props.onEscapeKeyDown,\n onRendered = _props.onRendered,\n open = _props.open,\n manager = _props.manager,\n other = (0, _objectWithoutProperties3.default)(_props, ['BackdropComponent', 'BackdropProps', 'children', 'classes', 'className', 'container', 'disableAutoFocus', 'disableBackdropClick', 'disableEnforceFocus', 'disableEscapeKeyDown', 'disableRestoreFocus', 'hideBackdrop', 'keepMounted', 'onBackdropClick', 'onClose', 'onEscapeKeyDown', 'onRendered', 'open', 'manager']);\n var exited = this.state.exited;\n\n var hasTransition = getHasTransition(this.props);\n var childProps = {};\n\n if (!keepMounted && !open && (!hasTransition || exited)) {\n return null;\n }\n\n // It's a Transition like component\n if (hasTransition) {\n childProps.onExited = (0, _helpers.createChainedFunction)(this.handleExited, children.props.onExited);\n }\n\n if (children.props.role === undefined) {\n childProps.role = children.props.role || 'document';\n }\n\n if (children.props.tabIndex === undefined) {\n childProps.tabIndex = children.props.tabIndex || '-1';\n }\n\n return _react2.default.createElement(\n _Portal2.default,\n {\n ref: function ref(node) {\n _this2.mountNode = node ? node.getMountNode() : node;\n },\n container: container,\n onRendered: this.handleRendered\n },\n _react2.default.createElement(\n 'div',\n (0, _extends3.default)({\n className: (0, _classnames2.default)(classes.root, className, (0, _defineProperty3.default)({}, classes.hidden, exited))\n }, other),\n hideBackdrop ? null : _react2.default.createElement(BackdropComponent, (0, _extends3.default)({ open: open, onClick: this.handleBackdropClick }, BackdropProps)),\n _react2.default.createElement(\n _RefHolder2.default,\n {\n ref: function ref(node) {\n _this2.dialog = node;\n }\n },\n _react2.default.cloneElement(children, childProps)\n )\n )\n );\n }\n }]);\n return Modal;\n}(_react2.default.Component);\n\nModal.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * A backdrop component. Useful for custom backdrop rendering.\n */\n BackdropComponent: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]),\n /**\n * Properties applied to the `Backdrop` element.\n */\n BackdropProps: _propTypes2.default.object,\n /**\n * A single child content element.\n */\n children: _propTypes2.default.element,\n /**\n * Useful to extend the style applied to components.\n */\n classes: _propTypes2.default.object.isRequired,\n /**\n * @ignore\n */\n className: _propTypes2.default.string,\n /**\n * A node, component instance, or function that returns either.\n * The `container` will have the portal children appended to it.\n */\n container: _propTypes2.default.oneOfType([_propTypes2.default.object, _propTypes2.default.func]),\n /**\n * If `true`, the modal will not automatically shift focus to itself when it opens, and\n * replace it to the last focused element when it closes.\n * This also works correctly with any modal children that have the `disableAutoFocus` prop.\n *\n * Generally this should never be set to `true` as it makes the modal less\n * accessible to assistive technologies, like screen readers.\n */\n disableAutoFocus: _propTypes2.default.bool,\n /**\n * If `true`, clicking the backdrop will not fire any callback.\n */\n disableBackdropClick: _propTypes2.default.bool,\n /**\n * If `true`, the modal will not prevent focus from leaving the modal while open.\n *\n * Generally this should never be set to `true` as it makes the modal less\n * accessible to assistive technologies, like screen readers.\n */\n disableEnforceFocus: _propTypes2.default.bool,\n /**\n * If `true`, hitting escape will not fire any callback.\n */\n disableEscapeKeyDown: _propTypes2.default.bool,\n /**\n * If `true`, the modal will not restore focus to previously focused element once\n * modal is hidden.\n */\n disableRestoreFocus: _propTypes2.default.bool,\n /**\n * If `true`, the backdrop is not rendered.\n */\n hideBackdrop: _propTypes2.default.bool,\n /**\n * Always keep the children in the DOM.\n * This property can be useful in SEO situation or\n * when you want to maximize the responsiveness of the Modal.\n */\n keepMounted: _propTypes2.default.bool,\n /**\n * A modal manager used to track and manage the state of open\n * Modals. Useful when customizing how modals interact within a container.\n */\n manager: _propTypes2.default.object,\n /**\n * Callback fired when the backdrop is clicked.\n */\n onBackdropClick: _propTypes2.default.func,\n /**\n * Callback fired when the component requests to be closed.\n * The `reason` parameter can optionally be used to control the response to `onClose`.\n *\n * @param {object} event The event source of the callback\n * @param {string} reason Can be:`\"escapeKeyDown\"`, `\"backdropClick\"`\n */\n onClose: _propTypes2.default.func,\n /**\n * Callback fired when the escape key is pressed,\n * `disableEscapeKeyDown` is false and the modal is in focus.\n */\n onEscapeKeyDown: _propTypes2.default.func,\n /**\n * Callback fired once the children has been mounted into the `container`.\n * It signals that the `open={true}` property took effect.\n */\n onRendered: _propTypes2.default.func,\n /**\n * If `true`, the modal is open.\n */\n open: _propTypes2.default.bool.isRequired\n} : {};\n\nModal.defaultProps = {\n disableAutoFocus: false,\n disableBackdropClick: false,\n disableEnforceFocus: false,\n disableEscapeKeyDown: false,\n disableRestoreFocus: false,\n hideBackdrop: false,\n keepMounted: false,\n // Modals don't open on the server so this won't conflict with concurrent requests.\n manager: new _ModalManager2.default(),\n BackdropComponent: _Backdrop2.default\n};\n\nexports.default = (0, _withStyles2.default)(styles, { flip: false, name: 'MuiModal' })(Modal);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _keys = require('babel-runtime/core-js/object/keys');\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nvar _style = require('dom-helpers/style');\n\nvar _style2 = _interopRequireDefault(_style);\n\nvar _ownerDocument = require('dom-helpers/ownerDocument');\n\nvar _ownerDocument2 = _interopRequireDefault(_ownerDocument);\n\nvar _scrollbarSize = require('dom-helpers/util/scrollbarSize');\n\nvar _scrollbarSize2 = _interopRequireDefault(_scrollbarSize);\n\nvar _isOverflowing = require('./isOverflowing');\n\nvar _isOverflowing2 = _interopRequireDefault(_isOverflowing);\n\nvar _manageAriaHidden = require('./manageAriaHidden');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction findIndexOf(data, callback) {\n var idx = -1;\n data.some(function (item, index) {\n if (callback(item)) {\n idx = index;\n return true;\n }\n return false;\n });\n return idx;\n}\n\nfunction findContainer(data, modal) {\n return findIndexOf(data, function (item) {\n return item.modals.indexOf(modal) !== -1;\n });\n}\n\nfunction getPaddingRight(node) {\n return parseInt((0, _style2.default)(node, 'paddingRight') || 0, 10);\n}\n\nfunction setContainerStyle(data, container) {\n var style = { overflow: 'hidden' };\n\n // We are only interested in the actual `style` here because we will override it.\n data.style = {\n overflow: container.style.overflow,\n paddingRight: container.style.paddingRight\n };\n\n if (data.overflowing) {\n var scrollbarSize = (0, _scrollbarSize2.default)();\n\n // Use computed style, here to get the real padding to add our scrollbar width.\n style.paddingRight = getPaddingRight(container) + scrollbarSize + 'px';\n\n // .mui-fixed is a global helper.\n var fixedNodes = (0, _ownerDocument2.default)(container).querySelectorAll('.mui-fixed');\n for (var i = 0; i < fixedNodes.length; i += 1) {\n var paddingRight = getPaddingRight(fixedNodes[i]);\n data.prevPaddings.push(paddingRight);\n fixedNodes[i].style.paddingRight = paddingRight + scrollbarSize + 'px';\n }\n }\n\n (0, _keys2.default)(style).forEach(function (key) {\n container.style[key] = style[key];\n });\n}\n\nfunction removeContainerStyle(data, container) {\n (0, _keys2.default)(data.style).forEach(function (key) {\n container.style[key] = data.style[key];\n });\n\n var fixedNodes = (0, _ownerDocument2.default)(container).querySelectorAll('.mui-fixed');\n for (var i = 0; i < fixedNodes.length; i += 1) {\n fixedNodes[i].style.paddingRight = data.prevPaddings[i] + 'px';\n }\n}\n/**\n * @ignore - do not document.\n *\n * Proper state managment for containers and the modals in those containers.\n * Simplified, but inspired by react-overlay's ModalManager class\n * Used by the Modal to ensure proper styling of containers.\n */\n\nvar ModalManager = function ModalManager() {\n var _this = this;\n\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$hideSiblingNodes = _ref.hideSiblingNodes,\n hideSiblingNodes = _ref$hideSiblingNodes === undefined ? true : _ref$hideSiblingNodes,\n _ref$handleContainerO = _ref.handleContainerOverflow,\n handleContainerOverflow = _ref$handleContainerO === undefined ? true : _ref$handleContainerO;\n\n (0, _classCallCheck3.default)(this, ModalManager);\n\n this.add = function (modal, container) {\n var modalIdx = _this.modals.indexOf(modal);\n var containerIdx = _this.containers.indexOf(container);\n\n if (modalIdx !== -1) {\n return modalIdx;\n }\n\n modalIdx = _this.modals.length;\n _this.modals.push(modal);\n\n if (_this.hideSiblingNodes) {\n (0, _manageAriaHidden.hideSiblings)(container, modal.mountNode);\n }\n\n if (containerIdx !== -1) {\n _this.data[containerIdx].modals.push(modal);\n return modalIdx;\n }\n\n var data = {\n modals: [modal],\n overflowing: (0, _isOverflowing2.default)(container),\n prevPaddings: []\n };\n\n if (_this.handleContainerOverflow) {\n setContainerStyle(data, container);\n }\n\n _this.containers.push(container);\n _this.data.push(data);\n\n return modalIdx;\n };\n\n this.remove = function (modal) {\n var modalIdx = _this.modals.indexOf(modal);\n\n if (modalIdx === -1) {\n return modalIdx;\n }\n\n var containerIdx = findContainer(_this.data, modal);\n var data = _this.data[containerIdx];\n var container = _this.containers[containerIdx];\n\n data.modals.splice(data.modals.indexOf(modal), 1);\n _this.modals.splice(modalIdx, 1);\n\n // If that was the last modal in a container, clean up the container.\n if (data.modals.length === 0) {\n if (_this.handleContainerOverflow) {\n removeContainerStyle(data, container);\n }\n\n if (_this.hideSiblingNodes) {\n (0, _manageAriaHidden.showSiblings)(container, modal.mountNode);\n }\n _this.containers.splice(containerIdx, 1);\n _this.data.splice(containerIdx, 1);\n } else if (_this.hideSiblingNodes) {\n // Otherwise make sure the next top modal is visible to a SR.\n (0, _manageAriaHidden.ariaHidden)(false, data.modals[data.modals.length - 1].mountNode);\n }\n\n return modalIdx;\n };\n\n this.isTopModal = function (modal) {\n return !!_this.modals.length && _this.modals[_this.modals.length - 1] === modal;\n };\n\n this.hideSiblingNodes = hideSiblingNodes;\n this.handleContainerOverflow = handleContainerOverflow;\n // this.modals[modalIdx] = modal\n this.modals = [];\n // this.containers[containerIdx] = container\n this.containers = [];\n // this.data[containerIdx] = {\n // modals: [],\n // }\n this.data = [];\n};\n\nexports.default = ModalManager;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _Modal = require('./Modal');\n\nObject.defineProperty(exports, 'default', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_Modal).default;\n }\n});\n\nvar _Backdrop = require('./Backdrop');\n\nObject.defineProperty(exports, 'Backdrop', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_Backdrop).default;\n }\n});\n\nvar _ModalManager = require('./ModalManager');\n\nObject.defineProperty(exports, 'ModalManager', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_ModalManager).default;\n }\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.isBody = isBody;\nexports.default = isOverflowing;\n\nvar _isWindow = require('dom-helpers/query/isWindow');\n\nvar _isWindow2 = _interopRequireDefault(_isWindow);\n\nvar _ownerDocument = require('dom-helpers/ownerDocument');\n\nvar _ownerDocument2 = _interopRequireDefault(_ownerDocument);\n\nvar _ownerWindow = require('dom-helpers/ownerWindow');\n\nvar _ownerWindow2 = _interopRequireDefault(_ownerWindow);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction isBody(node) {\n return node && node.tagName.toLowerCase() === 'body';\n}\n\n// Do we have a scroll bar?\nfunction isOverflowing(container) {\n var doc = (0, _ownerDocument2.default)(container);\n var win = (0, _ownerWindow2.default)(doc);\n\n /* istanbul ignore next */\n if (!(0, _isWindow2.default)(doc) && !isBody(container)) {\n return container.scrollHeight > container.clientHeight;\n }\n\n // Takes in account potential non zero margin on the body.\n var style = win.getComputedStyle(doc.body);\n var marginLeft = parseInt(style.getPropertyValue('margin-left'), 10);\n var marginRight = parseInt(style.getPropertyValue('margin-right'), 10);\n\n return marginLeft + doc.body.clientWidth + marginRight < win.innerWidth;\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.ariaHidden = ariaHidden;\nexports.hideSiblings = hideSiblings;\nexports.showSiblings = showSiblings;\nvar BLACKLIST = ['template', 'script', 'style'];\n\nfunction isHidable(node) {\n return node.nodeType === 1 && BLACKLIST.indexOf(node.tagName.toLowerCase()) === -1;\n}\n\nfunction siblings(container, mount, callback) {\n mount = [].concat(mount); // eslint-disable-line no-param-reassign\n [].forEach.call(container.children, function (node) {\n if (mount.indexOf(node) === -1 && isHidable(node)) {\n callback(node);\n }\n });\n}\n\nfunction ariaHidden(show, node) {\n if (!node) {\n return;\n }\n if (show) {\n node.setAttribute('aria-hidden', 'true');\n } else {\n node.removeAttribute('aria-hidden');\n }\n}\n\nfunction hideSiblings(container, mountNode) {\n siblings(container, mountNode, function (node) {\n return ariaHidden(true, node);\n });\n}\n\nfunction showSiblings(container, mountNode) {\n siblings(container, mountNode, function (node) {\n return ariaHidden(false, node);\n });\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.styles = undefined;\n\nvar _defineProperty2 = require('babel-runtime/helpers/defineProperty');\n\nvar _defineProperty3 = _interopRequireDefault(_defineProperty2);\n\nvar _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');\n\nvar _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _classnames = require('classnames');\n\nvar _classnames2 = _interopRequireDefault(_classnames);\n\nvar _warning = require('warning');\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nvar _withStyles = require('../styles/withStyles');\n\nvar _withStyles2 = _interopRequireDefault(_withStyles);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar styles = exports.styles = function styles(theme) {\n var shadows = {};\n theme.shadows.forEach(function (shadow, index) {\n shadows['shadow' + index] = {\n boxShadow: shadow\n };\n });\n\n return (0, _extends3.default)({\n root: {\n backgroundColor: theme.palette.background.paper\n },\n rounded: {\n borderRadius: 2\n }\n }, shadows);\n};\n\nfunction Paper(props) {\n var classes = props.classes,\n classNameProp = props.className,\n Component = props.component,\n square = props.square,\n elevation = props.elevation,\n other = (0, _objectWithoutProperties3.default)(props, ['classes', 'className', 'component', 'square', 'elevation']);\n\n\n process.env.NODE_ENV !== \"production\" ? (0, _warning2.default)(elevation >= 0 && elevation < 25, 'Material-UI: this elevation `' + elevation + '` is not implemented.') : void 0;\n\n var className = (0, _classnames2.default)(classes.root, classes['shadow' + elevation], (0, _defineProperty3.default)({}, classes.rounded, !square), classNameProp);\n\n return _react2.default.createElement(Component, (0, _extends3.default)({ className: className }, other));\n}\n\nPaper.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * The content of the component.\n */\n children: _propTypes2.default.node,\n /**\n * Useful to extend the style applied to components.\n */\n classes: _propTypes2.default.object.isRequired,\n /**\n * @ignore\n */\n className: _propTypes2.default.string,\n /**\n * The component used for the root node.\n * Either a string to use a DOM element or a component.\n */\n component: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]),\n /**\n * Shadow depth, corresponds to `dp` in the spec.\n * It's accepting values between 0 and 24 inclusive.\n */\n elevation: _propTypes2.default.number,\n /**\n * If `true`, rounded corners are disabled.\n */\n square: _propTypes2.default.bool\n} : {};\n\nPaper.defaultProps = {\n component: 'div',\n elevation: 2,\n square: false\n};\n\nexports.default = (0, _withStyles2.default)(styles, { name: 'MuiPaper' })(Paper);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _Paper = require('./Paper');\n\nObject.defineProperty(exports, 'default', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_Paper).default;\n }\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.styles = undefined;\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');\n\nvar _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);\n\nvar _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = require('babel-runtime/helpers/createClass');\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = require('babel-runtime/helpers/inherits');\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _reactDom = require('react-dom');\n\nvar _reactDom2 = _interopRequireDefault(_reactDom);\n\nvar _warning = require('warning');\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nvar _contains = require('dom-helpers/query/contains');\n\nvar _contains2 = _interopRequireDefault(_contains);\n\nvar _ownerDocument = require('dom-helpers/ownerDocument');\n\nvar _ownerDocument2 = _interopRequireDefault(_ownerDocument);\n\nvar _ownerWindow = require('dom-helpers/ownerWindow');\n\nvar _ownerWindow2 = _interopRequireDefault(_ownerWindow);\n\nvar _debounce = require('lodash/debounce');\n\nvar _debounce2 = _interopRequireDefault(_debounce);\n\nvar _reactEventListener = require('react-event-listener');\n\nvar _reactEventListener2 = _interopRequireDefault(_reactEventListener);\n\nvar _withStyles = require('../styles/withStyles');\n\nvar _withStyles2 = _interopRequireDefault(_withStyles);\n\nvar _Modal = require('../Modal');\n\nvar _Modal2 = _interopRequireDefault(_Modal);\n\nvar _Grow = require('../transitions/Grow');\n\nvar _Grow2 = _interopRequireDefault(_Grow);\n\nvar _Paper = require('../Paper');\n\nvar _Paper2 = _interopRequireDefault(_Paper);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction getOffsetTop(rect, vertical) {\n var offset = 0;\n\n if (typeof vertical === 'number') {\n offset = vertical;\n } else if (vertical === 'center') {\n offset = rect.height / 2;\n } else if (vertical === 'bottom') {\n offset = rect.height;\n }\n\n return offset;\n} // @inheritedComponent Modal\n\nfunction getOffsetLeft(rect, horizontal) {\n var offset = 0;\n\n if (typeof horizontal === 'number') {\n offset = horizontal;\n } else if (horizontal === 'center') {\n offset = rect.width / 2;\n } else if (horizontal === 'right') {\n offset = rect.width;\n }\n\n return offset;\n}\n\nfunction getTransformOriginValue(transformOrigin) {\n return [transformOrigin.horizontal, transformOrigin.vertical].map(function (n) {\n return typeof n === 'number' ? n + 'px' : n;\n }).join(' ');\n}\n\n// Sum the scrollTop between two elements.\nfunction getScrollParent(parent, child) {\n var element = child;\n var scrollTop = 0;\n\n while (element && element !== parent) {\n element = element.parentNode;\n scrollTop += element.scrollTop;\n }\n return scrollTop;\n}\n\nfunction getAnchorEl(anchorEl) {\n return typeof anchorEl === 'function' ? anchorEl() : anchorEl;\n}\n\nvar styles = exports.styles = {\n paper: {\n position: 'absolute',\n overflowY: 'auto',\n overflowX: 'hidden',\n // So we see the popover when it's empty.\n // It's most likely on issue on userland.\n minWidth: 16,\n minHeight: 16,\n maxWidth: 'calc(100vw - 32px)',\n maxHeight: 'calc(100vh - 32px)',\n '&:focus': {\n outline: 'none'\n }\n }\n};\n\nvar Popover = function (_React$Component) {\n (0, _inherits3.default)(Popover, _React$Component);\n\n function Popover() {\n var _ref;\n\n var _temp, _this, _ret;\n\n (0, _classCallCheck3.default)(this, Popover);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = Popover.__proto__ || (0, _getPrototypeOf2.default)(Popover)).call.apply(_ref, [this].concat(args))), _this), _this.componentWillUnmount = function () {\n _this.handleResize.cancel();\n }, _this.setPositioningStyles = function (element) {\n if (element && element.style) {\n var positioning = _this.getPositioningStyle(element);\n element.style.top = positioning.top;\n element.style.left = positioning.left;\n element.style.transformOrigin = positioning.transformOrigin;\n }\n }, _this.getPositioningStyle = function (element) {\n var _this$props = _this.props,\n anchorEl = _this$props.anchorEl,\n marginThreshold = _this$props.marginThreshold;\n\n // Check if the parent has requested anchoring on an inner content node\n\n var contentAnchorOffset = _this.getContentAnchorOffset(element);\n // Get the offset of of the anchoring element\n var anchorOffset = _this.getAnchorOffset(contentAnchorOffset);\n\n var elemRect = {\n width: element.clientWidth,\n height: element.clientHeight\n };\n // Get the transform origin point on the element itself\n var transformOrigin = _this.getTransformOrigin(elemRect, contentAnchorOffset);\n\n // Calculate element positioning\n var top = anchorOffset.top - transformOrigin.vertical;\n var left = anchorOffset.left - transformOrigin.horizontal;\n var bottom = top + elemRect.height;\n var right = left + elemRect.width;\n\n // Use the parent window of the anchorEl if provided\n var containerWindow = (0, _ownerWindow2.default)(getAnchorEl(anchorEl));\n\n // Window thresholds taking required margin into account\n var heightThreshold = containerWindow.innerHeight - marginThreshold;\n var widthThreshold = containerWindow.innerWidth - marginThreshold;\n\n // Check if the vertical axis needs shifting\n if (top < marginThreshold) {\n var diff = top - marginThreshold;\n top -= diff;\n transformOrigin.vertical += diff;\n } else if (bottom > heightThreshold) {\n var _diff = bottom - heightThreshold;\n top -= _diff;\n transformOrigin.vertical += _diff;\n }\n\n process.env.NODE_ENV !== \"production\" ? (0, _warning2.default)(elemRect.height < heightThreshold || !elemRect.height || !heightThreshold, ['Material-UI: the popover component is too tall.', 'Some part of it can not be seen on the screen (' + (elemRect.height - heightThreshold) + 'px).', 'Please consider adding a `max-height` to improve the user-experience.'].join('\\n')) : void 0;\n\n // Check if the horizontal axis needs shifting\n if (left < marginThreshold) {\n var _diff2 = left - marginThreshold;\n left -= _diff2;\n transformOrigin.horizontal += _diff2;\n } else if (right > widthThreshold) {\n var _diff3 = right - widthThreshold;\n left -= _diff3;\n transformOrigin.horizontal += _diff3;\n }\n\n return {\n top: top + 'px',\n left: left + 'px',\n transformOrigin: getTransformOriginValue(transformOrigin)\n };\n }, _this.transitionEl = undefined, _this.handleGetOffsetTop = getOffsetTop, _this.handleGetOffsetLeft = getOffsetLeft, _this.handleEnter = function (element) {\n if (_this.props.onEnter) {\n _this.props.onEnter(element);\n }\n\n _this.setPositioningStyles(element);\n }, _this.handleResize = (0, _debounce2.default)(function () {\n var element = _reactDom2.default.findDOMNode(_this.transitionEl);\n _this.setPositioningStyles(element);\n }, 166), _temp), (0, _possibleConstructorReturn3.default)(_this, _ret);\n }\n\n (0, _createClass3.default)(Popover, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n if (this.props.action) {\n this.props.action({\n updatePosition: this.handleResize\n });\n }\n }\n }, {\n key: 'getAnchorOffset',\n\n\n // Returns the top/left offset of the position\n // to attach to on the anchor element (or body if none is provided)\n value: function getAnchorOffset(contentAnchorOffset) {\n var _props = this.props,\n anchorEl = _props.anchorEl,\n anchorOrigin = _props.anchorOrigin,\n anchorReference = _props.anchorReference,\n anchorPosition = _props.anchorPosition;\n\n\n if (anchorReference === 'anchorPosition') {\n return anchorPosition;\n }\n\n // If an anchor element wasn't provided, just use the parent body element of this Popover\n var anchorElement = getAnchorEl(anchorEl) || (0, _ownerDocument2.default)(_reactDom2.default.findDOMNode(this.transitionEl)).body;\n var anchorRect = anchorElement.getBoundingClientRect();\n var anchorVertical = contentAnchorOffset === 0 ? anchorOrigin.vertical : 'center';\n\n return {\n top: anchorRect.top + this.handleGetOffsetTop(anchorRect, anchorVertical),\n left: anchorRect.left + this.handleGetOffsetLeft(anchorRect, anchorOrigin.horizontal)\n };\n }\n\n // Returns the vertical offset of inner content to anchor the transform on if provided\n\n }, {\n key: 'getContentAnchorOffset',\n value: function getContentAnchorOffset(element) {\n var _props2 = this.props,\n getContentAnchorEl = _props2.getContentAnchorEl,\n anchorReference = _props2.anchorReference;\n\n var contentAnchorOffset = 0;\n\n if (getContentAnchorEl && anchorReference === 'anchorEl') {\n var contentAnchorEl = getContentAnchorEl(element);\n\n if (contentAnchorEl && (0, _contains2.default)(element, contentAnchorEl)) {\n var scrollTop = getScrollParent(element, contentAnchorEl);\n contentAnchorOffset = contentAnchorEl.offsetTop + contentAnchorEl.clientHeight / 2 - scrollTop || 0;\n }\n\n // != the default value\n process.env.NODE_ENV !== \"production\" ? (0, _warning2.default)(this.props.anchorOrigin.vertical === 'top', ['Material-UI: you can not change the default `anchorOrigin.vertical` value ', 'when also providing the `getContentAnchorEl` property to the popover component.', 'Only use one of the two properties.', 'Set `getContentAnchorEl` to null or left `anchorOrigin.vertical` unchanged.'].join('\\n')) : void 0;\n }\n\n return contentAnchorOffset;\n }\n\n // Return the base transform origin using the element\n // and taking the content anchor offset into account if in use\n\n }, {\n key: 'getTransformOrigin',\n value: function getTransformOrigin(elemRect) {\n var contentAnchorOffset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var transformOrigin = this.props.transformOrigin;\n\n return {\n vertical: this.handleGetOffsetTop(elemRect, transformOrigin.vertical) + contentAnchorOffset,\n horizontal: this.handleGetOffsetLeft(elemRect, transformOrigin.horizontal)\n };\n }\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n var _props3 = this.props,\n action = _props3.action,\n anchorEl = _props3.anchorEl,\n anchorOrigin = _props3.anchorOrigin,\n anchorPosition = _props3.anchorPosition,\n anchorReference = _props3.anchorReference,\n children = _props3.children,\n classes = _props3.classes,\n containerProp = _props3.container,\n elevation = _props3.elevation,\n getContentAnchorEl = _props3.getContentAnchorEl,\n marginThreshold = _props3.marginThreshold,\n onEnter = _props3.onEnter,\n onEntered = _props3.onEntered,\n onEntering = _props3.onEntering,\n onExit = _props3.onExit,\n onExited = _props3.onExited,\n onExiting = _props3.onExiting,\n open = _props3.open,\n PaperProps = _props3.PaperProps,\n role = _props3.role,\n transformOrigin = _props3.transformOrigin,\n TransitionProp = _props3.transition,\n transitionDuration = _props3.transitionDuration,\n other = (0, _objectWithoutProperties3.default)(_props3, ['action', 'anchorEl', 'anchorOrigin', 'anchorPosition', 'anchorReference', 'children', 'classes', 'container', 'elevation', 'getContentAnchorEl', 'marginThreshold', 'onEnter', 'onEntered', 'onEntering', 'onExit', 'onExited', 'onExiting', 'open', 'PaperProps', 'role', 'transformOrigin', 'transition', 'transitionDuration']);\n\n // If the container prop is provided, use that\n // If the anchorEl prop is provided, use its parent body element as the container\n // If neither are provided let the Modal take care of choosing the container\n\n var container = containerProp || (anchorEl ? (0, _ownerDocument2.default)(getAnchorEl(anchorEl)).body : undefined);\n\n var transitionProps = {};\n // The provided transition might not support the auto timeout value.\n if (TransitionProp === _Grow2.default) {\n transitionProps.timeout = transitionDuration;\n }\n\n return _react2.default.createElement(\n _Modal2.default,\n (0, _extends3.default)({ container: container, open: open, BackdropProps: { invisible: true } }, other),\n _react2.default.createElement(\n TransitionProp,\n (0, _extends3.default)({\n appear: true,\n 'in': open,\n onEnter: this.handleEnter,\n onEntered: onEntered,\n onEntering: onEntering,\n onExit: onExit,\n onExited: onExited,\n onExiting: onExiting,\n role: role,\n ref: function ref(node) {\n _this2.transitionEl = node;\n }\n }, transitionProps),\n _react2.default.createElement(\n _Paper2.default,\n (0, _extends3.default)({\n className: classes.paper,\n\n elevation: elevation\n }, PaperProps),\n _react2.default.createElement(_reactEventListener2.default, { target: 'window', onResize: this.handleResize }),\n children\n )\n )\n );\n }\n }]);\n return Popover;\n}(_react2.default.Component);\n\nPopover.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * This is callback property. It's called by the component on mount.\n * This is useful when you want to trigger an action programmatically.\n * It currently only supports updatePosition() action.\n *\n * @param {object} actions This object contains all posible actions\n * that can be triggered programmatically.\n */\n action: _propTypes2.default.func,\n /**\n * This is the DOM element, or a function that returns the DOM element,\n * that may be used to set the position of the popover.\n */\n anchorEl: _propTypes2.default.oneOfType([_propTypes2.default.object, _propTypes2.default.func]),\n /**\n * This is the point on the anchor where the popover's\n * `anchorEl` will attach to. This is not used when the\n * anchorReference is 'anchorPosition'.\n *\n * Options:\n * vertical: [top, center, bottom];\n * horizontal: [left, center, right].\n */\n anchorOrigin: _propTypes2.default.shape({\n horizontal: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.oneOf(['left', 'center', 'right'])]),\n vertical: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.oneOf(['top', 'center', 'bottom'])])\n }),\n /**\n * This is the position that may be used\n * to set the position of the popover.\n * The coordinates are relative to\n * the application's client area.\n */\n anchorPosition: _propTypes2.default.shape({\n top: _propTypes2.default.number,\n left: _propTypes2.default.number\n }),\n /*\n * This determines which anchor prop to refer to to set\n * the position of the popover.\n */\n anchorReference: _propTypes2.default.oneOf(['anchorEl', 'anchorPosition']),\n /**\n * The content of the component.\n */\n children: _propTypes2.default.node,\n /**\n * Useful to extend the style applied to components.\n */\n classes: _propTypes2.default.object.isRequired,\n /**\n * A node, component instance, or function that returns either.\n * The `container` will passed to the Modal component.\n * By default, it's using the body of the anchorEl's top-level document object,\n * so it's simply `document.body` most of the time.\n */\n container: _propTypes2.default.oneOfType([_propTypes2.default.object, _propTypes2.default.func]),\n /**\n * The elevation of the popover.\n */\n elevation: _propTypes2.default.number,\n /**\n * This function is called in order to retrieve the content anchor element.\n * It's the opposite of the `anchorEl` property.\n * The content anchor element should be an element inside the popover.\n * It's used to correctly scroll and set the position of the popover.\n * The positioning strategy tries to make the content anchor element just above the\n * anchor element.\n */\n getContentAnchorEl: _propTypes2.default.func,\n /**\n * Specifies how close to the edge of the window the popover can appear.\n */\n marginThreshold: _propTypes2.default.number,\n /**\n * Callback fired when the component requests to be closed.\n *\n * @param {object} event The event source of the callback.\n */\n onClose: _propTypes2.default.func,\n /**\n * Callback fired before the component is entering.\n */\n onEnter: _propTypes2.default.func,\n /**\n * Callback fired when the component has entered.\n */\n onEntered: _propTypes2.default.func,\n /**\n * Callback fired when the component is entering.\n */\n onEntering: _propTypes2.default.func,\n /**\n * Callback fired before the component is exiting.\n */\n onExit: _propTypes2.default.func,\n /**\n * Callback fired when the component has exited.\n */\n onExited: _propTypes2.default.func,\n /**\n * Callback fired when the component is exiting.\n */\n onExiting: _propTypes2.default.func,\n /**\n * If `true`, the popover is visible.\n */\n open: _propTypes2.default.bool.isRequired,\n /**\n * Properties applied to the `Paper` element.\n */\n PaperProps: _propTypes2.default.object,\n /**\n * @ignore\n */\n role: _propTypes2.default.string,\n /**\n * This is the point on the popover which\n * will attach to the anchor's origin.\n *\n * Options:\n * vertical: [top, center, bottom, x(px)];\n * horizontal: [left, center, right, x(px)].\n */\n transformOrigin: _propTypes2.default.shape({\n horizontal: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.oneOf(['left', 'center', 'right'])]),\n vertical: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.oneOf(['top', 'center', 'bottom'])])\n }),\n /**\n * Transition component.\n */\n transition: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]),\n /**\n * Set to 'auto' to automatically calculate transition time based on height.\n */\n transitionDuration: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.shape({ enter: _propTypes2.default.number, exit: _propTypes2.default.number }), _propTypes2.default.oneOf(['auto'])])\n} : {};\n\nPopover.defaultProps = {\n anchorReference: 'anchorEl',\n anchorOrigin: {\n vertical: 'top',\n horizontal: 'left'\n },\n elevation: 8,\n marginThreshold: 16,\n transformOrigin: {\n vertical: 'top',\n horizontal: 'left'\n },\n transition: _Grow2.default,\n transitionDuration: 'auto'\n};\n\nexports.default = (0, _withStyles2.default)(styles, { name: 'MuiPopover' })(Popover);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _Popover = require('./Popover');\n\nObject.defineProperty(exports, 'default', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_Popover).default;\n }\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = require('babel-runtime/helpers/createClass');\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = require('babel-runtime/helpers/inherits');\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _reactDom = require('react-dom');\n\nvar _reactDom2 = _interopRequireDefault(_reactDom);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _ownerDocument = require('dom-helpers/ownerDocument');\n\nvar _ownerDocument2 = _interopRequireDefault(_ownerDocument);\n\nvar _exactProp = require('../utils/exactProp');\n\nvar _exactProp2 = _interopRequireDefault(_exactProp);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction getContainer(container, defaultContainer) {\n container = typeof container === 'function' ? container() : container;\n return _reactDom2.default.findDOMNode(container) || defaultContainer;\n}\n\nfunction getOwnerDocument(element) {\n return (0, _ownerDocument2.default)(_reactDom2.default.findDOMNode(element));\n}\n\n/**\n * @ignore - internal component.\n *\n * This module will soon be gone. We should drop it as soon as React@15.x support stop.\n */\n\nvar LegacyPortal = function (_React$Component) {\n (0, _inherits3.default)(LegacyPortal, _React$Component);\n\n function LegacyPortal() {\n var _ref;\n\n var _temp, _this, _ret;\n\n (0, _classCallCheck3.default)(this, LegacyPortal);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = LegacyPortal.__proto__ || (0, _getPrototypeOf2.default)(LegacyPortal)).call.apply(_ref, [this].concat(args))), _this), _this.getMountNode = function () {\n return _this.mountNode;\n }, _this.mountOverlayTarget = function () {\n if (!_this.overlayTarget) {\n _this.overlayTarget = document.createElement('div');\n _this.mountNode = getContainer(_this.props.container, getOwnerDocument(_this).body);\n _this.mountNode.appendChild(_this.overlayTarget);\n }\n }, _this.unmountOverlayTarget = function () {\n if (_this.overlayTarget) {\n _this.mountNode.removeChild(_this.overlayTarget);\n _this.overlayTarget = null;\n }\n _this.mountNode = null;\n }, _this.unrenderOverlay = function () {\n if (_this.overlayTarget) {\n _reactDom2.default.unmountComponentAtNode(_this.overlayTarget);\n _this.overlayInstance = null;\n }\n }, _this.renderOverlay = function () {\n var overlay = _this.props.children;\n _this.mountOverlayTarget();\n var initialRender = !_this.overlayInstance;\n _this.overlayInstance = _reactDom2.default.unstable_renderSubtreeIntoContainer(_this, overlay, _this.overlayTarget, function () {\n if (initialRender && _this.props.onRendered) {\n _this.props.onRendered();\n }\n });\n }, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret);\n }\n\n (0, _createClass3.default)(LegacyPortal, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.mounted = true;\n this.renderOverlay();\n }\n }, {\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps(nextProps) {\n if (this.overlayTarget && nextProps.container !== this.props.container) {\n this.mountNode.removeChild(this.overlayTarget);\n this.mountNode = getContainer(nextProps.container, getOwnerDocument(this).body);\n this.mountNode.appendChild(this.overlayTarget);\n }\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate() {\n this.renderOverlay();\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n this.mounted = false;\n this.unrenderOverlay();\n this.unmountOverlayTarget();\n }\n\n /**\n * @public\n */\n\n }, {\n key: 'render',\n value: function render() {\n return null;\n }\n }]);\n return LegacyPortal;\n}(_react2.default.Component);\n\nLegacyPortal.propTypes = process.env.NODE_ENV !== \"production\" ? {\n children: _propTypes2.default.element.isRequired,\n container: _propTypes2.default.oneOfType([_propTypes2.default.object, _propTypes2.default.func]),\n onRendered: _propTypes2.default.func\n} : {};\n\nLegacyPortal.propTypes = process.env.NODE_ENV !== \"production\" ? (0, _exactProp2.default)(LegacyPortal.propTypes, 'LegacyPortal') : {};\n\nexports.default = LegacyPortal;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = require('babel-runtime/helpers/createClass');\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = require('babel-runtime/helpers/inherits');\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _reactDom = require('react-dom');\n\nvar _reactDom2 = _interopRequireDefault(_reactDom);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _ownerDocument = require('dom-helpers/ownerDocument');\n\nvar _ownerDocument2 = _interopRequireDefault(_ownerDocument);\n\nvar _exactProp = require('../utils/exactProp');\n\nvar _exactProp2 = _interopRequireDefault(_exactProp);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction getContainer(container, defaultContainer) {\n container = typeof container === 'function' ? container() : container;\n return _reactDom2.default.findDOMNode(container) || defaultContainer;\n}\n\nfunction getOwnerDocument(element) {\n return (0, _ownerDocument2.default)(_reactDom2.default.findDOMNode(element));\n}\n\n/**\n * This component shares many concepts with\n * [react-overlays](https://react-bootstrap.github.io/react-overlays/#portals)\n * But has been forked in order to fix some bugs, reduce the number of dependencies\n * and take the control of our destiny.\n */\n\nvar Portal = function (_React$Component) {\n (0, _inherits3.default)(Portal, _React$Component);\n\n function Portal() {\n var _ref;\n\n var _temp, _this, _ret;\n\n (0, _classCallCheck3.default)(this, Portal);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = Portal.__proto__ || (0, _getPrototypeOf2.default)(Portal)).call.apply(_ref, [this].concat(args))), _this), _this.getMountNode = function () {\n return _this.mountNode;\n }, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret);\n }\n\n (0, _createClass3.default)(Portal, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.setContainer(this.props.container);\n this.forceUpdate(this.props.onRendered);\n }\n }, {\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps(nextProps) {\n if (nextProps.container !== this.props.container) {\n this.setContainer(nextProps.container);\n }\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n this.mountNode = null;\n }\n }, {\n key: 'setContainer',\n value: function setContainer(container) {\n this.mountNode = getContainer(container, getOwnerDocument(this).body);\n }\n\n /**\n * @public\n */\n\n }, {\n key: 'render',\n value: function render() {\n var children = this.props.children;\n\n\n return this.mountNode ? _reactDom2.default.createPortal(children, this.mountNode) : null;\n }\n }]);\n return Portal;\n}(_react2.default.Component);\n\nPortal.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * The children to render into the `container`.\n */\n children: _propTypes2.default.node.isRequired,\n /**\n * A node, component instance, or function that returns either.\n * The `container` will have the portal children appended to it.\n * By default, it's using the body of the top-level document object,\n * so it's simply `document.body` most of the time.\n */\n container: _propTypes2.default.oneOfType([_propTypes2.default.object, _propTypes2.default.func]),\n /**\n * Callback fired once the children has been mounted into the `container`.\n */\n onRendered: _propTypes2.default.func\n} : {};\n\nPortal.propTypes = process.env.NODE_ENV !== \"production\" ? (0, _exactProp2.default)(Portal.propTypes, 'Portal') : {};\n\nexports.default = Portal;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _reactDom = require('react-dom');\n\nvar _reactDom2 = _interopRequireDefault(_reactDom);\n\nvar _Portal = require('./Portal');\n\nvar _Portal2 = _interopRequireDefault(_Portal);\n\nvar _LegacyPortal = require('./LegacyPortal');\n\nvar _LegacyPortal2 = _interopRequireDefault(_LegacyPortal);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = _reactDom2.default.createPortal ? _Portal2.default : _LegacyPortal2.default;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.styles = undefined;\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');\n\nvar _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _SelectInput = require('./SelectInput');\n\nvar _SelectInput2 = _interopRequireDefault(_SelectInput);\n\nvar _withStyles = require('../styles/withStyles');\n\nvar _withStyles2 = _interopRequireDefault(_withStyles);\n\nvar _Input = require('../Input');\n\nvar _Input2 = _interopRequireDefault(_Input);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// Import to enforce the CSS injection order\n\nvar styles = exports.styles = function styles(theme) {\n return {\n root: {\n position: 'relative',\n width: '100%'\n },\n select: {\n '-moz-appearance': 'none', // Reset\n '-webkit-appearance': 'none', // Reset\n // When interacting quickly, the text can end up selected.\n // Native select can't be selected either.\n userSelect: 'none',\n paddingRight: theme.spacing.unit * 4,\n width: 'calc(100% - ' + theme.spacing.unit * 4 + 'px)',\n minWidth: theme.spacing.unit * 2, // So it doesn't collapse.\n cursor: 'pointer',\n '&:focus': {\n // Show that it's not an text input\n background: theme.palette.type === 'light' ? 'rgba(0, 0, 0, 0.05)' : 'rgba(255, 255, 255, 0.05)',\n borderRadius: 0 // Reset Chrome style\n },\n // Remove Firefox focus border\n '&:-moz-focusring': {\n color: 'transparent',\n textShadow: '0 0 0 #000'\n },\n // Remove IE11 arrow\n '&::-ms-expand': {\n display: 'none'\n }\n },\n selectMenu: {\n width: 'auto', // Fix Safari textOverflow\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n minHeight: '1.1875em' // Reset (19px), match the native input line-height\n },\n disabled: {\n cursor: 'default'\n },\n icon: {\n // We use a position absolute over a flexbox in order to forward the pointer events\n // to the input.\n position: 'absolute',\n right: 0,\n top: 'calc(50% - 12px)', // Center vertically\n color: theme.palette.action.active,\n 'pointer-events': 'none' // Don't block pointer events on the select under the icon.\n }\n };\n}; // @inheritedComponent Input\n\nfunction Select(props) {\n var autoWidth = props.autoWidth,\n children = props.children,\n classes = props.classes,\n displayEmpty = props.displayEmpty,\n input = props.input,\n inputProps = props.inputProps,\n MenuProps = props.MenuProps,\n multiple = props.multiple,\n native = props.native,\n onClose = props.onClose,\n onOpen = props.onOpen,\n open = props.open,\n renderValue = props.renderValue,\n SelectDisplayProps = props.SelectDisplayProps,\n other = (0, _objectWithoutProperties3.default)(props, ['autoWidth', 'children', 'classes', 'displayEmpty', 'input', 'inputProps', 'MenuProps', 'multiple', 'native', 'onClose', 'onOpen', 'open', 'renderValue', 'SelectDisplayProps']);\n\n\n return _react2.default.cloneElement(input, (0, _extends3.default)({\n // Most of the logic is implemented in `SelectInput`.\n // The `Select` component is a simple API wrapper to expose something better to play with.\n inputComponent: _SelectInput2.default,\n inputProps: (0, _extends3.default)({\n autoWidth: autoWidth,\n children: children,\n classes: classes,\n displayEmpty: displayEmpty,\n MenuProps: MenuProps,\n multiple: multiple,\n native: native,\n onClose: onClose,\n onOpen: onOpen,\n open: open,\n renderValue: renderValue,\n SelectDisplayProps: SelectDisplayProps,\n type: undefined }, inputProps, input ? input.props.inputProps : {})\n }, other));\n}\n\nSelect.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * If true, the width of the popover will automatically be set according to the items inside the\n * menu, otherwise it will be at least the width of the select input.\n */\n autoWidth: _propTypes2.default.bool,\n /**\n * The option elements to populate the select with.\n * Can be some `MenuItem` when `native` is false and `option` when `native` is true.\n */\n children: _propTypes2.default.node,\n /**\n * Useful to extend the style applied to components.\n */\n classes: _propTypes2.default.object.isRequired,\n /**\n * If `true`, the selected item is displayed even if its value is empty.\n * You can only use it when the `native` property is `false` (default).\n */\n displayEmpty: _propTypes2.default.bool,\n /**\n * An `Input` element; does not have to be a material-ui specific `Input`.\n */\n input: _propTypes2.default.element,\n /**\n * Properties applied to the `input` element.\n * When `native` is `true`, the properties are applied on the `select` element.\n */\n inputProps: _propTypes2.default.object,\n /**\n * Properties applied to the `Menu` element.\n */\n MenuProps: _propTypes2.default.object,\n /**\n * If true, `value` must be an array and the menu will support multiple selections.\n * You can only use it when the `native` property is `false` (default).\n */\n multiple: _propTypes2.default.bool,\n /**\n * If `true`, the component will be using a native `select` element.\n */\n native: _propTypes2.default.bool,\n /**\n * Callback function fired when a menu item is selected.\n *\n * @param {object} event The event source of the callback\n * @param {object} child The react element that was selected\n */\n onChange: _propTypes2.default.func,\n /**\n * Callback fired when the component requests to be closed.\n * Useful in controlled mode (see open).\n *\n * @param {object} event The event source of the callback\n */\n onClose: _propTypes2.default.func,\n /**\n * Callback fired when the component requests to be opened.\n * Useful in controlled mode (see open).\n *\n * @param {object} event The event source of the callback\n */\n onOpen: _propTypes2.default.func,\n /**\n * Control `select` open state.\n * You can only use it when the `native` property is `false` (default).\n */\n open: _propTypes2.default.bool,\n /**\n * Render the selected value.\n * You can only use it when the `native` property is `false` (default).\n */\n renderValue: _propTypes2.default.func,\n /**\n * Properties applied to the clickable div element.\n */\n SelectDisplayProps: _propTypes2.default.object,\n /**\n * The input value, required for a controlled component.\n */\n value: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number, _propTypes2.default.arrayOf(_propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]))])\n} : {};\n\nSelect.defaultProps = {\n autoWidth: false,\n displayEmpty: false,\n input: _react2.default.createElement(_Input2.default, null),\n multiple: false,\n native: false\n};\n\nSelect.muiName = 'Select';\n\nexports.default = (0, _withStyles2.default)(styles, { name: 'MuiSelect' })(Select);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _defineProperty2 = require('babel-runtime/helpers/defineProperty');\n\nvar _defineProperty3 = _interopRequireDefault(_defineProperty2);\n\nvar _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');\n\nvar _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _toConsumableArray2 = require('babel-runtime/helpers/toConsumableArray');\n\nvar _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);\n\nvar _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = require('babel-runtime/helpers/createClass');\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = require('babel-runtime/helpers/inherits');\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _classnames = require('classnames');\n\nvar _classnames2 = _interopRequireDefault(_classnames);\n\nvar _keycode = require('keycode');\n\nvar _keycode2 = _interopRequireDefault(_keycode);\n\nvar _warning = require('warning');\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nvar _ArrowDropDown = require('../internal/svg-icons/ArrowDropDown');\n\nvar _ArrowDropDown2 = _interopRequireDefault(_ArrowDropDown);\n\nvar _Menu = require('../Menu/Menu');\n\nvar _Menu2 = _interopRequireDefault(_Menu);\n\nvar _Input = require('../Input/Input');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @ignore - internal component.\n */\nvar SelectInput = function (_React$Component) {\n (0, _inherits3.default)(SelectInput, _React$Component);\n\n function SelectInput() {\n var _ref;\n\n var _temp, _this, _ret;\n\n (0, _classCallCheck3.default)(this, SelectInput);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = SelectInput.__proto__ || (0, _getPrototypeOf2.default)(SelectInput)).call.apply(_ref, [this].concat(args))), _this), _this.state = {\n open: false\n }, _this.ignoreNextBlur = false, _this.displayNode = null, _this.isControlled = _this.props.open !== undefined, _this.update = _this.isControlled ? function (_ref2) {\n var event = _ref2.event,\n open = _ref2.open;\n\n if (open) {\n _this.props.onOpen(event);\n } else {\n _this.props.onClose(event);\n }\n } : function (_ref3) {\n var open = _ref3.open;\n return _this.setState({ open: open });\n }, _this.handleClick = function (event) {\n // Opening the menu is going to blur the. It will be focused back when closed.\n _this.ignoreNextBlur = true;\n _this.update({\n open: true,\n event: event\n });\n }, _this.handleClose = function (event) {\n _this.update({\n open: false,\n event: event\n });\n }, _this.handleItemClick = function (child) {\n return function (event) {\n if (!_this.props.multiple) {\n _this.update({\n open: false,\n event: event\n });\n }\n\n var _this$props = _this.props,\n onChange = _this$props.onChange,\n name = _this$props.name;\n\n\n if (onChange) {\n var value = void 0;\n var target = void 0;\n\n if (event.target) {\n target = event.target;\n }\n\n if (_this.props.multiple) {\n value = Array.isArray(_this.props.value) ? [].concat((0, _toConsumableArray3.default)(_this.props.value)) : [];\n var itemIndex = value.indexOf(child.props.value);\n if (itemIndex === -1) {\n value.push(child.props.value);\n } else {\n value.splice(itemIndex, 1);\n }\n } else {\n value = child.props.value;\n }\n\n event.persist();\n event.target = (0, _extends3.default)({}, target, { value: value, name: name });\n\n onChange(event, child);\n }\n };\n }, _this.handleBlur = function (event) {\n if (_this.ignoreNextBlur === true) {\n // The parent components are relying on the bubbling of the event.\n event.stopPropagation();\n _this.ignoreNextBlur = false;\n return;\n }\n\n if (_this.props.onBlur) {\n _this.props.onBlur(event);\n }\n }, _this.handleKeyDown = function (event) {\n if (_this.props.readOnly) {\n return;\n }\n\n if (['space', 'up', 'down'].includes((0, _keycode2.default)(event))) {\n event.preventDefault();\n // Opening the menu is going to blur the. It will be focused back when closed.\n _this.ignoreNextBlur = true;\n _this.update({\n open: true,\n event: event\n });\n }\n }, _this.handleSelectRef = function (node) {\n if (!_this.props.inputRef) {\n return;\n }\n\n _this.props.inputRef({\n node: node,\n // By pass the native input as we expose a rich object (array).\n value: _this.props.value\n });\n }, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret);\n }\n\n (0, _createClass3.default)(SelectInput, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n if (this.isControlled && this.props.open) {\n // Focus the display node so the focus is restored on this element once\n // the menu is closed.\n this.displayNode.focus();\n // Rerender with the resolve `displayNode` reference.\n this.forceUpdate();\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n var _props = this.props,\n autoWidth = _props.autoWidth,\n children = _props.children,\n classes = _props.classes,\n classNameProp = _props.className,\n disabled = _props.disabled,\n displayEmpty = _props.displayEmpty,\n inputRef = _props.inputRef,\n _props$MenuProps = _props.MenuProps,\n MenuProps = _props$MenuProps === undefined ? {} : _props$MenuProps,\n multiple = _props.multiple,\n name = _props.name,\n native = _props.native,\n onBlur = _props.onBlur,\n onChange = _props.onChange,\n onClose = _props.onClose,\n onFocus = _props.onFocus,\n onOpen = _props.onOpen,\n openProp = _props.open,\n readOnly = _props.readOnly,\n renderValue = _props.renderValue,\n SelectDisplayProps = _props.SelectDisplayProps,\n tabIndexProp = _props.tabIndex,\n _props$type = _props.type,\n type = _props$type === undefined ? 'hidden' : _props$type,\n value = _props.value,\n other = (0, _objectWithoutProperties3.default)(_props, ['autoWidth', 'children', 'classes', 'className', 'disabled', 'displayEmpty', 'inputRef', 'MenuProps', 'multiple', 'name', 'native', 'onBlur', 'onChange', 'onClose', 'onFocus', 'onOpen', 'open', 'readOnly', 'renderValue', 'SelectDisplayProps', 'tabIndex', 'type', 'value']);\n\n var open = this.isControlled && this.displayNode ? openProp : this.state.open;\n\n if (native) {\n process.env.NODE_ENV !== \"production\" ? (0, _warning2.default)(multiple === false, 'Material-UI: you can not use the `native` and `multiple` properties ' + 'at the same time on a `Select` component.') : void 0;\n process.env.NODE_ENV !== \"production\" ? (0, _warning2.default)(!renderValue, 'Material-UI: the `renderValue` property is not used by the native implementation.') : void 0;\n process.env.NODE_ENV !== \"production\" ? (0, _warning2.default)(!displayEmpty, 'Material-UI: the `displayEmpty` property is not used by the native implementation.') : void 0;\n\n return _react2.default.createElement(\n 'div',\n { className: classes.root },\n _react2.default.createElement(\n 'select',\n (0, _extends3.default)({\n className: (0, _classnames2.default)(classes.select, (0, _defineProperty3.default)({}, classes.disabled, disabled), classNameProp),\n name: name,\n disabled: disabled,\n onBlur: onBlur,\n onChange: onChange,\n onFocus: onFocus,\n value: value,\n readOnly: readOnly,\n ref: inputRef\n }, other),\n children\n ),\n _react2.default.createElement(_ArrowDropDown2.default, { className: classes.icon })\n );\n }\n\n if (value === undefined) {\n throw new Error('Material-UI: the `value` property is required ' + 'when using the `Select` component with `native=false`.');\n }\n\n var display = void 0;\n var displaySingle = '';\n var displayMultiple = [];\n var computeDisplay = false;\n\n // No need to display any value if the field is empty.\n if ((0, _Input.isDirty)(this.props) || displayEmpty) {\n if (renderValue) {\n display = renderValue(value);\n } else {\n computeDisplay = true;\n }\n }\n\n var items = _react2.default.Children.map(children, function (child) {\n if (!_react2.default.isValidElement(child)) {\n return null;\n }\n var selected = void 0;\n\n if (multiple) {\n if (!Array.isArray(value)) {\n throw new Error('Material-UI: the `value` property must be an array ' + 'when using the `Select` component with `multiple`.');\n }\n\n selected = value.indexOf(child.props.value) !== -1;\n if (selected && computeDisplay) {\n displayMultiple.push(child.props.children);\n }\n } else {\n selected = value === child.props.value;\n if (selected && computeDisplay) {\n displaySingle = child.props.children;\n }\n }\n\n return _react2.default.cloneElement(child, {\n role: 'option',\n selected: selected,\n onClick: _this2.handleItemClick(child)\n });\n });\n\n if (computeDisplay) {\n display = multiple ? displayMultiple.join(', ') : displaySingle;\n }\n\n var MenuMinWidth = this.displayNode && !autoWidth ? this.displayNode.clientWidth : undefined;\n\n var tabIndex = void 0;\n if (typeof tabIndexProp !== 'undefined') {\n tabIndex = tabIndexProp;\n } else {\n tabIndex = disabled ? null : 0;\n }\n\n return _react2.default.createElement(\n 'div',\n { className: classes.root },\n _react2.default.createElement(\n 'div',\n (0, _extends3.default)({\n className: (0, _classnames2.default)(classes.select, classes.selectMenu, (0, _defineProperty3.default)({}, classes.disabled, disabled), classNameProp),\n ref: function ref(node) {\n _this2.displayNode = node;\n },\n\n 'aria-pressed': open ? 'true' : 'false',\n tabIndex: tabIndex,\n role: 'button',\n 'aria-owns': open ? 'menu-' + (name || '') : null,\n 'aria-haspopup': 'true',\n onKeyDown: this.handleKeyDown,\n onBlur: this.handleBlur,\n onClick: disabled || readOnly ? null : this.handleClick,\n onFocus: onFocus\n }, SelectDisplayProps),\n _react2.default.createElement('span', { dangerouslySetInnerHTML: { __html: '' } }),\n display\n ),\n _react2.default.createElement('input', (0, _extends3.default)({\n value: Array.isArray(value) ? value.join(',') : value,\n name: name,\n readOnly: readOnly,\n ref: this.handleSelectRef,\n type: type\n }, other)),\n _react2.default.createElement(_ArrowDropDown2.default, { className: classes.icon }),\n _react2.default.createElement(\n _Menu2.default,\n (0, _extends3.default)({\n id: 'menu-' + (name || ''),\n anchorEl: this.displayNode,\n open: open,\n onClose: this.handleClose\n }, MenuProps, {\n MenuListProps: (0, _extends3.default)({\n role: 'listbox'\n }, MenuProps.MenuListProps),\n PaperProps: (0, _extends3.default)({}, MenuProps.PaperProps, {\n style: (0, _extends3.default)({\n minWidth: MenuMinWidth\n }, MenuProps.PaperProps != null ? MenuProps.PaperProps.style : null)\n })\n }),\n items\n )\n );\n }\n }]);\n return SelectInput;\n}(_react2.default.Component);\n\nSelectInput.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * If true, the width of the popover will automatically be set according to the items inside the\n * menu, otherwise it will be at least the width of the select input.\n */\n autoWidth: _propTypes2.default.bool,\n /**\n * The option elements to populate the select with.\n * Can be some `MenuItem` when `native` is false and `option` when `native` is true.\n */\n children: _propTypes2.default.node,\n /**\n * Useful to extend the style applied to components.\n */\n classes: _propTypes2.default.object.isRequired,\n /**\n * The CSS class name of the select element.\n */\n className: _propTypes2.default.string,\n /**\n * If `true`, the select will be disabled.\n */\n disabled: _propTypes2.default.bool,\n /**\n * If `true`, the selected item is displayed even if its value is empty.\n * You can only use it when the `native` property is `false` (default).\n */\n displayEmpty: _propTypes2.default.bool,\n /**\n * Use that property to pass a ref callback to the native select element.\n */\n inputRef: _propTypes2.default.func,\n /**\n * Properties applied to the `Menu` element.\n */\n MenuProps: _propTypes2.default.object,\n /**\n * If true, `value` must be an array and the menu will support multiple selections.\n * You can only use it when the `native` property is `false` (default).\n */\n multiple: _propTypes2.default.bool,\n /**\n * Name attribute of the `select` or hidden `input` element.\n */\n name: _propTypes2.default.string,\n /**\n * If `true`, the component will be using a native `select` element.\n */\n native: _propTypes2.default.bool,\n /**\n * @ignore\n */\n onBlur: _propTypes2.default.func,\n /**\n * Callback function fired when a menu item is selected.\n *\n * @param {object} event The event source of the callback\n * @param {object} child The react element that was selected\n */\n onChange: _propTypes2.default.func,\n /**\n * Callback fired when the component requests to be closed.\n * Useful in controlled mode (see open).\n *\n * @param {object} event The event source of the callback\n */\n onClose: _propTypes2.default.func,\n /**\n * @ignore\n */\n onFocus: _propTypes2.default.func,\n /**\n * Callback fired when the component requests to be opened.\n * Useful in controlled mode (see open).\n *\n * @param {object} event The event source of the callback\n */\n onOpen: _propTypes2.default.func,\n /**\n * Control `select` open state.\n * You can only use it when the `native` property is `false` (default).\n */\n open: _propTypes2.default.bool,\n /**\n * @ignore\n */\n readOnly: _propTypes2.default.bool,\n /**\n * Render the selected value.\n * You can only use it when the `native` property is `false` (default).\n */\n renderValue: _propTypes2.default.func,\n /**\n * Properties applied to the clickable div element.\n */\n SelectDisplayProps: _propTypes2.default.object,\n /**\n * @ignore\n */\n tabIndex: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.string]),\n /**\n * @ignore\n */\n type: _propTypes2.default.string,\n /**\n * The value of the component, required for a controlled component.\n */\n value: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number, _propTypes2.default.arrayOf(_propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]))])\n} : {};\n\nexports.default = SelectInput;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.styles = undefined;\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _defineProperty2 = require('babel-runtime/helpers/defineProperty');\n\nvar _defineProperty3 = _interopRequireDefault(_defineProperty2);\n\nvar _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');\n\nvar _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _classnames = require('classnames');\n\nvar _classnames2 = _interopRequireDefault(_classnames);\n\nvar _withStyles = require('../styles/withStyles');\n\nvar _withStyles2 = _interopRequireDefault(_withStyles);\n\nvar _helpers = require('../utils/helpers');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar styles = exports.styles = function styles(theme) {\n return {\n root: {\n display: 'inline-block',\n fill: 'currentColor',\n height: 24,\n width: 24,\n userSelect: 'none',\n flexShrink: 0,\n transition: theme.transitions.create('fill', {\n duration: theme.transitions.duration.shorter\n })\n },\n colorPrimary: {\n color: theme.palette.primary.main\n },\n colorSecondary: {\n color: theme.palette.secondary.main\n },\n colorAction: {\n color: theme.palette.action.active\n },\n colorDisabled: {\n color: theme.palette.action.disabled\n },\n colorError: {\n color: theme.palette.error.main\n },\n fontSize: {\n width: '1em',\n height: '1em'\n }\n };\n};\n\nfunction SvgIcon(props) {\n var _classNames;\n\n var children = props.children,\n classes = props.classes,\n classNameProp = props.className,\n color = props.color,\n fontSize = props.fontSize,\n nativeColor = props.nativeColor,\n titleAccess = props.titleAccess,\n viewBox = props.viewBox,\n other = (0, _objectWithoutProperties3.default)(props, ['children', 'classes', 'className', 'color', 'fontSize', 'nativeColor', 'titleAccess', 'viewBox']);\n\n\n var className = (0, _classnames2.default)(classes.root, (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes['color' + (0, _helpers.capitalize)(color)], color !== 'inherit'), (0, _defineProperty3.default)(_classNames, classes.fontSize, fontSize), _classNames), classNameProp);\n\n return _react2.default.createElement(\n 'svg',\n (0, _extends3.default)({\n className: className,\n focusable: 'false',\n viewBox: viewBox,\n color: nativeColor,\n 'aria-hidden': titleAccess ? 'false' : 'true'\n }, other),\n titleAccess ? _react2.default.createElement(\n 'title',\n null,\n titleAccess\n ) : null,\n children\n );\n}\n\nSvgIcon.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * Node passed into the SVG element.\n */\n children: _propTypes2.default.node.isRequired,\n /**\n * Useful to extend the style applied to components.\n */\n classes: _propTypes2.default.object.isRequired,\n /**\n * @ignore\n */\n className: _propTypes2.default.string,\n /**\n * The color of the component. It supports those theme colors that make sense for this component.\n * You can use the `nativeColor` property to apply a color attribute to the SVG element.\n */\n color: _propTypes2.default.oneOf(['action', 'disabled', 'error', 'inherit', 'primary', 'secondary']),\n /**\n * If `true`, the icon size will be determined by the font-size.\n */\n fontSize: _propTypes2.default.bool,\n /**\n * Applies a color attribute to the SVG element.\n */\n nativeColor: _propTypes2.default.string,\n /**\n * Provides a human-readable title for the element that contains it.\n * https://www.w3.org/TR/SVG-access/#Equivalent\n */\n titleAccess: _propTypes2.default.string,\n /**\n * Allows you to redefine what the coordinates without units mean inside an SVG element.\n * For example, if the SVG element is 500 (width) by 200 (height),\n * and you pass viewBox=\"0 0 50 20\",\n * this means that the coordinates inside the SVG will go from the top left corner (0,0)\n * to bottom right (50,20) and each unit will be worth 10px.\n */\n viewBox: _propTypes2.default.string\n} : {};\n\nSvgIcon.defaultProps = {\n color: 'inherit',\n fontSize: false,\n viewBox: '0 0 24 24'\n};\n\nSvgIcon.muiName = 'SvgIcon';\n\nexports.default = (0, _withStyles2.default)(styles, { name: 'MuiSvgIcon' })(SvgIcon);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _SvgIcon = require('./SvgIcon');\n\nObject.defineProperty(exports, 'default', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_SvgIcon).default;\n }\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');\n\nvar _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _warning = require('warning');\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _Input = require('../Input');\n\nvar _Input2 = _interopRequireDefault(_Input);\n\nvar _FormControl = require('../Form/FormControl');\n\nvar _FormControl2 = _interopRequireDefault(_FormControl);\n\nvar _FormHelperText = require('../Form/FormHelperText');\n\nvar _FormHelperText2 = _interopRequireDefault(_FormHelperText);\n\nvar _Select = require('../Select/Select');\n\nvar _Select2 = _interopRequireDefault(_Select);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * The `TextField` is a convenience wrapper for the most common cases (80%).\n * It cannot be all things to all people, otherwise the API would grow out of control.\n *\n * ## Advanced Configuration\n *\n * It's important to understand that the text field is a simple abstraction\n * on top of the following components:\n * - [FormControl](/api/form-control)\n * - [InputLabel](/api/input-label)\n * - [Input](/api/input)\n * - [FormHelperText](/api/form-helper-text)\n *\n * If you wish to alter the properties applied to the native input, you can do as follow:\n *\n * ```jsx\n * const inputProps = {\n * step: 300,\n * };\n *\n * return ;\n * ```\n *\n * For advanced cases, please look at the source of TextField by clicking on the\n * \"Edit this page\" button above. Consider either:\n * - using the upper case props for passing values direct to the components.\n * - using the underlying components directly as shown in the demos.\n */\nfunction TextField(props) {\n var autoComplete = props.autoComplete,\n autoFocus = props.autoFocus,\n children = props.children,\n className = props.className,\n defaultValue = props.defaultValue,\n disabled = props.disabled,\n error = props.error,\n FormHelperTextProps = props.FormHelperTextProps,\n fullWidth = props.fullWidth,\n helperText = props.helperText,\n helperTextClassName = props.helperTextClassName,\n id = props.id,\n InputLabelProps = props.InputLabelProps,\n inputProps = props.inputProps,\n InputProps = props.InputProps,\n inputRef = props.inputRef,\n label = props.label,\n labelClassName = props.labelClassName,\n multiline = props.multiline,\n name = props.name,\n onChange = props.onChange,\n placeholder = props.placeholder,\n required = props.required,\n rows = props.rows,\n rowsMax = props.rowsMax,\n select = props.select,\n SelectProps = props.SelectProps,\n type = props.type,\n value = props.value,\n other = (0, _objectWithoutProperties3.default)(props, ['autoComplete', 'autoFocus', 'children', 'className', 'defaultValue', 'disabled', 'error', 'FormHelperTextProps', 'fullWidth', 'helperText', 'helperTextClassName', 'id', 'InputLabelProps', 'inputProps', 'InputProps', 'inputRef', 'label', 'labelClassName', 'multiline', 'name', 'onChange', 'placeholder', 'required', 'rows', 'rowsMax', 'select', 'SelectProps', 'type', 'value']);\n\n\n process.env.NODE_ENV !== \"production\" ? (0, _warning2.default)(!select || Boolean(children), 'Material-UI: `children` must be passed when using the `TextField` component with `select`.') : void 0;\n\n var helperTextId = helperText && id ? id + '-helper-text' : undefined;\n var InputComponent = _react2.default.createElement(_Input2.default, (0, _extends3.default)({\n autoComplete: autoComplete,\n autoFocus: autoFocus,\n defaultValue: defaultValue,\n disabled: disabled,\n fullWidth: fullWidth,\n multiline: multiline,\n name: name,\n rows: rows,\n rowsMax: rowsMax,\n type: type,\n value: value,\n id: id,\n inputRef: inputRef,\n onChange: onChange,\n placeholder: placeholder,\n inputProps: inputProps\n }, InputProps));\n\n return _react2.default.createElement(\n _FormControl2.default,\n (0, _extends3.default)({\n 'aria-describedby': helperTextId,\n className: className,\n error: error,\n fullWidth: fullWidth,\n required: required\n }, other),\n label && _react2.default.createElement(\n _Input.InputLabel,\n (0, _extends3.default)({ htmlFor: id, className: labelClassName }, InputLabelProps),\n label\n ),\n select ? _react2.default.createElement(\n _Select2.default,\n (0, _extends3.default)({ value: value, input: InputComponent }, SelectProps),\n children\n ) : InputComponent,\n helperText && _react2.default.createElement(\n _FormHelperText2.default,\n (0, _extends3.default)({ className: helperTextClassName, id: helperTextId }, FormHelperTextProps),\n helperText\n )\n );\n} // @inheritedComponent FormControl\n\nTextField.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * This property helps users to fill forms faster, especially on mobile devices.\n * The name can be confusing, as it's more like an autofill.\n * You can learn more about it here:\n * https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill\n */\n autoComplete: _propTypes2.default.string,\n /**\n * If `true`, the input will be focused during the first mount.\n */\n autoFocus: _propTypes2.default.bool,\n /**\n * @ignore\n */\n children: _propTypes2.default.node,\n /**\n * @ignore\n */\n className: _propTypes2.default.string,\n /**\n * The default value of the `Input` element.\n */\n defaultValue: _propTypes2.default.string,\n /**\n * If `true`, the input will be disabled.\n */\n disabled: _propTypes2.default.bool,\n /**\n * If `true`, the label will be displayed in an error state.\n */\n error: _propTypes2.default.bool,\n /**\n * Properties applied to the `FormHelperText` element.\n */\n FormHelperTextProps: _propTypes2.default.object,\n /**\n * If `true`, the input will take up the full width of its container.\n */\n fullWidth: _propTypes2.default.bool,\n /**\n * The helper text content.\n */\n helperText: _propTypes2.default.node,\n /**\n * The CSS class name of the helper text element.\n */\n helperTextClassName: _propTypes2.default.string,\n /**\n * The id of the `input` element.\n * Use that property to make `label` and `helperText` accessible for screen readers.\n */\n id: _propTypes2.default.string,\n /**\n * Properties applied to the `InputLabel` element.\n */\n InputLabelProps: _propTypes2.default.object,\n /**\n * Properties applied to the `Input` element.\n */\n InputProps: _propTypes2.default.object,\n /**\n * Properties applied to the native `input` element.\n */\n inputProps: _propTypes2.default.object,\n /**\n * Use that property to pass a ref callback to the native input component.\n */\n inputRef: _propTypes2.default.func,\n /**\n * The label content.\n */\n label: _propTypes2.default.node,\n /**\n * The CSS class name of the label element.\n */\n labelClassName: _propTypes2.default.string,\n /**\n * If `dense` or `normal`, will adjust vertical spacing of this and contained components.\n */\n margin: _propTypes2.default.oneOf(['none', 'dense', 'normal']),\n /**\n * If `true`, a textarea element will be rendered instead of an input.\n */\n multiline: _propTypes2.default.bool,\n /**\n * Name attribute of the `input` element.\n */\n name: _propTypes2.default.string,\n /**\n * Callback fired when the value is changed.\n *\n * @param {object} event The event source of the callback\n */\n onChange: _propTypes2.default.func,\n /**\n * The short hint displayed in the input before the user enters a value.\n */\n placeholder: _propTypes2.default.string,\n /**\n * If `true`, the label is displayed as required.\n */\n required: _propTypes2.default.bool,\n /**\n * Number of rows to display when multiline option is set to true.\n */\n rows: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]),\n /**\n * Maximum number of rows to display when multiline option is set to true.\n */\n rowsMax: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]),\n /**\n * Render a `Select` element while passing the `Input` element to `Select` as `input` parameter.\n * If this option is set you must pass the options of the select as children.\n */\n select: _propTypes2.default.bool,\n /**\n * Properties applied to the `Select` element.\n */\n SelectProps: _propTypes2.default.object,\n /**\n * Type attribute of the `Input` element. It should be a valid HTML5 input type.\n */\n type: _propTypes2.default.string,\n /**\n * The value of the `Input` element, required for a controlled component.\n */\n value: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number, _propTypes2.default.arrayOf(_propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]))])\n} : {};\n\nTextField.defaultProps = {\n required: false,\n select: false\n};\n\nexports.default = TextField;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _TextField = require('./TextField');\n\nObject.defineProperty(exports, 'default', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_TextField).default;\n }\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.styles = undefined;\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _defineProperty2 = require('babel-runtime/helpers/defineProperty');\n\nvar _defineProperty3 = _interopRequireDefault(_defineProperty2);\n\nvar _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');\n\nvar _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _classnames = require('classnames');\n\nvar _classnames2 = _interopRequireDefault(_classnames);\n\nvar _withStyles = require('../styles/withStyles');\n\nvar _withStyles2 = _interopRequireDefault(_withStyles);\n\nvar _helpers = require('../utils/helpers');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar styles = exports.styles = function styles(theme) {\n return {\n root: {\n display: 'block',\n margin: 0\n },\n display4: theme.typography.display4,\n display3: theme.typography.display3,\n display2: theme.typography.display2,\n display1: theme.typography.display1,\n headline: theme.typography.headline,\n title: theme.typography.title,\n subheading: theme.typography.subheading,\n body2: theme.typography.body2,\n body1: theme.typography.body1,\n caption: theme.typography.caption,\n button: theme.typography.button,\n alignLeft: {\n textAlign: 'left'\n },\n alignCenter: {\n textAlign: 'center'\n },\n alignRight: {\n textAlign: 'right'\n },\n alignJustify: {\n textAlign: 'justify'\n },\n noWrap: {\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap'\n },\n gutterBottom: {\n marginBottom: '0.35em'\n },\n paragraph: {\n marginBottom: theme.spacing.unit * 2\n },\n colorInherit: {\n color: 'inherit'\n },\n colorPrimary: {\n color: theme.palette.primary.main\n },\n colorSecondary: {\n color: theme.palette.secondary.main\n },\n colorTextSecondary: {\n color: theme.palette.text.secondary\n },\n colorError: {\n color: theme.palette.error.main\n }\n };\n};\n\nfunction Typography(props) {\n var _classNames;\n\n var align = props.align,\n classes = props.classes,\n classNameProp = props.className,\n componentProp = props.component,\n color = props.color,\n gutterBottom = props.gutterBottom,\n headlineMapping = props.headlineMapping,\n noWrap = props.noWrap,\n paragraph = props.paragraph,\n variant = props.variant,\n other = (0, _objectWithoutProperties3.default)(props, ['align', 'classes', 'className', 'component', 'color', 'gutterBottom', 'headlineMapping', 'noWrap', 'paragraph', 'variant']);\n\n\n var className = (0, _classnames2.default)(classes.root, classes[variant], (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes['color' + (0, _helpers.capitalize)(color)], color !== 'default'), (0, _defineProperty3.default)(_classNames, classes.noWrap, noWrap), (0, _defineProperty3.default)(_classNames, classes.gutterBottom, gutterBottom), (0, _defineProperty3.default)(_classNames, classes.paragraph, paragraph), (0, _defineProperty3.default)(_classNames, classes['align' + (0, _helpers.capitalize)(align)], align !== 'inherit'), _classNames), classNameProp);\n\n var Component = componentProp || (paragraph ? 'p' : headlineMapping[variant]) || 'span';\n\n return _react2.default.createElement(Component, (0, _extends3.default)({ className: className }, other));\n}\n\nTypography.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * Set the text-align on the component.\n */\n align: _propTypes2.default.oneOf(['inherit', 'left', 'center', 'right', 'justify']),\n /**\n * The content of the component.\n */\n children: _propTypes2.default.node,\n /**\n * Useful to extend the style applied to components.\n */\n classes: _propTypes2.default.object.isRequired,\n /**\n * @ignore\n */\n className: _propTypes2.default.string,\n /**\n * The color of the component. It supports those theme colors that make sense for this component.\n */\n color: _propTypes2.default.oneOf(['inherit', 'primary', 'textSecondary', 'secondary', 'error', 'default']),\n /**\n * The component used for the root node.\n * Either a string to use a DOM element or a component.\n * By default, it maps the variant to a good default headline component.\n */\n component: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]),\n /**\n * If `true`, the text will have a bottom margin.\n */\n gutterBottom: _propTypes2.default.bool,\n /**\n * We are empirically mapping the variant property to a range of different DOM element types.\n * For instance, h1 to h6. If you wish to change that mapping, you can provide your own.\n * Alternatively, you can use the `component` property.\n */\n headlineMapping: _propTypes2.default.object,\n /**\n * If `true`, the text will not wrap, but instead will truncate with an ellipsis.\n */\n noWrap: _propTypes2.default.bool,\n /**\n * If `true`, the text will have a bottom margin.\n */\n paragraph: _propTypes2.default.bool,\n /**\n * Applies the theme typography styles.\n */\n variant: _propTypes2.default.oneOf(['display4', 'display3', 'display2', 'display1', 'headline', 'title', 'subheading', 'body2', 'body1', 'caption', 'button'])\n} : {};\n\nTypography.defaultProps = {\n align: 'inherit',\n color: 'default',\n gutterBottom: false,\n headlineMapping: {\n display4: 'h1',\n display3: 'h1',\n display2: 'h1',\n display1: 'h1',\n headline: 'h1',\n title: 'h2',\n subheading: 'h3',\n body2: 'aside',\n body1: 'p'\n },\n noWrap: false,\n paragraph: false,\n variant: 'body1'\n};\n\nexports.default = (0, _withStyles2.default)(styles, { name: 'MuiTypography' })(Typography);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _Typography = require('./Typography');\n\nObject.defineProperty(exports, 'default', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_Typography).default;\n }\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar common = {\n black: '#000',\n white: '#fff'\n};\n\nexports.default = common;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar grey = {\n 50: '#fafafa',\n 100: '#f5f5f5',\n 200: '#eeeeee',\n 300: '#e0e0e0',\n 400: '#bdbdbd',\n 500: '#9e9e9e',\n 600: '#757575',\n 700: '#616161',\n 800: '#424242',\n 900: '#212121',\n A100: '#d5d5d5',\n A200: '#aaaaaa',\n A400: '#303030',\n A700: '#616161'\n};\n\nexports.default = grey;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar indigo = {\n 50: '#e8eaf6',\n 100: '#c5cae9',\n 200: '#9fa8da',\n 300: '#7986cb',\n 400: '#5c6bc0',\n 500: '#3f51b5',\n 600: '#3949ab',\n 700: '#303f9f',\n 800: '#283593',\n 900: '#1a237e',\n A100: '#8c9eff',\n A200: '#536dfe',\n A400: '#3d5afe',\n A700: '#304ffe'\n};\n\nexports.default = indigo;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar pink = {\n 50: '#fce4ec',\n 100: '#f8bbd0',\n 200: '#f48fb1',\n 300: '#f06292',\n 400: '#ec407a',\n 500: '#e91e63',\n 600: '#d81b60',\n 700: '#c2185b',\n 800: '#ad1457',\n 900: '#880e4f',\n A100: '#ff80ab',\n A200: '#ff4081',\n A400: '#f50057',\n A700: '#c51162'\n};\n\nexports.default = pink;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar red = {\n 50: '#ffebee',\n 100: '#ffcdd2',\n 200: '#ef9a9a',\n 300: '#e57373',\n 400: '#ef5350',\n 500: '#f44336',\n 600: '#e53935',\n 700: '#d32f2f',\n 800: '#c62828',\n 900: '#b71c1c',\n A100: '#ff8a80',\n A200: '#ff5252',\n A400: '#ff1744',\n A700: '#d50000'\n};\n\nexports.default = red;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = require('babel-runtime/helpers/createClass');\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = require('babel-runtime/helpers/inherits');\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @ignore - internal component.\n *\n * Internal helper component to allow attaching a ref to a\n * child element that may not accept refs (functional component).\n */\nvar RefHolder = function (_React$Component) {\n (0, _inherits3.default)(RefHolder, _React$Component);\n\n function RefHolder() {\n (0, _classCallCheck3.default)(this, RefHolder);\n return (0, _possibleConstructorReturn3.default)(this, (RefHolder.__proto__ || (0, _getPrototypeOf2.default)(RefHolder)).apply(this, arguments));\n }\n\n (0, _createClass3.default)(RefHolder, [{\n key: 'render',\n value: function render() {\n return this.props.children;\n }\n }]);\n return RefHolder;\n}(_react2.default.Component);\n\nRefHolder.propTypes = process.env.NODE_ENV !== \"production\" ? {\n children: _propTypes2.default.node\n} : {};\n\nexports.default = RefHolder;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _pure = require('recompose/pure');\n\nvar _pure2 = _interopRequireDefault(_pure);\n\nvar _SvgIcon = require('../../SvgIcon');\n\nvar _SvgIcon2 = _interopRequireDefault(_SvgIcon);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @ignore - internal component.\n */\nvar _ref = _react2.default.createElement('path', { d: 'M7 10l5 5 5-5z' });\n\nvar ArrowDropDown = function ArrowDropDown(props) {\n return _react2.default.createElement(\n _SvgIcon2.default,\n props,\n _ref\n );\n};\n\nArrowDropDown = (0, _pure2.default)(ArrowDropDown);\nArrowDropDown.muiName = 'SvgIcon';\n\nexports.default = ArrowDropDown;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _defineProperty2 = require('babel-runtime/helpers/defineProperty');\n\nvar _defineProperty3 = _interopRequireDefault(_defineProperty2);\n\nvar _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = require('babel-runtime/helpers/createClass');\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = require('babel-runtime/helpers/inherits');\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _warning = require('warning');\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nvar _brcast = require('brcast');\n\nvar _brcast2 = _interopRequireDefault(_brcast);\n\nvar _themeListener = require('./themeListener');\n\nvar _themeListener2 = _interopRequireDefault(_themeListener);\n\nvar _exactProp = require('../utils/exactProp');\n\nvar _exactProp2 = _interopRequireDefault(_exactProp);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * This component takes a `theme` property.\n * It makes the `theme` available down the React tree thanks to React context.\n * This component should preferably be used at **the root of your component tree**.\n */\nvar MuiThemeProvider = function (_React$Component) {\n (0, _inherits3.default)(MuiThemeProvider, _React$Component);\n\n function MuiThemeProvider(props, context) {\n (0, _classCallCheck3.default)(this, MuiThemeProvider);\n\n // Get the outer theme from the context, can be null\n var _this = (0, _possibleConstructorReturn3.default)(this, (MuiThemeProvider.__proto__ || (0, _getPrototypeOf2.default)(MuiThemeProvider)).call(this, props, context));\n\n _this.broadcast = (0, _brcast2.default)();\n _this.unsubscribeId = null;\n _this.outerTheme = null;\n _this.outerTheme = _themeListener2.default.initial(context);\n // Propagate the theme so it can be accessed by the children\n _this.broadcast.setState(_this.mergeOuterLocalTheme(_this.props.theme));\n return _this;\n }\n\n (0, _createClass3.default)(MuiThemeProvider, [{\n key: 'getChildContext',\n value: function getChildContext() {\n var _ref;\n\n var _props = this.props,\n sheetsManager = _props.sheetsManager,\n disableStylesGeneration = _props.disableStylesGeneration;\n\n var muiThemeProviderOptions = this.context.muiThemeProviderOptions || {};\n\n if (sheetsManager !== undefined) {\n muiThemeProviderOptions.sheetsManager = sheetsManager;\n }\n\n if (disableStylesGeneration !== undefined) {\n muiThemeProviderOptions.disableStylesGeneration = disableStylesGeneration;\n }\n\n return _ref = {}, (0, _defineProperty3.default)(_ref, _themeListener.CHANNEL, this.broadcast), (0, _defineProperty3.default)(_ref, 'muiThemeProviderOptions', muiThemeProviderOptions), _ref;\n }\n }, {\n key: 'componentDidMount',\n value: function componentDidMount() {\n var _this2 = this;\n\n // Subscribe on the outer theme, if present\n this.unsubscribeId = _themeListener2.default.subscribe(this.context, function (outerTheme) {\n _this2.outerTheme = outerTheme;\n // Forward the parent theme update to the children\n _this2.broadcast.setState(_this2.mergeOuterLocalTheme(_this2.props.theme));\n });\n }\n }, {\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps(nextProps) {\n // Propagate a local theme update\n if (this.props.theme !== nextProps.theme) {\n this.broadcast.setState(this.mergeOuterLocalTheme(nextProps.theme));\n }\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n if (this.unsubscribeId !== null) {\n _themeListener2.default.unsubscribe(this.context, this.unsubscribeId);\n }\n }\n // We are not using the React state in order to avoid unnecessary rerender.\n\n }, {\n key: 'mergeOuterLocalTheme',\n\n\n // Simple merge between the outer theme and the local theme\n value: function mergeOuterLocalTheme(localTheme) {\n // To support composition of theme.\n if (typeof localTheme === 'function') {\n process.env.NODE_ENV !== \"production\" ? (0, _warning2.default)(this.outerTheme, ['Material-UI: you are providing a theme function property ' + 'to the MuiThemeProvider component:', ' outerTheme} />', '', 'However, no outer theme is present.', 'Make sure a theme is already injected higher in the React tree ' + 'or provide a theme object.'].join('\\n')) : void 0;\n return localTheme(this.outerTheme);\n }\n\n if (!this.outerTheme) {\n return localTheme;\n }\n\n return (0, _extends3.default)({}, this.outerTheme, localTheme);\n }\n }, {\n key: 'render',\n value: function render() {\n return this.props.children;\n }\n }]);\n return MuiThemeProvider;\n}(_react2.default.Component);\n\nMuiThemeProvider.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * You can only provide a single element with react@15, a node with react@16.\n */\n children: _propTypes2.default.node.isRequired,\n /**\n * You can disable the generation of the styles with this option.\n * It can be useful when traversing the React tree outside of the HTML\n * rendering step on the server.\n * Let's say you are using react-apollo to extract all\n * the queries made by the interface server side.\n * You can significantly speed up the traversal with this property.\n */\n disableStylesGeneration: _propTypes2.default.bool,\n /**\n * The sheetsManager is used to deduplicate style sheet injection in the page.\n * It's deduplicating using the (theme, styles) couple.\n * On the server, you should provide a new instance for each request.\n */\n sheetsManager: _propTypes2.default.object,\n /**\n * A theme object.\n */\n theme: _propTypes2.default.oneOfType([_propTypes2.default.object, _propTypes2.default.func]).isRequired\n} : {};\n\nMuiThemeProvider.propTypes = process.env.NODE_ENV !== \"production\" ? (0, _exactProp2.default)(MuiThemeProvider.propTypes, 'MuiThemeProvider') : {};\n\nMuiThemeProvider.childContextTypes = (0, _extends3.default)({}, _themeListener2.default.contextTypes, {\n muiThemeProviderOptions: _propTypes2.default.object\n});\n\nMuiThemeProvider.contextTypes = (0, _extends3.default)({}, _themeListener2.default.contextTypes, {\n muiThemeProviderOptions: _propTypes2.default.object\n});\n\nexports.default = MuiThemeProvider;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.convertHexToRGB = convertHexToRGB;\nexports.decomposeColor = decomposeColor;\nexports.recomposeColor = recomposeColor;\nexports.getContrastRatio = getContrastRatio;\nexports.getLuminance = getLuminance;\nexports.emphasize = emphasize;\nexports.fade = fade;\nexports.darken = darken;\nexports.lighten = lighten;\n\nvar _warning = require('warning');\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Returns a number whose value is limited to the given range.\n *\n * @param {number} value The value to be clamped\n * @param {number} min The lower boundary of the output range\n * @param {number} max The upper boundary of the output range\n * @returns {number} A number in the range [min, max]\n */\nfunction clamp(value) {\n var min = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var max = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n\n process.env.NODE_ENV !== \"production\" ? (0, _warning2.default)(value >= min && value <= max, 'Material-UI: the value provided ' + value + ' is out of range [' + min + ', ' + max + '].') : void 0;\n\n if (value < min) {\n return min;\n }\n if (value > max) {\n return max;\n }\n return value;\n}\n\n/**\n * Converts a color from CSS hex format to CSS rgb format.\n *\n * @param {string} color - Hex color, i.e. #nnn or #nnnnnn\n * @returns {string} A CSS rgb color string\n */\n// weak\n/* eslint-disable no-use-before-define */\n\nfunction convertHexToRGB(color) {\n color = color.substr(1);\n\n var re = new RegExp('.{1,' + color.length / 3 + '}', 'g');\n var colors = color.match(re);\n\n if (colors && colors[0].length === 1) {\n colors = colors.map(function (n) {\n return n + n;\n });\n }\n\n return colors ? 'rgb(' + colors.map(function (n) {\n return parseInt(n, 16);\n }).join(', ') + ')' : '';\n}\n\n/**\n * Returns an object with the type and values of a color.\n *\n * Note: Does not support rgb % values.\n *\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @returns {object} - A MUI color object: {type: string, values: number[]}\n */\nfunction decomposeColor(color) {\n if (color.charAt(0) === '#') {\n return decomposeColor(convertHexToRGB(color));\n }\n\n var marker = color.indexOf('(');\n var type = color.substring(0, marker);\n var values = color.substring(marker + 1, color.length - 1).split(',');\n values = values.map(function (value) {\n return parseFloat(value);\n });\n\n return { type: type, values: values };\n}\n\n/**\n * Converts a color object with type and values to a string.\n *\n * @param {object} color - Decomposed color\n * @param {string} color.type - One of: 'rgb', 'rgba', 'hsl', 'hsla'\n * @param {array} color.values - [n,n,n] or [n,n,n,n]\n * @returns {string} A CSS color string\n */\nfunction recomposeColor(color) {\n var type = color.type;\n var values = color.values;\n\n\n if (type.indexOf('rgb') > -1) {\n // Only convert the first 3 values to int (i.e. not alpha)\n values = values.map(function (n, i) {\n return i < 3 ? parseInt(n, 10) : n;\n });\n }\n\n if (type.indexOf('hsl') > -1) {\n values[1] = values[1] + '%';\n values[2] = values[2] + '%';\n }\n\n return color.type + '(' + values.join(', ') + ')';\n}\n\n/**\n * Calculates the contrast ratio between two colors.\n *\n * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests\n *\n * @param {string} foreground - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @param {string} background - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @returns {number} A contrast ratio value in the range 0 - 21.\n */\nfunction getContrastRatio(foreground, background) {\n var lumA = getLuminance(foreground);\n var lumB = getLuminance(background);\n return (Math.max(lumA, lumB) + 0.05) / (Math.min(lumA, lumB) + 0.05);\n}\n\n/**\n * The relative brightness of any point in a color space,\n * normalized to 0 for darkest black and 1 for lightest white.\n *\n * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests\n *\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @returns {number} The relative brightness of the color in the range 0 - 1\n */\nfunction getLuminance(color) {\n var decomposedColor = decomposeColor(color);\n\n if (decomposedColor.type.indexOf('rgb') > -1) {\n var rgb = decomposedColor.values.map(function (val) {\n val /= 255; // normalized\n return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4);\n });\n // Truncate at 3 digits\n return Number((0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2]).toFixed(3));\n } else if (decomposedColor.type.indexOf('hsl') > -1) {\n return decomposedColor.values[2] / 100;\n }\n\n throw new Error('Material-UI: unsupported `' + color + '` color.');\n}\n\n/**\n * Darken or lighten a colour, depending on its luminance.\n * Light colors are darkened, dark colors are lightened.\n *\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @param {number} coefficient=0.15 - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nfunction emphasize(color) {\n var coefficient = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.15;\n\n return getLuminance(color) > 0.5 ? darken(color, coefficient) : lighten(color, coefficient);\n}\n\n/**\n * Set the absolute transparency of a color.\n * Any existing alpha values are overwritten.\n *\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @param {number} value - value to set the alpha channel to in the range 0 -1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nfunction fade(color, value) {\n process.env.NODE_ENV !== \"production\" ? (0, _warning2.default)(color, 'Material-UI: missing color argument in fade(' + color + ', ' + value + ').') : void 0;\n\n if (!color) return color;\n\n color = decomposeColor(color);\n value = clamp(value);\n\n if (color.type === 'rgb' || color.type === 'hsl') {\n color.type += 'a';\n }\n color.values[3] = value;\n\n return recomposeColor(color);\n}\n\n/**\n * Darkens a color.\n *\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @param {number} coefficient - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nfunction darken(color, coefficient) {\n process.env.NODE_ENV !== \"production\" ? (0, _warning2.default)(color, 'Material-UI: missing color argument in darken(' + color + ', ' + coefficient + ').') : void 0;\n\n if (!color) return color;\n\n color = decomposeColor(color);\n coefficient = clamp(coefficient);\n\n if (color.type.indexOf('hsl') > -1) {\n color.values[2] *= 1 - coefficient;\n } else if (color.type.indexOf('rgb') > -1) {\n for (var i = 0; i < 3; i += 1) {\n color.values[i] *= 1 - coefficient;\n }\n }\n return recomposeColor(color);\n}\n\n/**\n * Lightens a color.\n *\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @param {number} coefficient - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nfunction lighten(color, coefficient) {\n process.env.NODE_ENV !== \"production\" ? (0, _warning2.default)(color, 'Material-UI: missing color argument in lighten(' + color + ', ' + coefficient + ').') : void 0;\n\n if (!color) return color;\n\n color = decomposeColor(color);\n coefficient = clamp(coefficient);\n\n if (color.type.indexOf('hsl') > -1) {\n color.values[2] += (100 - color.values[2]) * coefficient;\n } else if (color.type.indexOf('rgb') > -1) {\n for (var i = 0; i < 3; i += 1) {\n color.values[i] += (255 - color.values[i]) * coefficient;\n }\n }\n\n return recomposeColor(color);\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.keys = undefined;\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');\n\nvar _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);\n\nexports.default = createBreakpoints;\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// Sorted ASC by size. That's important.\n// It can't be configured as it's used statically for propTypes.\nvar keys = exports.keys = ['xs', 'sm', 'md', 'lg', 'xl'];\n\n// Keep in mind that @media is inclusive by the CSS specification.\nfunction createBreakpoints(breakpoints) {\n var _breakpoints$values = breakpoints.values,\n values = _breakpoints$values === undefined ? {\n xs: 0,\n sm: 600,\n md: 960,\n lg: 1280,\n xl: 1920\n } : _breakpoints$values,\n _breakpoints$unit = breakpoints.unit,\n unit = _breakpoints$unit === undefined ? 'px' : _breakpoints$unit,\n _breakpoints$step = breakpoints.step,\n step = _breakpoints$step === undefined ? 5 : _breakpoints$step,\n other = (0, _objectWithoutProperties3.default)(breakpoints, ['values', 'unit', 'step']);\n\n\n function up(key) {\n var value = typeof values[key] === 'number' ? values[key] : key;\n return '@media (min-width:' + value + unit + ')';\n }\n\n function down(key) {\n var endIndex = keys.indexOf(key) + 1;\n var upperbound = values[keys[endIndex]];\n\n if (endIndex === keys.length) {\n // xl down applies to all sizes\n return up('xs');\n }\n\n var value = typeof upperbound === 'number' && endIndex > 0 ? upperbound : key;\n return '@media (max-width:' + (value - step / 100) + unit + ')';\n }\n\n function between(start, end) {\n var endIndex = keys.indexOf(end) + 1;\n\n if (endIndex === keys.length) {\n return up(start);\n }\n\n return '@media (min-width:' + values[start] + unit + ') and ' + ('(max-width:' + (values[keys[endIndex]] - step / 100) + unit + ')');\n }\n\n function only(key) {\n return between(key, key);\n }\n\n function width(key) {\n return values[key];\n }\n\n return (0, _extends3.default)({\n keys: keys,\n values: values,\n up: up,\n down: down,\n between: between,\n only: only,\n width: width\n }, other);\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = createGenerateClassName;\n\nvar _warning = require('warning');\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar generatorCounter = 0;\n\n// Returns a function which generates unique class names based on counters.\n// When new generator function is created, rule counter is reset.\n// We need to reset the rule counter for SSR for each request.\n//\n// It's inspired by\n// https://github.com/cssinjs/jss/blob/4e6a05dd3f7b6572fdd3ab216861d9e446c20331/src/utils/createGenerateClassName.js\nfunction createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$dangerouslyU = options.dangerouslyUseGlobalCSS,\n dangerouslyUseGlobalCSS = _options$dangerouslyU === undefined ? false : _options$dangerouslyU,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === undefined ? 'jss' : _options$productionPr;\n\n var escapeRegex = /([[\\].#*$><+~=|^:(),\"'`\\s])/g;\n var ruleCounter = 0;\n\n // - HMR can lead to many class name generators being instantiated,\n // so the warning is only triggered in production.\n // - We expect a class name generator to be instantiated per new request on the server,\n // so the warning is only triggered client side.\n // - You can get away with having multiple class name generators\n // by modifying the `productionPrefix`.\n if (process.env.NODE_ENV === 'production' && typeof window !== 'undefined' && productionPrefix === 'jss') {\n generatorCounter += 1;\n\n if (generatorCounter > 2) {\n // eslint-disable-next-line no-console\n console.error(['Material-UI: we have detected more than needed creation of the class name generator.', 'You should only use one class name generator on the client side.', 'If you do otherwise, you take the risk to have conflicting class names in production.'].join('\\n'));\n }\n }\n\n return function (rule, styleSheet) {\n ruleCounter += 1;\n process.env.NODE_ENV !== \"production\" ? (0, _warning2.default)(ruleCounter < 1e10, ['Material-UI: you might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join('')) : void 0;\n\n // Code branch the whole block at the expense of more code.\n if (dangerouslyUseGlobalCSS) {\n if (styleSheet && styleSheet.options.classNamePrefix) {\n var prefix = styleSheet.options.classNamePrefix;\n // Sanitize the string as will be used to prefix the generated class name.\n prefix = prefix.replace(escapeRegex, '-');\n\n if (prefix.match(/^Mui/)) {\n return prefix + '-' + rule.key;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n return prefix + '-' + rule.key + '-' + ruleCounter;\n }\n }\n\n if (process.env.NODE_ENV === 'production') {\n return '' + productionPrefix + ruleCounter;\n }\n\n return rule.key + '-' + ruleCounter;\n }\n\n if (process.env.NODE_ENV === 'production') {\n return '' + productionPrefix + ruleCounter;\n }\n\n if (styleSheet && styleSheet.options.classNamePrefix) {\n var _prefix = styleSheet.options.classNamePrefix;\n // Sanitize the string as will be used to prefix the generated class name.\n _prefix = _prefix.replace(escapeRegex, '-');\n\n return _prefix + '-' + rule.key + '-' + ruleCounter;\n }\n\n return rule.key + '-' + ruleCounter;\n };\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _defineProperty2 = require('babel-runtime/helpers/defineProperty');\n\nvar _defineProperty3 = _interopRequireDefault(_defineProperty2);\n\nvar _extends3 = require('babel-runtime/helpers/extends');\n\nvar _extends4 = _interopRequireDefault(_extends3);\n\nexports.default = createMixins;\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction createMixins(breakpoints, spacing, mixins) {\n var _toolbar;\n\n return (0, _extends4.default)({\n gutters: function gutters(styles) {\n return (0, _extends4.default)({\n paddingLeft: spacing.unit * 2,\n paddingRight: spacing.unit * 2\n }, styles, (0, _defineProperty3.default)({}, breakpoints.up('sm'), (0, _extends4.default)({\n paddingLeft: spacing.unit * 3,\n paddingRight: spacing.unit * 3\n }, styles[breakpoints.up('sm')])));\n },\n toolbar: (_toolbar = {\n minHeight: 56\n }, (0, _defineProperty3.default)(_toolbar, breakpoints.up('xs') + ' and (orientation: landscape)', {\n minHeight: 48\n }), (0, _defineProperty3.default)(_toolbar, breakpoints.up('sm'), {\n minHeight: 64\n }), _toolbar)\n }, mixins);\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');\n\nvar _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);\n\nvar _deepmerge = require('deepmerge');\n\nvar _deepmerge2 = _interopRequireDefault(_deepmerge);\n\nvar _warning = require('warning');\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nvar _createTypography = require('./createTypography');\n\nvar _createTypography2 = _interopRequireDefault(_createTypography);\n\nvar _createBreakpoints = require('./createBreakpoints');\n\nvar _createBreakpoints2 = _interopRequireDefault(_createBreakpoints);\n\nvar _createPalette = require('./createPalette');\n\nvar _createPalette2 = _interopRequireDefault(_createPalette);\n\nvar _createMixins = require('./createMixins');\n\nvar _createMixins2 = _interopRequireDefault(_createMixins);\n\nvar _shadows = require('./shadows');\n\nvar _shadows2 = _interopRequireDefault(_shadows);\n\nvar _transitions = require('./transitions');\n\nvar _transitions2 = _interopRequireDefault(_transitions);\n\nvar _zIndex = require('./zIndex');\n\nvar _zIndex2 = _interopRequireDefault(_zIndex);\n\nvar _spacing = require('./spacing');\n\nvar _spacing2 = _interopRequireDefault(_spacing);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction createMuiTheme() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$palette = options.palette,\n paletteInput = _options$palette === undefined ? {} : _options$palette,\n _options$breakpoints = options.breakpoints,\n breakpointsInput = _options$breakpoints === undefined ? {} : _options$breakpoints,\n _options$mixins = options.mixins,\n mixinsInput = _options$mixins === undefined ? {} : _options$mixins,\n _options$typography = options.typography,\n typographyInput = _options$typography === undefined ? {} : _options$typography,\n shadowsInput = options.shadows,\n other = (0, _objectWithoutProperties3.default)(options, ['palette', 'breakpoints', 'mixins', 'typography', 'shadows']);\n\n\n var palette = (0, _createPalette2.default)(paletteInput);\n var breakpoints = (0, _createBreakpoints2.default)(breakpointsInput);\n\n var muiTheme = (0, _extends3.default)({\n direction: 'ltr',\n palette: palette,\n typography: (0, _createTypography2.default)(palette, typographyInput),\n mixins: (0, _createMixins2.default)(breakpoints, _spacing2.default, mixinsInput),\n breakpoints: breakpoints,\n shadows: shadowsInput || _shadows2.default\n }, (0, _deepmerge2.default)({\n transitions: _transitions2.default,\n spacing: _spacing2.default,\n zIndex: _zIndex2.default\n }, other));\n\n process.env.NODE_ENV !== \"production\" ? (0, _warning2.default)(muiTheme.shadows.length === 25, 'Material-UI: the shadows array provided to createMuiTheme should support 25 elevations.') : void 0;\n\n return muiTheme;\n} // < 1kb payload overhead when lodash/merge is > 3kb.\nexports.default = createMuiTheme;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.dark = exports.light = undefined;\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');\n\nvar _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);\n\nexports.default = createPalette;\n\nvar _warning = require('warning');\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nvar _deepmerge = require('deepmerge');\n\nvar _deepmerge2 = _interopRequireDefault(_deepmerge);\n\nvar _indigo = require('../colors/indigo');\n\nvar _indigo2 = _interopRequireDefault(_indigo);\n\nvar _pink = require('../colors/pink');\n\nvar _pink2 = _interopRequireDefault(_pink);\n\nvar _grey = require('../colors/grey');\n\nvar _grey2 = _interopRequireDefault(_grey);\n\nvar _red = require('../colors/red');\n\nvar _red2 = _interopRequireDefault(_red);\n\nvar _common = require('../colors/common');\n\nvar _common2 = _interopRequireDefault(_common);\n\nvar _colorManipulator = require('./colorManipulator');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// < 1kb payload overhead when lodash/merge is > 3kb.\nvar light = exports.light = {\n // The colors used to style the text.\n text: {\n // The most important text.\n primary: 'rgba(0, 0, 0, 0.87)',\n // Secondary text.\n secondary: 'rgba(0, 0, 0, 0.54)',\n // Disabled text have even lower visual prominence.\n disabled: 'rgba(0, 0, 0, 0.38)',\n // Text hints.\n hint: 'rgba(0, 0, 0, 0.38)'\n },\n // The color used to divide different elements.\n divider: 'rgba(0, 0, 0, 0.12)',\n // The background colors used to style the surfaces.\n // Consistency between these values is important.\n background: {\n paper: _common2.default.white,\n default: _grey2.default[50]\n },\n // The colors used to style the action elements.\n action: {\n // The color of an active action like an icon button.\n active: 'rgba(0, 0, 0, 0.54)',\n // The color of an hovered action.\n hover: 'rgba(0, 0, 0, 0.08)',\n // The color of a selected action.\n selected: 'rgba(0, 0, 0, 0.14)',\n // The color of a disabled action.\n disabled: 'rgba(0, 0, 0, 0.26)',\n // The background color of a disabled action.\n disabledBackground: 'rgba(0, 0, 0, 0.12)'\n }\n};\n\nvar dark = exports.dark = {\n text: {\n primary: _common2.default.white,\n secondary: 'rgba(255, 255, 255, 0.7)',\n disabled: 'rgba(255, 255, 255, 0.5)',\n hint: 'rgba(255, 255, 255, 0.5)',\n icon: 'rgba(255, 255, 255, 0.5)'\n },\n divider: 'rgba(255, 255, 255, 0.12)',\n background: {\n paper: _grey2.default[800],\n default: '#303030'\n },\n action: {\n active: _common2.default.white,\n hover: 'rgba(255, 255, 255, 0.1)',\n selected: 'rgba(255, 255, 255, 0.2)',\n disabled: 'rgba(255, 255, 255, 0.3)',\n disabledBackground: 'rgba(255, 255, 255, 0.12)'\n }\n};\n\nfunction addLightOrDark(intent, direction, shade, tonalOffset) {\n if (!intent[direction]) {\n if (intent.hasOwnProperty(shade)) {\n intent[direction] = intent[shade];\n } else if (direction === 'light') {\n intent.light = (0, _colorManipulator.lighten)(intent.main, tonalOffset);\n } else if (direction === 'dark') {\n intent.dark = (0, _colorManipulator.darken)(intent.main, tonalOffset * 1.5);\n }\n }\n}\n\nfunction createPalette(palette) {\n var _palette$primary = palette.primary,\n primary = _palette$primary === undefined ? {\n light: _indigo2.default[300],\n main: _indigo2.default[500],\n dark: _indigo2.default[700]\n } : _palette$primary,\n _palette$secondary = palette.secondary,\n secondary = _palette$secondary === undefined ? {\n light: _pink2.default.A200,\n main: _pink2.default.A400,\n dark: _pink2.default.A700\n } : _palette$secondary,\n _palette$error = palette.error,\n error = _palette$error === undefined ? {\n light: _red2.default[300],\n main: _red2.default[500],\n dark: _red2.default[700]\n } : _palette$error,\n _palette$type = palette.type,\n type = _palette$type === undefined ? 'light' : _palette$type,\n _palette$contrastThre = palette.contrastThreshold,\n contrastThreshold = _palette$contrastThre === undefined ? 3 : _palette$contrastThre,\n _palette$tonalOffset = palette.tonalOffset,\n tonalOffset = _palette$tonalOffset === undefined ? 0.2 : _palette$tonalOffset,\n other = (0, _objectWithoutProperties3.default)(palette, ['primary', 'secondary', 'error', 'type', 'contrastThreshold', 'tonalOffset']);\n\n\n function getContrastText(background) {\n // Use the same logic as\n // Bootstrap: https://github.com/twbs/bootstrap/blob/1d6e3710dd447de1a200f29e8fa521f8a0908f70/scss/_functions.scss#L59\n // and material-components-web https://github.com/material-components/material-components-web/blob/ac46b8863c4dab9fc22c4c662dc6bd1b65dd652f/packages/mdc-theme/_functions.scss#L54\n var contrastText = (0, _colorManipulator.getContrastRatio)(background, dark.text.primary) >= contrastThreshold ? dark.text.primary : light.text.primary;\n\n if (process.env.NODE_ENV !== 'production') {\n var contrast = (0, _colorManipulator.getContrastRatio)(background, contrastText);\n process.env.NODE_ENV !== \"production\" ? (0, _warning2.default)(contrast >= 3, ['Material-UI: the contrast ratio of ' + contrast + ':1 for ' + contrastText + ' on ' + background, 'falls below the WACG recommended absolute minimum contrast ratio of 3:1.', 'https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast'].join('\\n')) : void 0;\n }\n\n return contrastText;\n }\n\n function augmentColor(color, mainShade, lightShade, darkShade) {\n if (!color.main && color[mainShade]) {\n color.main = color[mainShade];\n }\n addLightOrDark(color, 'light', lightShade, tonalOffset);\n addLightOrDark(color, 'dark', darkShade, tonalOffset);\n if (!color.contrastText) {\n color.contrastText = getContrastText(color.main);\n }\n }\n\n augmentColor(primary, 500, 300, 700);\n augmentColor(secondary, 'A400', 'A200', 'A700');\n augmentColor(error, 500, 300, 700);\n\n var types = { dark: dark, light: light };\n\n process.env.NODE_ENV !== \"production\" ? (0, _warning2.default)(types[type], 'Material-UI: the palette type `' + type + '` is not supported.') : void 0;\n\n var paletteOutput = (0, _deepmerge2.default)((0, _extends3.default)({\n // A collection of common colors.\n common: _common2.default,\n // The palette type, can be light or dark.\n type: type,\n // The colors used to represent primary interface elements for a user.\n primary: primary,\n // The colors used to represent secondary interface elements for a user.\n secondary: secondary,\n // The colors used to represent interface elements that the user should be made aware of.\n error: error,\n // The grey colors.\n grey: _grey2.default,\n // Used by `getContrastText()` to maximize the contrast between the background and\n // the text.\n contrastThreshold: contrastThreshold,\n // Take a background color and return the color of the text to maximize the contrast.\n getContrastText: getContrastText,\n // Used by the functions below to shift a color's luminance by approximately\n // two indexes within its tonal palette.\n // E.g., shift from Red 500 to Red 300 or Red 700.\n tonalOffset: tonalOffset\n }, types[type]), other, {\n clone: false // No need to clone deep\n });\n\n return paletteOutput;\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');\n\nvar _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);\n\nexports.default = createTypography;\n\nvar _deepmerge = require('deepmerge');\n\nvar _deepmerge2 = _interopRequireDefault(_deepmerge);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// < 1kb payload overhead when lodash/merge is > 3kb.\n\nfunction round(value) {\n return Math.round(value * 1e5) / 1e5;\n}\n\nfunction createTypography(palette, typography) {\n var _ref = typeof typography === 'function' ? typography(palette) : typography,\n _ref$fontFamily = _ref.fontFamily,\n fontFamily = _ref$fontFamily === undefined ? '\"Roboto\", \"Helvetica\", \"Arial\", sans-serif' : _ref$fontFamily,\n _ref$fontSize = _ref.fontSize,\n fontSize = _ref$fontSize === undefined ? 14 : _ref$fontSize,\n _ref$fontWeightLight = _ref.fontWeightLight,\n fontWeightLight = _ref$fontWeightLight === undefined ? 300 : _ref$fontWeightLight,\n _ref$fontWeightRegula = _ref.fontWeightRegular,\n fontWeightRegular = _ref$fontWeightRegula === undefined ? 400 : _ref$fontWeightRegula,\n _ref$fontWeightMedium = _ref.fontWeightMedium,\n fontWeightMedium = _ref$fontWeightMedium === undefined ? 500 : _ref$fontWeightMedium,\n _ref$htmlFontSize = _ref.htmlFontSize,\n htmlFontSize = _ref$htmlFontSize === undefined ? 16 : _ref$htmlFontSize,\n other = (0, _objectWithoutProperties3.default)(_ref, ['fontFamily', 'fontSize', 'fontWeightLight', 'fontWeightRegular', 'fontWeightMedium', 'htmlFontSize']);\n\n function pxToRem(value) {\n return value / htmlFontSize + 'rem';\n }\n\n return (0, _deepmerge2.default)({\n pxToRem: pxToRem,\n round: round,\n fontFamily: fontFamily,\n fontSize: fontSize,\n fontWeightLight: fontWeightLight,\n fontWeightRegular: fontWeightRegular,\n fontWeightMedium: fontWeightMedium,\n display4: {\n fontSize: pxToRem(112),\n fontWeight: fontWeightLight,\n fontFamily: fontFamily,\n letterSpacing: '-.04em',\n lineHeight: round(128 / 112) + 'em',\n marginLeft: '-.06em',\n color: palette.text.secondary\n },\n display3: {\n fontSize: pxToRem(56),\n fontWeight: fontWeightRegular,\n fontFamily: fontFamily,\n letterSpacing: '-.02em',\n lineHeight: round(73 / 56) + 'em',\n marginLeft: '-.04em',\n color: palette.text.secondary\n },\n display2: {\n fontSize: pxToRem(45),\n fontWeight: fontWeightRegular,\n fontFamily: fontFamily,\n lineHeight: round(48 / 45) + 'em',\n marginLeft: '-.04em',\n color: palette.text.secondary\n },\n display1: {\n fontSize: pxToRem(34),\n fontWeight: fontWeightRegular,\n fontFamily: fontFamily,\n lineHeight: round(41 / 34) + 'em',\n marginLeft: '-.04em',\n color: palette.text.secondary\n },\n headline: {\n fontSize: pxToRem(24),\n fontWeight: fontWeightRegular,\n fontFamily: fontFamily,\n lineHeight: round(32.5 / 24) + 'em',\n color: palette.text.primary\n },\n title: {\n fontSize: pxToRem(21),\n fontWeight: fontWeightMedium,\n fontFamily: fontFamily,\n lineHeight: round(24.5 / 21) + 'em',\n color: palette.text.primary\n },\n subheading: {\n fontSize: pxToRem(16),\n fontWeight: fontWeightRegular,\n fontFamily: fontFamily,\n lineHeight: round(24 / 16) + 'em',\n color: palette.text.primary\n },\n body2: {\n fontSize: pxToRem(14),\n fontWeight: fontWeightMedium,\n fontFamily: fontFamily,\n lineHeight: round(24 / 14) + 'em',\n color: palette.text.primary\n },\n body1: {\n fontSize: pxToRem(14),\n fontWeight: fontWeightRegular,\n fontFamily: fontFamily,\n lineHeight: round(20.5 / 14) + 'em',\n color: palette.text.primary\n },\n caption: {\n fontSize: pxToRem(12),\n fontWeight: fontWeightRegular,\n fontFamily: fontFamily,\n lineHeight: round(16.5 / 12) + 'em',\n color: palette.text.secondary\n },\n button: {\n fontSize: pxToRem(fontSize),\n textTransform: 'uppercase',\n fontWeight: fontWeightMedium,\n fontFamily: fontFamily\n }\n }, other, {\n clone: false // No need to clone deep\n });\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _keys = require('babel-runtime/core-js/object/keys');\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _warning = require('warning');\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nvar _deepmerge = require('deepmerge');\n\nvar _deepmerge2 = _interopRequireDefault(_deepmerge);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// < 1kb payload overhead when lodash/merge is > 3kb.\n\nfunction getStylesCreator(stylesOrCreator) {\n var themingEnabled = typeof stylesOrCreator === 'function';\n\n function create(theme, name) {\n var styles = themingEnabled ? stylesOrCreator(theme) : stylesOrCreator;\n\n if (!theme.overrides || !name || !theme.overrides[name]) {\n return styles;\n }\n\n var overrides = theme.overrides[name];\n var stylesWithOverrides = (0, _extends3.default)({}, styles);\n\n (0, _keys2.default)(overrides).forEach(function (key) {\n process.env.NODE_ENV !== \"production\" ? (0, _warning2.default)(stylesWithOverrides[key], ['Material-UI: you are trying to override a style that does not exist.', 'Fix the `' + key + '` key of `theme.overrides.' + name + '`.'].join('\\n')) : void 0;\n stylesWithOverrides[key] = (0, _deepmerge2.default)(stylesWithOverrides[key], overrides[key]);\n });\n\n return stylesWithOverrides;\n }\n\n return {\n create: create,\n options: {},\n themingEnabled: themingEnabled\n };\n}\n\nexports.default = getStylesCreator;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createGenerateClassName = require('./createGenerateClassName');\n\nObject.defineProperty(exports, 'createGenerateClassName', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_createGenerateClassName).default;\n }\n});\n\nvar _createMuiTheme = require('./createMuiTheme');\n\nObject.defineProperty(exports, 'createMuiTheme', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_createMuiTheme).default;\n }\n});\n\nvar _jssPreset = require('./jssPreset');\n\nObject.defineProperty(exports, 'jssPreset', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_jssPreset).default;\n }\n});\n\nvar _MuiThemeProvider = require('./MuiThemeProvider');\n\nObject.defineProperty(exports, 'MuiThemeProvider', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_MuiThemeProvider).default;\n }\n});\n\nvar _withStyles = require('./withStyles');\n\nObject.defineProperty(exports, 'withStyles', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_withStyles).default;\n }\n});\n\nvar _withTheme = require('./withTheme');\n\nObject.defineProperty(exports, 'withTheme', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_withTheme).default;\n }\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _jssGlobal = require('jss-global');\n\nvar _jssGlobal2 = _interopRequireDefault(_jssGlobal);\n\nvar _jssNested = require('jss-nested');\n\nvar _jssNested2 = _interopRequireDefault(_jssNested);\n\nvar _jssCamelCase = require('jss-camel-case');\n\nvar _jssCamelCase2 = _interopRequireDefault(_jssCamelCase);\n\nvar _jssDefaultUnit = require('jss-default-unit');\n\nvar _jssDefaultUnit2 = _interopRequireDefault(_jssDefaultUnit);\n\nvar _jssVendorPrefixer = require('jss-vendor-prefixer');\n\nvar _jssVendorPrefixer2 = _interopRequireDefault(_jssVendorPrefixer);\n\nvar _jssPropsSort = require('jss-props-sort');\n\nvar _jssPropsSort2 = _interopRequireDefault(_jssPropsSort);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// Subset of jss-preset-default with only the plugins the Material-UI\n// components are using.\nfunction jssPreset() {\n return {\n plugins: [(0, _jssGlobal2.default)(), (0, _jssNested2.default)(), (0, _jssCamelCase2.default)(), (0, _jssDefaultUnit2.default)(), (0, _jssVendorPrefixer2.default)(), (0, _jssPropsSort2.default)()]\n };\n}\n\nexports.default = jssPreset;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar shadowKeyUmbraOpacity = 0.2;\nvar shadowKeyPenumbraOpacity = 0.14;\nvar shadowAmbientShadowOpacity = 0.12;\n\nfunction createShadow() {\n return [(arguments.length <= 0 ? undefined : arguments[0]) + 'px ' + (arguments.length <= 1 ? undefined : arguments[1]) + 'px ' + (arguments.length <= 2 ? undefined : arguments[2]) + 'px ' + (arguments.length <= 3 ? undefined : arguments[3]) + 'px rgba(0, 0, 0, ' + shadowKeyUmbraOpacity + ')', (arguments.length <= 4 ? undefined : arguments[4]) + 'px ' + (arguments.length <= 5 ? undefined : arguments[5]) + 'px ' + (arguments.length <= 6 ? undefined : arguments[6]) + 'px ' + (arguments.length <= 7 ? undefined : arguments[7]) + 'px rgba(0, 0, 0, ' + shadowKeyPenumbraOpacity + ')', (arguments.length <= 8 ? undefined : arguments[8]) + 'px ' + (arguments.length <= 9 ? undefined : arguments[9]) + 'px ' + (arguments.length <= 10 ? undefined : arguments[10]) + 'px ' + (arguments.length <= 11 ? undefined : arguments[11]) + 'px rgba(0, 0, 0, ' + shadowAmbientShadowOpacity + ')'].join(',');\n}\n\nvar shadows = ['none', createShadow(0, 1, 3, 0, 0, 1, 1, 0, 0, 2, 1, -1), createShadow(0, 1, 5, 0, 0, 2, 2, 0, 0, 3, 1, -2), createShadow(0, 1, 8, 0, 0, 3, 4, 0, 0, 3, 3, -2), createShadow(0, 2, 4, -1, 0, 4, 5, 0, 0, 1, 10, 0), createShadow(0, 3, 5, -1, 0, 5, 8, 0, 0, 1, 14, 0), createShadow(0, 3, 5, -1, 0, 6, 10, 0, 0, 1, 18, 0), createShadow(0, 4, 5, -2, 0, 7, 10, 1, 0, 2, 16, 1), createShadow(0, 5, 5, -3, 0, 8, 10, 1, 0, 3, 14, 2), createShadow(0, 5, 6, -3, 0, 9, 12, 1, 0, 3, 16, 2), createShadow(0, 6, 6, -3, 0, 10, 14, 1, 0, 4, 18, 3), createShadow(0, 6, 7, -4, 0, 11, 15, 1, 0, 4, 20, 3), createShadow(0, 7, 8, -4, 0, 12, 17, 2, 0, 5, 22, 4), createShadow(0, 7, 8, -4, 0, 13, 19, 2, 0, 5, 24, 4), createShadow(0, 7, 9, -4, 0, 14, 21, 2, 0, 5, 26, 4), createShadow(0, 8, 9, -5, 0, 15, 22, 2, 0, 6, 28, 5), createShadow(0, 8, 10, -5, 0, 16, 24, 2, 0, 6, 30, 5), createShadow(0, 8, 11, -5, 0, 17, 26, 2, 0, 6, 32, 5), createShadow(0, 9, 11, -5, 0, 18, 28, 2, 0, 7, 34, 6), createShadow(0, 9, 12, -6, 0, 19, 29, 2, 0, 7, 36, 6), createShadow(0, 10, 13, -6, 0, 20, 31, 3, 0, 8, 38, 7), createShadow(0, 10, 13, -6, 0, 21, 33, 3, 0, 8, 40, 7), createShadow(0, 10, 14, -6, 0, 22, 35, 3, 0, 8, 42, 7), createShadow(0, 11, 14, -7, 0, 23, 36, 3, 0, 9, 44, 8), createShadow(0, 11, 15, -7, 0, 24, 38, 3, 0, 9, 46, 8)];\n\nexports.default = shadows;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = {\n // All components align to an 8dp square baseline grid for mobile, tablet, and desktop.\n // https://material.io/guidelines/layout/metrics-keylines.html#metrics-keylines-baseline-grids\n unit: 8\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.CHANNEL = undefined;\n\nvar _defineProperty2 = require('babel-runtime/helpers/defineProperty');\n\nvar _defineProperty3 = _interopRequireDefault(_defineProperty2);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// Same value used by react-jss\nvar CHANNEL = exports.CHANNEL = '__THEMING__';\n\nvar themeListener = {\n contextTypes: (0, _defineProperty3.default)({}, CHANNEL, _propTypes2.default.object),\n initial: function initial(context) {\n if (!context[CHANNEL]) {\n return null;\n }\n\n return context[CHANNEL].getState();\n },\n subscribe: function subscribe(context, cb) {\n if (!context[CHANNEL]) {\n return null;\n }\n\n return context[CHANNEL].subscribe(cb);\n },\n unsubscribe: function unsubscribe(context, subscriptionId) {\n if (context[CHANNEL]) {\n context[CHANNEL].unsubscribe(subscriptionId);\n }\n }\n};\n\nexports.default = themeListener;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.isNumber = exports.isString = exports.formatMs = exports.duration = exports.easing = undefined;\n\nvar _keys = require('babel-runtime/core-js/object/keys');\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nvar _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');\n\nvar _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);\n\nvar _isNan = require('babel-runtime/core-js/number/is-nan');\n\nvar _isNan2 = _interopRequireDefault(_isNan);\n\nvar _warning = require('warning');\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// Follow https://material.google.com/motion/duration-easing.html#duration-easing-natural-easing-curves\n// to learn the context in which each easing should be used.\nvar easing = exports.easing = {\n // This is the most common easing curve.\n easeInOut: 'cubic-bezier(0.4, 0, 0.2, 1)',\n // Objects enter the screen at full velocity from off-screen and\n // slowly decelerate to a resting point.\n easeOut: 'cubic-bezier(0.0, 0, 0.2, 1)',\n // Objects leave the screen at full velocity. They do not decelerate when off-screen.\n easeIn: 'cubic-bezier(0.4, 0, 1, 1)',\n // The sharp curve is used by objects that may return to the screen at any time.\n sharp: 'cubic-bezier(0.4, 0, 0.6, 1)'\n};\n\n// Follow https://material.io/guidelines/motion/duration-easing.html#duration-easing-common-durations\n// to learn when use what timing\n\n/* eslint-disable no-param-reassign */\n\nvar duration = exports.duration = {\n shortest: 150,\n shorter: 200,\n short: 250,\n // most basic recommended timing\n standard: 300,\n // this is to be used in complex animations\n complex: 375,\n // recommended when something is entering screen\n enteringScreen: 225,\n // recommended when something is leaving screen\n leavingScreen: 195\n};\n\nvar formatMs = exports.formatMs = function formatMs(milliseconds) {\n return Math.round(milliseconds) + 'ms';\n};\nvar isString = exports.isString = function isString(value) {\n return typeof value === 'string';\n};\nvar isNumber = exports.isNumber = function isNumber(value) {\n return !(0, _isNan2.default)(parseFloat(value));\n};\n\n/**\n * @param {string|Array} props\n * @param {object} param\n * @param {string} param.prop\n * @param {number} param.duration\n * @param {string} param.easing\n * @param {number} param.delay\n */\nexports.default = {\n easing: easing,\n duration: duration,\n create: function create() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['all'];\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var _options$duration = options.duration,\n durationOption = _options$duration === undefined ? duration.standard : _options$duration,\n _options$easing = options.easing,\n easingOption = _options$easing === undefined ? easing.easeInOut : _options$easing,\n _options$delay = options.delay,\n delay = _options$delay === undefined ? 0 : _options$delay,\n other = (0, _objectWithoutProperties3.default)(options, ['duration', 'easing', 'delay']);\n\n\n process.env.NODE_ENV !== \"production\" ? (0, _warning2.default)(isString(props) || Array.isArray(props), 'Material-UI: argument \"props\" must be a string or Array.') : void 0;\n process.env.NODE_ENV !== \"production\" ? (0, _warning2.default)(isNumber(durationOption) || isString(durationOption), 'Material-UI: argument \"duration\" must be a number or a string but found ' + durationOption + '.') : void 0;\n process.env.NODE_ENV !== \"production\" ? (0, _warning2.default)(isString(easingOption), 'Material-UI: argument \"easing\" must be a string.') : void 0;\n process.env.NODE_ENV !== \"production\" ? (0, _warning2.default)(isNumber(delay) || isString(delay), 'Material-UI: argument \"delay\" must be a number or a string.') : void 0;\n process.env.NODE_ENV !== \"production\" ? (0, _warning2.default)((0, _keys2.default)(other).length === 0, 'Material-UI: unrecognized argument(s) [' + (0, _keys2.default)(other).join(',') + ']') : void 0;\n\n return (Array.isArray(props) ? props : [props]).map(function (animatedProp) {\n return animatedProp + ' ' + (typeof durationOption === 'string' ? durationOption : formatMs(durationOption)) + ' ' + easingOption + ' ' + (typeof delay === 'string' ? delay : formatMs(delay));\n }).join(',');\n },\n getAutoHeightDuration: function getAutoHeightDuration(height) {\n if (!height) {\n return 0;\n }\n\n var constant = height / 36;\n\n // https://www.wolframalpha.com/input/?i=(4+%2B+15+*+(x+%2F+36+)+**+0.25+%2B+(x+%2F+36)+%2F+5)+*+10\n return Math.round((4 + 15 * Math.pow(constant, 0.25) + constant / 5) * 10);\n }\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.sheetsManager = undefined;\n\nvar _keys = require('babel-runtime/core-js/object/keys');\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = require('babel-runtime/helpers/createClass');\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = require('babel-runtime/helpers/inherits');\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');\n\nvar _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);\n\nvar _map = require('babel-runtime/core-js/map');\n\nvar _map2 = _interopRequireDefault(_map);\n\nvar _minSafeInteger = require('babel-runtime/core-js/number/min-safe-integer');\n\nvar _minSafeInteger2 = _interopRequireDefault(_minSafeInteger);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _warning = require('warning');\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nvar _hoistNonReactStatics = require('hoist-non-react-statics');\n\nvar _hoistNonReactStatics2 = _interopRequireDefault(_hoistNonReactStatics);\n\nvar _getDisplayName = require('recompose/getDisplayName');\n\nvar _getDisplayName2 = _interopRequireDefault(_getDisplayName);\n\nvar _wrapDisplayName = require('recompose/wrapDisplayName');\n\nvar _wrapDisplayName2 = _interopRequireDefault(_wrapDisplayName);\n\nvar _contextTypes = require('react-jss/lib/contextTypes');\n\nvar _contextTypes2 = _interopRequireDefault(_contextTypes);\n\nvar _jss = require('jss');\n\nvar _ns = require('react-jss/lib/ns');\n\nvar ns = _interopRequireWildcard(_ns);\n\nvar _jssPreset = require('./jssPreset');\n\nvar _jssPreset2 = _interopRequireDefault(_jssPreset);\n\nvar _createMuiTheme = require('./createMuiTheme');\n\nvar _createMuiTheme2 = _interopRequireDefault(_createMuiTheme);\n\nvar _themeListener = require('./themeListener');\n\nvar _themeListener2 = _interopRequireDefault(_themeListener);\n\nvar _createGenerateClassName = require('./createGenerateClassName');\n\nvar _createGenerateClassName2 = _interopRequireDefault(_createGenerateClassName);\n\nvar _getStylesCreator = require('./getStylesCreator');\n\nvar _getStylesCreator2 = _interopRequireDefault(_getStylesCreator);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// New JSS instance.\nvar jss = (0, _jss.create)((0, _jssPreset2.default)());\n\n// Use a singleton or the provided one by the context.\nvar generateClassName = (0, _createGenerateClassName2.default)();\n\n// Global index counter to preserve source order.\n// As we create the style sheet during componentWillMount lifecycle,\n// children are handled after the parents, so the order of style elements would\n// be parent->child. It is a problem though when a parent passes a className\n// which needs to override any childs styles. StyleSheet of the child has a higher\n// specificity, because of the source order.\n// So our solution is to render sheets them in the reverse order child->sheet, so\n// that parent has a higher specificity.\nvar indexCounter = _minSafeInteger2.default;\n\nvar sheetsManager = exports.sheetsManager = new _map2.default();\n\n// We use the same empty object to ref count the styles that don't need a theme object.\nvar noopTheme = {};\n\n// In order to have self-supporting components, we rely on default theme when not provided.\nvar defaultTheme = void 0;\n\nfunction getDefaultTheme() {\n if (defaultTheme) {\n return defaultTheme;\n }\n\n defaultTheme = (0, _createMuiTheme2.default)();\n return defaultTheme;\n}\n\n// Link a style sheet with a component.\n// It does not modify the component passed to it;\n// instead, it returns a new component, with a `classes` property.\nvar withStyles = function withStyles(stylesOrCreator) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return function (Component) {\n var _options$withTheme = options.withTheme,\n withTheme = _options$withTheme === undefined ? false : _options$withTheme,\n _options$flip = options.flip,\n flip = _options$flip === undefined ? null : _options$flip,\n name = options.name,\n styleSheetOptions = (0, _objectWithoutProperties3.default)(options, ['withTheme', 'flip', 'name']);\n\n var stylesCreator = (0, _getStylesCreator2.default)(stylesOrCreator);\n var listenToTheme = stylesCreator.themingEnabled || withTheme || typeof name === 'string';\n\n indexCounter += 1;\n stylesCreator.options.index = indexCounter;\n\n process.env.NODE_ENV !== \"production\" ? (0, _warning2.default)(indexCounter < 0, ['Material-UI: you might have a memory leak.', 'The indexCounter is not supposed to grow that much.'].join(' ')) : void 0;\n\n var WithStyles = function (_React$Component) {\n (0, _inherits3.default)(WithStyles, _React$Component);\n\n function WithStyles(props, context) {\n (0, _classCallCheck3.default)(this, WithStyles);\n\n var _this = (0, _possibleConstructorReturn3.default)(this, (WithStyles.__proto__ || (0, _getPrototypeOf2.default)(WithStyles)).call(this, props, context));\n\n _this.state = {};\n _this.disableStylesGeneration = false;\n _this.jss = null;\n _this.sheetOptions = null;\n _this.sheetsManager = sheetsManager;\n _this.stylesCreatorSaved = null;\n _this.theme = null;\n _this.unsubscribeId = null;\n\n\n _this.jss = _this.context[ns.jss] || jss;\n\n var muiThemeProviderOptions = _this.context.muiThemeProviderOptions;\n\n if (muiThemeProviderOptions) {\n if (muiThemeProviderOptions.sheetsManager) {\n _this.sheetsManager = muiThemeProviderOptions.sheetsManager;\n }\n\n _this.disableStylesGeneration = muiThemeProviderOptions.disableStylesGeneration;\n }\n\n // Attach the stylesCreator to the instance of the component as in the context\n // of react-hot-loader the hooks can be executed in a different closure context:\n // https://github.com/gaearon/react-hot-loader/blob/master/src/patch.dev.js#L107\n _this.stylesCreatorSaved = stylesCreator;\n _this.sheetOptions = (0, _extends3.default)({\n generateClassName: generateClassName\n }, _this.context[ns.sheetOptions]);\n // We use || as the function call is lazy evaluated.\n _this.theme = listenToTheme ? _themeListener2.default.initial(context) || getDefaultTheme() : noopTheme;\n return _this;\n }\n\n (0, _createClass3.default)(WithStyles, [{\n key: 'componentWillMount',\n value: function componentWillMount() {\n this.attach(this.theme);\n }\n }, {\n key: 'componentDidMount',\n value: function componentDidMount() {\n var _this2 = this;\n\n if (!listenToTheme) {\n return;\n }\n\n this.unsubscribeId = _themeListener2.default.subscribe(this.context, function (theme) {\n var oldTheme = _this2.theme;\n _this2.theme = theme;\n _this2.attach(_this2.theme);\n\n // Rerender the component so the underlying component gets the theme update.\n // By theme update we mean receiving and applying the new class names.\n _this2.setState({}, function () {\n _this2.detach(oldTheme);\n });\n });\n }\n }, {\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps() {\n // react-hot-loader specific logic\n if (this.stylesCreatorSaved === stylesCreator || process.env.NODE_ENV === 'production') {\n return;\n }\n\n this.detach(this.theme);\n this.stylesCreatorSaved = stylesCreator;\n this.attach(this.theme);\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n this.detach(this.theme);\n\n if (this.unsubscribeId !== null) {\n _themeListener2.default.unsubscribe(this.context, this.unsubscribeId);\n }\n }\n }, {\n key: 'attach',\n value: function attach(theme) {\n if (this.disableStylesGeneration) {\n return;\n }\n\n var stylesCreatorSaved = this.stylesCreatorSaved;\n var sheetManager = this.sheetsManager.get(stylesCreatorSaved);\n\n if (!sheetManager) {\n sheetManager = new _map2.default();\n this.sheetsManager.set(stylesCreatorSaved, sheetManager);\n }\n\n var sheetManagerTheme = sheetManager.get(theme);\n\n if (!sheetManagerTheme) {\n sheetManagerTheme = {\n refs: 0,\n sheet: null\n };\n sheetManager.set(theme, sheetManagerTheme);\n }\n\n if (sheetManagerTheme.refs === 0) {\n var styles = stylesCreatorSaved.create(theme, name);\n var meta = name;\n\n if (process.env.NODE_ENV !== 'production' && !meta) {\n meta = (0, _getDisplayName2.default)(Component);\n }\n\n var sheet = this.jss.createStyleSheet(styles, (0, _extends3.default)({\n meta: meta,\n classNamePrefix: meta,\n flip: typeof flip === 'boolean' ? flip : theme.direction === 'rtl',\n link: false\n }, this.sheetOptions, stylesCreatorSaved.options, {\n name: name\n }, styleSheetOptions));\n\n sheetManagerTheme.sheet = sheet;\n sheet.attach();\n\n var sheetsRegistry = this.context[ns.sheetsRegistry];\n if (sheetsRegistry) {\n sheetsRegistry.add(sheet);\n }\n }\n\n sheetManagerTheme.refs += 1;\n }\n }, {\n key: 'detach',\n value: function detach(theme) {\n if (this.disableStylesGeneration) {\n return;\n }\n\n var stylesCreatorSaved = this.stylesCreatorSaved;\n var sheetManager = this.sheetsManager.get(stylesCreatorSaved);\n var sheetManagerTheme = sheetManager.get(theme);\n\n sheetManagerTheme.refs -= 1;\n\n if (sheetManagerTheme.refs === 0) {\n sheetManager.delete(theme);\n this.jss.removeStyleSheet(sheetManagerTheme.sheet);\n var sheetsRegistry = this.context[ns.sheetsRegistry];\n if (sheetsRegistry) {\n sheetsRegistry.remove(sheetManagerTheme.sheet);\n }\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var _this3 = this;\n\n var _props = this.props,\n classesProp = _props.classes,\n innerRef = _props.innerRef,\n other = (0, _objectWithoutProperties3.default)(_props, ['classes', 'innerRef']);\n\n\n var classes = void 0;\n var renderedClasses = {};\n\n if (!this.disableStylesGeneration) {\n var sheetManager = this.sheetsManager.get(this.stylesCreatorSaved);\n var sheetsManagerTheme = sheetManager.get(this.theme);\n renderedClasses = sheetsManagerTheme.sheet.classes;\n }\n\n if (classesProp) {\n classes = (0, _extends3.default)({}, renderedClasses, (0, _keys2.default)(classesProp).reduce(function (accumulator, key) {\n process.env.NODE_ENV !== \"production\" ? (0, _warning2.default)(renderedClasses[key] || _this3.disableStylesGeneration, ['Material-UI: the key `' + key + '` ' + ('provided to the classes property is not implemented in ' + (0, _getDisplayName2.default)(Component) + '.'), 'You can only override one of the following: ' + (0, _keys2.default)(renderedClasses).join(',')].join('\\n')) : void 0;\n\n process.env.NODE_ENV !== \"production\" ? (0, _warning2.default)(!classesProp[key] || typeof classesProp[key] === 'string', ['Material-UI: the key `' + key + '` ' + ('provided to the classes property is not valid for ' + (0, _getDisplayName2.default)(Component) + '.'), 'You need to provide a non empty string instead of: ' + classesProp[key] + '.'].join('\\n')) : void 0;\n\n if (classesProp[key]) {\n accumulator[key] = renderedClasses[key] + ' ' + classesProp[key];\n }\n\n return accumulator;\n }, {}));\n } else {\n classes = renderedClasses;\n }\n\n var more = {};\n\n // Provide the theme to the wrapped component.\n // So we don't have to use the `withTheme()` Higher-order Component.\n if (withTheme) {\n more.theme = this.theme;\n }\n\n return _react2.default.createElement(Component, (0, _extends3.default)({ classes: classes }, more, other, { ref: innerRef }));\n }\n }]);\n return WithStyles;\n }(_react2.default.Component);\n\n WithStyles.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * Useful to extend the style applied to components.\n */\n classes: _propTypes2.default.object,\n /**\n * Use that property to pass a ref callback to the decorated component.\n */\n innerRef: _propTypes2.default.func\n } : {};\n\n WithStyles.contextTypes = (0, _extends3.default)({\n muiThemeProviderOptions: _propTypes2.default.object\n }, _contextTypes2.default, listenToTheme ? _themeListener2.default.contextTypes : {});\n\n if (process.env.NODE_ENV !== 'production') {\n WithStyles.displayName = (0, _wrapDisplayName2.default)(Component, 'WithStyles');\n }\n\n (0, _hoistNonReactStatics2.default)(WithStyles, Component);\n\n if (process.env.NODE_ENV !== 'production') {\n // Exposed for test purposes.\n WithStyles.Naked = Component;\n WithStyles.options = options;\n }\n\n return WithStyles;\n };\n};\n\nexports.default = withStyles;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = require('babel-runtime/helpers/createClass');\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = require('babel-runtime/helpers/inherits');\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _hoistNonReactStatics = require('hoist-non-react-statics');\n\nvar _hoistNonReactStatics2 = _interopRequireDefault(_hoistNonReactStatics);\n\nvar _wrapDisplayName = require('recompose/wrapDisplayName');\n\nvar _wrapDisplayName2 = _interopRequireDefault(_wrapDisplayName);\n\nvar _createMuiTheme = require('./createMuiTheme');\n\nvar _createMuiTheme2 = _interopRequireDefault(_createMuiTheme);\n\nvar _themeListener = require('./themeListener');\n\nvar _themeListener2 = _interopRequireDefault(_themeListener);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar defaultTheme = void 0;\n\nfunction getDefaultTheme() {\n if (defaultTheme) {\n return defaultTheme;\n }\n\n defaultTheme = (0, _createMuiTheme2.default)();\n return defaultTheme;\n}\n\n// Provide the theme object as a property to the input component.\nvar withTheme = function withTheme() {\n return function (Component) {\n var WithTheme = function (_React$Component) {\n (0, _inherits3.default)(WithTheme, _React$Component);\n\n function WithTheme(props, context) {\n (0, _classCallCheck3.default)(this, WithTheme);\n\n var _this = (0, _possibleConstructorReturn3.default)(this, (WithTheme.__proto__ || (0, _getPrototypeOf2.default)(WithTheme)).call(this, props, context));\n\n _this.state = {};\n _this.unsubscribeId = null;\n\n _this.state = {\n // We use || as the function call is lazy evaluated.\n theme: _themeListener2.default.initial(context) || getDefaultTheme()\n };\n return _this;\n }\n\n (0, _createClass3.default)(WithTheme, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n var _this2 = this;\n\n this.unsubscribeId = _themeListener2.default.subscribe(this.context, function (theme) {\n _this2.setState({ theme: theme });\n });\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n if (this.unsubscribeId !== null) {\n _themeListener2.default.unsubscribe(this.context, this.unsubscribeId);\n }\n }\n }, {\n key: 'render',\n value: function render() {\n return _react2.default.createElement(Component, (0, _extends3.default)({ theme: this.state.theme }, this.props));\n }\n }]);\n return WithTheme;\n }(_react2.default.Component);\n\n WithTheme.contextTypes = _themeListener2.default.contextTypes;\n\n if (process.env.NODE_ENV !== 'production') {\n WithTheme.displayName = (0, _wrapDisplayName2.default)(Component, 'WithTheme');\n }\n\n (0, _hoistNonReactStatics2.default)(WithTheme, Component);\n\n if (process.env.NODE_ENV !== 'production') {\n // Exposed for test purposes.\n WithTheme.Naked = Component;\n }\n\n return WithTheme;\n };\n};\n\nexports.default = withTheme;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n// We need to centralize the zIndex definitions as they work\n// like global values in the browser.\nvar zIndex = {\n mobileStepper: 1000,\n appBar: 1100,\n drawer: 1200,\n modal: 1300,\n snackbar: 1400,\n tooltip: 1500\n};\n\nexports.default = zIndex;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');\n\nvar _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);\n\nvar _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = require('babel-runtime/helpers/createClass');\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = require('babel-runtime/helpers/inherits');\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _Transition = require('react-transition-group/Transition');\n\nvar _Transition2 = _interopRequireDefault(_Transition);\n\nvar _transitions = require('../styles/transitions');\n\nvar _withTheme = require('../styles/withTheme');\n\nvar _withTheme2 = _interopRequireDefault(_withTheme);\n\nvar _utils = require('./utils');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// @inheritedComponent Transition\n\nvar styles = {\n entering: {\n opacity: 1\n },\n entered: {\n opacity: 1\n }\n};\n\n/**\n * The Fade transition is used by the [Modal](/demos/modals) component.\n * It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally.\n */\n\nvar Fade = function (_React$Component) {\n (0, _inherits3.default)(Fade, _React$Component);\n\n function Fade() {\n var _ref;\n\n var _temp, _this, _ret;\n\n (0, _classCallCheck3.default)(this, Fade);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = Fade.__proto__ || (0, _getPrototypeOf2.default)(Fade)).call.apply(_ref, [this].concat(args))), _this), _this.handleEnter = function (node) {\n var theme = _this.props.theme;\n\n (0, _utils.reflow)(node); // So the animation always start from the start.\n\n var _getTransitionProps = (0, _utils.getTransitionProps)(_this.props, {\n mode: 'enter'\n }),\n transitionDuration = _getTransitionProps.duration,\n delay = _getTransitionProps.delay;\n\n node.style.transition = theme.transitions.create('opacity', {\n duration: transitionDuration,\n delay: delay\n });\n node.style.webkitTransition = theme.transitions.create('opacity', {\n duration: transitionDuration,\n delay: delay\n });\n\n if (_this.props.onEnter) {\n _this.props.onEnter(node);\n }\n }, _this.handleExit = function (node) {\n var theme = _this.props.theme;\n\n var _getTransitionProps2 = (0, _utils.getTransitionProps)(_this.props, {\n mode: 'exit'\n }),\n transitionDuration = _getTransitionProps2.duration,\n delay = _getTransitionProps2.delay;\n\n node.style.transition = theme.transitions.create('opacity', {\n duration: transitionDuration,\n delay: delay\n });\n node.style.webkitTransition = theme.transitions.create('opacity', {\n duration: transitionDuration,\n delay: delay\n });\n\n if (_this.props.onExit) {\n _this.props.onExit(node);\n }\n }, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret);\n }\n\n (0, _createClass3.default)(Fade, [{\n key: 'render',\n value: function render() {\n var _props = this.props,\n children = _props.children,\n onEnter = _props.onEnter,\n onExit = _props.onExit,\n styleProp = _props.style,\n theme = _props.theme,\n other = (0, _objectWithoutProperties3.default)(_props, ['children', 'onEnter', 'onExit', 'style', 'theme']);\n\n\n var style = (0, _extends3.default)({}, styleProp, _react2.default.isValidElement(children) ? children.props.style : {});\n\n return _react2.default.createElement(\n _Transition2.default,\n (0, _extends3.default)({ appear: true, onEnter: this.handleEnter, onExit: this.handleExit }, other),\n function (state, childProps) {\n return _react2.default.cloneElement(children, (0, _extends3.default)({\n style: (0, _extends3.default)({\n opacity: 0\n }, styles[state], style)\n }, childProps));\n }\n );\n }\n }]);\n return Fade;\n}(_react2.default.Component);\n\nFade.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * A single child content element.\n */\n children: _propTypes2.default.oneOfType([_propTypes2.default.element, _propTypes2.default.func]),\n /**\n * If `true`, the component will transition in.\n */\n in: _propTypes2.default.bool,\n /**\n * @ignore\n */\n onEnter: _propTypes2.default.func,\n /**\n * @ignore\n */\n onEntering: _propTypes2.default.func,\n /**\n * @ignore\n */\n onExit: _propTypes2.default.func,\n /**\n * @ignore\n */\n style: _propTypes2.default.object,\n /**\n * @ignore\n */\n theme: _propTypes2.default.object.isRequired,\n /**\n * The duration for the transition, in milliseconds.\n * You may specify a single timeout for all transitions, or individually with an object.\n */\n timeout: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.shape({ enter: _propTypes2.default.number, exit: _propTypes2.default.number })])\n} : {};\n\nFade.defaultProps = {\n timeout: {\n enter: _transitions.duration.enteringScreen,\n exit: _transitions.duration.leavingScreen\n }\n};\n\nexports.default = (0, _withTheme2.default)()(Fade);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');\n\nvar _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);\n\nvar _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = require('babel-runtime/helpers/createClass');\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = require('babel-runtime/helpers/inherits');\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _Transition = require('react-transition-group/Transition');\n\nvar _Transition2 = _interopRequireDefault(_Transition);\n\nvar _withTheme = require('../styles/withTheme');\n\nvar _withTheme2 = _interopRequireDefault(_withTheme);\n\nvar _utils = require('./utils');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction getScale(value) {\n return 'scale(' + value + ', ' + Math.pow(value, 2) + ')';\n} // @inheritedComponent Transition\n\nvar styles = {\n entering: {\n opacity: 1,\n transform: getScale(1)\n },\n entered: {\n opacity: 1,\n transform: getScale(1)\n }\n};\n\n/**\n * The Grow transition is used by the [Popover](/demos/popovers) component.\n * It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally.\n */\n\nvar Grow = function (_React$Component) {\n (0, _inherits3.default)(Grow, _React$Component);\n\n function Grow() {\n var _ref;\n\n var _temp, _this, _ret;\n\n (0, _classCallCheck3.default)(this, Grow);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = Grow.__proto__ || (0, _getPrototypeOf2.default)(Grow)).call.apply(_ref, [this].concat(args))), _this), _this.autoTimeout = undefined, _this.timer = null, _this.handleEnter = function (node) {\n var _this$props = _this.props,\n theme = _this$props.theme,\n timeout = _this$props.timeout;\n\n (0, _utils.reflow)(node); // So the animation always start from the start.\n\n var _getTransitionProps = (0, _utils.getTransitionProps)(_this.props, {\n mode: 'enter'\n }),\n transitionDuration = _getTransitionProps.duration,\n delay = _getTransitionProps.delay;\n\n var duration = 0;\n if (timeout === 'auto') {\n duration = theme.transitions.getAutoHeightDuration(node.clientHeight);\n _this.autoTimeout = duration;\n } else {\n duration = transitionDuration;\n }\n\n node.style.transition = [theme.transitions.create('opacity', {\n duration: duration,\n delay: delay\n }), theme.transitions.create('transform', {\n duration: duration * 0.666,\n delay: delay\n })].join(',');\n\n if (_this.props.onEnter) {\n _this.props.onEnter(node);\n }\n }, _this.handleExit = function (node) {\n var _this$props2 = _this.props,\n theme = _this$props2.theme,\n timeout = _this$props2.timeout;\n\n var duration = 0;\n\n var _getTransitionProps2 = (0, _utils.getTransitionProps)(_this.props, {\n mode: 'exit'\n }),\n transitionDuration = _getTransitionProps2.duration,\n delay = _getTransitionProps2.delay;\n\n if (timeout === 'auto') {\n duration = theme.transitions.getAutoHeightDuration(node.clientHeight);\n _this.autoTimeout = duration;\n } else {\n duration = transitionDuration;\n }\n\n node.style.transition = [theme.transitions.create('opacity', {\n duration: duration,\n delay: delay\n }), theme.transitions.create('transform', {\n duration: duration * 0.666,\n delay: delay || duration * 0.333\n })].join(',');\n\n node.style.opacity = '0';\n node.style.transform = getScale(0.75);\n\n if (_this.props.onExit) {\n _this.props.onExit(node);\n }\n }, _this.addEndListener = function (_, next) {\n if (_this.props.timeout === 'auto') {\n _this.timer = setTimeout(next, _this.autoTimeout || 0);\n }\n }, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret);\n }\n\n (0, _createClass3.default)(Grow, [{\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n clearTimeout(this.timer);\n }\n }, {\n key: 'render',\n value: function render() {\n var _props = this.props,\n children = _props.children,\n onEnter = _props.onEnter,\n onExit = _props.onExit,\n styleProp = _props.style,\n theme = _props.theme,\n timeout = _props.timeout,\n other = (0, _objectWithoutProperties3.default)(_props, ['children', 'onEnter', 'onExit', 'style', 'theme', 'timeout']);\n\n\n var style = (0, _extends3.default)({}, styleProp, _react2.default.isValidElement(children) ? children.props.style : {});\n\n return _react2.default.createElement(\n _Transition2.default,\n (0, _extends3.default)({\n appear: true,\n onEnter: this.handleEnter,\n onExit: this.handleExit,\n addEndListener: this.addEndListener,\n timeout: timeout === 'auto' ? null : timeout\n }, other),\n function (state, childProps) {\n return _react2.default.cloneElement(children, (0, _extends3.default)({\n style: (0, _extends3.default)({\n opacity: 0,\n transform: getScale(0.75)\n }, styles[state], style)\n }, childProps));\n }\n );\n }\n }]);\n return Grow;\n}(_react2.default.Component);\n\nGrow.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * A single child content element.\n */\n children: _propTypes2.default.oneOfType([_propTypes2.default.element, _propTypes2.default.func]),\n /**\n * If `true`, show the component; triggers the enter or exit animation.\n */\n in: _propTypes2.default.bool,\n /**\n * @ignore\n */\n onEnter: _propTypes2.default.func,\n /**\n * @ignore\n */\n onEntered: _propTypes2.default.func,\n /**\n * @ignore\n */\n onEntering: _propTypes2.default.func,\n /**\n * @ignore\n */\n onExit: _propTypes2.default.func,\n /**\n * @ignore\n */\n style: _propTypes2.default.object,\n /**\n * @ignore\n */\n theme: _propTypes2.default.object.isRequired,\n /**\n * The duration for the transition, in milliseconds.\n * You may specify a single timeout for all transitions, or individually with an object.\n *\n * Set to 'auto' to automatically calculate transition time based on height.\n */\n timeout: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.shape({ enter: _propTypes2.default.number, exit: _propTypes2.default.number }), _propTypes2.default.oneOf(['auto'])])\n} : {};\n\nGrow.defaultProps = {\n timeout: 'auto'\n};\n\nexports.default = (0, _withTheme2.default)()(Grow);","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getTransitionProps = getTransitionProps;\nvar reflow = exports.reflow = function reflow(node) {\n return node.scrollTop;\n};\n\nfunction getTransitionProps(props, options) {\n var timeout = props.timeout,\n _props$style = props.style,\n style = _props$style === undefined ? {} : _props$style;\n\n\n return {\n duration: style.transitionDuration || typeof timeout === 'number' ? timeout : timeout[options.mode],\n delay: style.transitionDelay\n };\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nexports.default = function (node, event, handler, capture) {\n node.addEventListener(event, handler, capture);\n return {\n remove: function remove() {\n node.removeEventListener(event, handler, capture);\n }\n };\n};","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.specialProperty = undefined;\n\nvar _defineProperty2 = require('babel-runtime/helpers/defineProperty');\n\nvar _defineProperty3 = _interopRequireDefault(_defineProperty2);\n\nvar _keys = require('babel-runtime/core-js/object/keys');\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nvar _extends3 = require('babel-runtime/helpers/extends');\n\nvar _extends4 = _interopRequireDefault(_extends3);\n\nexports.default = exactProp;\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// This module is based on https://github.com/airbnb/prop-types-exact repository.\n// However, in order to reduce the number of dependencies and to remove some extra safe checks\n// the module was forked.\n\nvar specialProperty = exports.specialProperty = 'exact-prop: \\u200B';\n\nfunction exactProp(propTypes, componentNameInError) {\n return (0, _extends4.default)({}, propTypes, (0, _defineProperty3.default)({}, specialProperty, function (props) {\n var unknownProps = (0, _keys2.default)(props).filter(function (prop) {\n return !propTypes.hasOwnProperty(prop);\n });\n if (unknownProps.length > 0) {\n return new TypeError(componentNameInError + ': unknown props found: ' + unknownProps.join(', ') + '. Please remove the unknown properties.');\n }\n return null;\n }));\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof2 = require('babel-runtime/helpers/typeof');\n\nvar _typeof3 = _interopRequireDefault(_typeof2);\n\nvar _keys = require('babel-runtime/core-js/object/keys');\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nexports.capitalize = capitalize;\nexports.contains = contains;\nexports.findIndex = findIndex;\nexports.find = find;\nexports.createChainedFunction = createChainedFunction;\n\nvar _warning = require('warning');\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction capitalize(string) {\n if (process.env.NODE_ENV !== 'production' && typeof string !== 'string') {\n throw new Error('Material-UI: capitalize(string) expects a string argument.');\n }\n\n return string.charAt(0).toUpperCase() + string.slice(1);\n} // weak\n\nfunction contains(obj, pred) {\n return (0, _keys2.default)(pred).every(function (key) {\n return obj.hasOwnProperty(key) && obj[key] === pred[key];\n });\n}\n\nfunction findIndex(arr, pred) {\n var predType = typeof pred === 'undefined' ? 'undefined' : (0, _typeof3.default)(pred);\n for (var i = 0; i < arr.length; i += 1) {\n if (predType === 'function' && !!pred(arr[i], i, arr) === true) {\n return i;\n }\n if (predType === 'object' && contains(arr[i], pred)) {\n return i;\n }\n if (['string', 'number', 'boolean'].indexOf(predType) !== -1) {\n return arr.indexOf(pred);\n }\n }\n return -1;\n}\n\nfunction find(arr, pred) {\n var index = findIndex(arr, pred);\n return index > -1 ? arr[index] : undefined;\n}\n\n/**\n * Safe chained function\n *\n * Will only create a new function if needed,\n * otherwise will pass back existing functions or null.\n *\n * @param {function} functions to chain\n * @returns {function|null}\n */\nfunction createChainedFunction() {\n for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) {\n funcs[_key] = arguments[_key];\n }\n\n return funcs.filter(function (func) {\n return func != null;\n }).reduce(function (acc, func) {\n process.env.NODE_ENV !== \"production\" ? (0, _warning2.default)(typeof func === 'function', 'Material-UI: invalid Argument Type, must only provide functions, undefined, or null.') : void 0;\n\n return function chainedFunction() {\n for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n acc.apply(this, args);\n func.apply(this, args);\n };\n }, function () {});\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.focusKeyPressed = focusKeyPressed;\nexports.detectKeyboardFocus = detectKeyboardFocus;\nexports.listenForFocusKeys = listenForFocusKeys;\n\nvar _keycode = require('keycode');\n\nvar _keycode2 = _interopRequireDefault(_keycode);\n\nvar _warning = require('warning');\n\nvar _warning2 = _interopRequireDefault(_warning);\n\nvar _contains = require('dom-helpers/query/contains');\n\nvar _contains2 = _interopRequireDefault(_contains);\n\nvar _ownerDocument = require('dom-helpers/ownerDocument');\n\nvar _ownerDocument2 = _interopRequireDefault(_ownerDocument);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// weak\n\nvar internal = {\n focusKeyPressed: false\n};\n\nfunction focusKeyPressed(pressed) {\n if (typeof pressed !== 'undefined') {\n internal.focusKeyPressed = Boolean(pressed);\n }\n\n return internal.focusKeyPressed;\n}\n\nfunction detectKeyboardFocus(instance, element, callback) {\n var attempt = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;\n\n process.env.NODE_ENV !== \"production\" ? (0, _warning2.default)(instance.keyboardFocusCheckTime, 'Material-UI: missing instance.keyboardFocusCheckTime') : void 0;\n process.env.NODE_ENV !== \"production\" ? (0, _warning2.default)(instance.keyboardFocusMaxCheckTimes, 'Material-UI: missing instance.keyboardFocusMaxCheckTimes') : void 0;\n\n instance.keyboardFocusTimeout = setTimeout(function () {\n var doc = (0, _ownerDocument2.default)(element);\n\n if (focusKeyPressed() && (doc.activeElement === element || (0, _contains2.default)(element, doc.activeElement))) {\n callback();\n } else if (attempt < instance.keyboardFocusMaxCheckTimes) {\n detectKeyboardFocus(instance, element, callback, attempt + 1);\n }\n }, instance.keyboardFocusCheckTime);\n}\n\nvar FOCUS_KEYS = ['tab', 'enter', 'space', 'esc', 'up', 'down', 'left', 'right'];\n\nfunction isFocusKey(event) {\n return FOCUS_KEYS.indexOf((0, _keycode2.default)(event)) !== -1;\n}\n\nvar handleKeyUpEvent = function handleKeyUpEvent(event) {\n if (isFocusKey(event)) {\n internal.focusKeyPressed = true;\n }\n};\n\nfunction listenForFocusKeys(win) {\n // The event listener will only be added once per window.\n // Duplicate event listeners will be ignored by addEventListener.\n // Also, this logic is client side only, we don't need a teardown.\n win.addEventListener('keyup', handleKeyUpEvent);\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.cloneChildrenWithClassName = cloneChildrenWithClassName;\nexports.isMuiElement = isMuiElement;\nexports.isMuiComponent = isMuiComponent;\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _classnames = require('classnames');\n\nvar _classnames2 = _interopRequireDefault(_classnames);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/* eslint-disable import/prefer-default-export */\n\nfunction cloneChildrenWithClassName(children, className) {\n return _react2.default.Children.map(children, function (child) {\n return _react2.default.isValidElement(child) && _react2.default.cloneElement(child, {\n className: (0, _classnames2.default)(child.props.className, className)\n });\n });\n}\n\nfunction isMuiElement(element, muiNames) {\n return _react2.default.isValidElement(element) && muiNames.indexOf(element.type.muiName) !== -1;\n}\n\nfunction isMuiComponent(element, muiNames) {\n return muiNames.indexOf(element.muiName) !== -1;\n}","'use strict'\nvar inherits = require('inherits')\nvar HashBase = require('hash-base')\n\nvar ARRAY16 = new Array(16)\n\nfunction MD5 () {\n HashBase.call(this, 64)\n\n // state\n this._a = 0x67452301\n this._b = 0xefcdab89\n this._c = 0x98badcfe\n this._d = 0x10325476\n}\n\ninherits(MD5, HashBase)\n\nMD5.prototype._update = function () {\n var M = ARRAY16\n for (var i = 0; i < 16; ++i) M[i] = this._block.readInt32LE(i * 4)\n\n var a = this._a\n var b = this._b\n var c = this._c\n var d = this._d\n\n a = fnF(a, b, c, d, M[0], 0xd76aa478, 7)\n d = fnF(d, a, b, c, M[1], 0xe8c7b756, 12)\n c = fnF(c, d, a, b, M[2], 0x242070db, 17)\n b = fnF(b, c, d, a, M[3], 0xc1bdceee, 22)\n a = fnF(a, b, c, d, M[4], 0xf57c0faf, 7)\n d = fnF(d, a, b, c, M[5], 0x4787c62a, 12)\n c = fnF(c, d, a, b, M[6], 0xa8304613, 17)\n b = fnF(b, c, d, a, M[7], 0xfd469501, 22)\n a = fnF(a, b, c, d, M[8], 0x698098d8, 7)\n d = fnF(d, a, b, c, M[9], 0x8b44f7af, 12)\n c = fnF(c, d, a, b, M[10], 0xffff5bb1, 17)\n b = fnF(b, c, d, a, M[11], 0x895cd7be, 22)\n a = fnF(a, b, c, d, M[12], 0x6b901122, 7)\n d = fnF(d, a, b, c, M[13], 0xfd987193, 12)\n c = fnF(c, d, a, b, M[14], 0xa679438e, 17)\n b = fnF(b, c, d, a, M[15], 0x49b40821, 22)\n\n a = fnG(a, b, c, d, M[1], 0xf61e2562, 5)\n d = fnG(d, a, b, c, M[6], 0xc040b340, 9)\n c = fnG(c, d, a, b, M[11], 0x265e5a51, 14)\n b = fnG(b, c, d, a, M[0], 0xe9b6c7aa, 20)\n a = fnG(a, b, c, d, M[5], 0xd62f105d, 5)\n d = fnG(d, a, b, c, M[10], 0x02441453, 9)\n c = fnG(c, d, a, b, M[15], 0xd8a1e681, 14)\n b = fnG(b, c, d, a, M[4], 0xe7d3fbc8, 20)\n a = fnG(a, b, c, d, M[9], 0x21e1cde6, 5)\n d = fnG(d, a, b, c, M[14], 0xc33707d6, 9)\n c = fnG(c, d, a, b, M[3], 0xf4d50d87, 14)\n b = fnG(b, c, d, a, M[8], 0x455a14ed, 20)\n a = fnG(a, b, c, d, M[13], 0xa9e3e905, 5)\n d = fnG(d, a, b, c, M[2], 0xfcefa3f8, 9)\n c = fnG(c, d, a, b, M[7], 0x676f02d9, 14)\n b = fnG(b, c, d, a, M[12], 0x8d2a4c8a, 20)\n\n a = fnH(a, b, c, d, M[5], 0xfffa3942, 4)\n d = fnH(d, a, b, c, M[8], 0x8771f681, 11)\n c = fnH(c, d, a, b, M[11], 0x6d9d6122, 16)\n b = fnH(b, c, d, a, M[14], 0xfde5380c, 23)\n a = fnH(a, b, c, d, M[1], 0xa4beea44, 4)\n d = fnH(d, a, b, c, M[4], 0x4bdecfa9, 11)\n c = fnH(c, d, a, b, M[7], 0xf6bb4b60, 16)\n b = fnH(b, c, d, a, M[10], 0xbebfbc70, 23)\n a = fnH(a, b, c, d, M[13], 0x289b7ec6, 4)\n d = fnH(d, a, b, c, M[0], 0xeaa127fa, 11)\n c = fnH(c, d, a, b, M[3], 0xd4ef3085, 16)\n b = fnH(b, c, d, a, M[6], 0x04881d05, 23)\n a = fnH(a, b, c, d, M[9], 0xd9d4d039, 4)\n d = fnH(d, a, b, c, M[12], 0xe6db99e5, 11)\n c = fnH(c, d, a, b, M[15], 0x1fa27cf8, 16)\n b = fnH(b, c, d, a, M[2], 0xc4ac5665, 23)\n\n a = fnI(a, b, c, d, M[0], 0xf4292244, 6)\n d = fnI(d, a, b, c, M[7], 0x432aff97, 10)\n c = fnI(c, d, a, b, M[14], 0xab9423a7, 15)\n b = fnI(b, c, d, a, M[5], 0xfc93a039, 21)\n a = fnI(a, b, c, d, M[12], 0x655b59c3, 6)\n d = fnI(d, a, b, c, M[3], 0x8f0ccc92, 10)\n c = fnI(c, d, a, b, M[10], 0xffeff47d, 15)\n b = fnI(b, c, d, a, M[1], 0x85845dd1, 21)\n a = fnI(a, b, c, d, M[8], 0x6fa87e4f, 6)\n d = fnI(d, a, b, c, M[15], 0xfe2ce6e0, 10)\n c = fnI(c, d, a, b, M[6], 0xa3014314, 15)\n b = fnI(b, c, d, a, M[13], 0x4e0811a1, 21)\n a = fnI(a, b, c, d, M[4], 0xf7537e82, 6)\n d = fnI(d, a, b, c, M[11], 0xbd3af235, 10)\n c = fnI(c, d, a, b, M[2], 0x2ad7d2bb, 15)\n b = fnI(b, c, d, a, M[9], 0xeb86d391, 21)\n\n this._a = (this._a + a) | 0\n this._b = (this._b + b) | 0\n this._c = (this._c + c) | 0\n this._d = (this._d + d) | 0\n}\n\nMD5.prototype._digest = function () {\n // create padding and handle blocks\n this._block[this._blockOffset++] = 0x80\n if (this._blockOffset > 56) {\n this._block.fill(0, this._blockOffset, 64)\n this._update()\n this._blockOffset = 0\n }\n\n this._block.fill(0, this._blockOffset, 56)\n this._block.writeUInt32LE(this._length[0], 56)\n this._block.writeUInt32LE(this._length[1], 60)\n this._update()\n\n // produce result\n var buffer = new Buffer(16)\n buffer.writeInt32LE(this._a, 0)\n buffer.writeInt32LE(this._b, 4)\n buffer.writeInt32LE(this._c, 8)\n buffer.writeInt32LE(this._d, 12)\n return buffer\n}\n\nfunction rotl (x, n) {\n return (x << n) | (x >>> (32 - n))\n}\n\nfunction fnF (a, b, c, d, m, k, s) {\n return (rotl((a + ((b & c) | ((~b) & d)) + m + k) | 0, s) + b) | 0\n}\n\nfunction fnG (a, b, c, d, m, k, s) {\n return (rotl((a + ((b & d) | (c & (~d))) + m + k) | 0, s) + b) | 0\n}\n\nfunction fnH (a, b, c, d, m, k, s) {\n return (rotl((a + (b ^ c ^ d) + m + k) | 0, s) + b) | 0\n}\n\nfunction fnI (a, b, c, d, m, k, s) {\n return (rotl((a + ((c ^ (b | (~d)))) + m + k) | 0, s) + b) | 0\n}\n\nmodule.exports = MD5\n","'use strict'\nvar Buffer = require('safe-buffer').Buffer\nvar Transform = require('stream').Transform\nvar inherits = require('inherits')\n\nfunction throwIfNotStringOrBuffer (val, prefix) {\n if (!Buffer.isBuffer(val) && typeof val !== 'string') {\n throw new TypeError(prefix + ' must be a string or a buffer')\n }\n}\n\nfunction HashBase (blockSize) {\n Transform.call(this)\n\n this._block = Buffer.allocUnsafe(blockSize)\n this._blockSize = blockSize\n this._blockOffset = 0\n this._length = [0, 0, 0, 0]\n\n this._finalized = false\n}\n\ninherits(HashBase, Transform)\n\nHashBase.prototype._transform = function (chunk, encoding, callback) {\n var error = null\n try {\n this.update(chunk, encoding)\n } catch (err) {\n error = err\n }\n\n callback(error)\n}\n\nHashBase.prototype._flush = function (callback) {\n var error = null\n try {\n this.push(this.digest())\n } catch (err) {\n error = err\n }\n\n callback(error)\n}\n\nHashBase.prototype.update = function (data, encoding) {\n throwIfNotStringOrBuffer(data, 'Data')\n if (this._finalized) throw new Error('Digest already called')\n if (!Buffer.isBuffer(data)) data = Buffer.from(data, encoding)\n\n // consume data\n var block = this._block\n var offset = 0\n while (this._blockOffset + data.length - offset >= this._blockSize) {\n for (var i = this._blockOffset; i < this._blockSize;) block[i++] = data[offset++]\n this._update()\n this._blockOffset = 0\n }\n while (offset < data.length) block[this._blockOffset++] = data[offset++]\n\n // update length\n for (var j = 0, carry = data.length * 8; carry > 0; ++j) {\n this._length[j] += carry\n carry = (this._length[j] / 0x0100000000) | 0\n if (carry > 0) this._length[j] -= 0x0100000000 * carry\n }\n\n return this\n}\n\nHashBase.prototype._update = function () {\n throw new Error('_update is not implemented')\n}\n\nHashBase.prototype.digest = function (encoding) {\n if (this._finalized) throw new Error('Digest already called')\n this._finalized = true\n\n var digest = this._digest()\n if (encoding !== undefined) digest = digest.toString(encoding)\n\n // reset state\n this._block.fill(0)\n this._blockOffset = 0\n for (var i = 0; i < 4; ++i) this._length[i] = 0\n\n return digest\n}\n\nHashBase.prototype._digest = function () {\n throw new Error('_digest is not implemented')\n}\n\nmodule.exports = HashBase\n","var bn = require('bn.js');\nvar brorand = require('brorand');\n\nfunction MillerRabin(rand) {\n this.rand = rand || new brorand.Rand();\n}\nmodule.exports = MillerRabin;\n\nMillerRabin.create = function create(rand) {\n return new MillerRabin(rand);\n};\n\nMillerRabin.prototype._randbelow = function _randbelow(n) {\n var len = n.bitLength();\n var min_bytes = Math.ceil(len / 8);\n\n // Generage random bytes until a number less than n is found.\n // This ensures that 0..n-1 have an equal probability of being selected.\n do\n var a = new bn(this.rand.generate(min_bytes));\n while (a.cmp(n) >= 0);\n\n return a;\n};\n\nMillerRabin.prototype._randrange = function _randrange(start, stop) {\n // Generate a random number greater than or equal to start and less than stop.\n var size = stop.sub(start);\n return start.add(this._randbelow(size));\n};\n\nMillerRabin.prototype.test = function test(n, k, cb) {\n var len = n.bitLength();\n var red = bn.mont(n);\n var rone = new bn(1).toRed(red);\n\n if (!k)\n k = Math.max(1, (len / 48) | 0);\n\n // Find d and s, (n - 1) = (2 ^ s) * d;\n var n1 = n.subn(1);\n for (var s = 0; !n1.testn(s); s++) {}\n var d = n.shrn(s);\n\n var rn1 = n1.toRed(red);\n\n var prime = true;\n for (; k > 0; k--) {\n var a = this._randrange(new bn(2), n1);\n if (cb)\n cb(a);\n\n var x = a.toRed(red).redPow(d);\n if (x.cmp(rone) === 0 || x.cmp(rn1) === 0)\n continue;\n\n for (var i = 1; i < s; i++) {\n x = x.redSqr();\n\n if (x.cmp(rone) === 0)\n return false;\n if (x.cmp(rn1) === 0)\n break;\n }\n\n if (i === s)\n return false;\n }\n\n return prime;\n};\n\nMillerRabin.prototype.getDivisor = function getDivisor(n, k) {\n var len = n.bitLength();\n var red = bn.mont(n);\n var rone = new bn(1).toRed(red);\n\n if (!k)\n k = Math.max(1, (len / 48) | 0);\n\n // Find d and s, (n - 1) = (2 ^ s) * d;\n var n1 = n.subn(1);\n for (var s = 0; !n1.testn(s); s++) {}\n var d = n.shrn(s);\n\n var rn1 = n1.toRed(red);\n\n for (; k > 0; k--) {\n var a = this._randrange(new bn(2), n1);\n\n var g = n.gcd(a);\n if (g.cmpn(1) !== 0)\n return g;\n\n var x = a.toRed(red).redPow(d);\n if (x.cmp(rone) === 0 || x.cmp(rn1) === 0)\n continue;\n\n for (var i = 1; i < s; i++) {\n x = x.redSqr();\n\n if (x.cmp(rone) === 0)\n return x.fromRed().subn(1).gcd(n);\n if (x.cmp(rn1) === 0)\n break;\n }\n\n if (i === s) {\n x = x.redSqr();\n return x.fromRed().subn(1).gcd(n);\n }\n }\n\n return false;\n};\n","module.exports = assert;\n\nfunction assert(val, msg) {\n if (!val)\n throw new Error(msg || 'Assertion failed');\n}\n\nassert.equal = function assertEqual(l, r, msg) {\n if (l != r)\n throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r));\n};\n","'use strict';\n\nvar utils = exports;\n\nfunction toArray(msg, enc) {\n if (Array.isArray(msg))\n return msg.slice();\n if (!msg)\n return [];\n var res = [];\n if (typeof msg !== 'string') {\n for (var i = 0; i < msg.length; i++)\n res[i] = msg[i] | 0;\n return res;\n }\n if (enc === 'hex') {\n msg = msg.replace(/[^a-z0-9]+/ig, '');\n if (msg.length % 2 !== 0)\n msg = '0' + msg;\n for (var i = 0; i < msg.length; i += 2)\n res.push(parseInt(msg[i] + msg[i + 1], 16));\n } else {\n for (var i = 0; i < msg.length; i++) {\n var c = msg.charCodeAt(i);\n var hi = c >> 8;\n var lo = c & 0xff;\n if (hi)\n res.push(hi, lo);\n else\n res.push(lo);\n }\n }\n return res;\n}\nutils.toArray = toArray;\n\nfunction zero2(word) {\n if (word.length === 1)\n return '0' + word;\n else\n return word;\n}\nutils.zero2 = zero2;\n\nfunction toHex(msg) {\n var res = '';\n for (var i = 0; i < msg.length; i++)\n res += zero2(msg[i].toString(16));\n return res;\n}\nutils.toHex = toHex;\n\nutils.encode = function encode(arr, enc) {\n if (enc === 'hex')\n return toHex(arr);\n else\n return arr;\n};\n","'use strict';\n\nvar Buffer = require('safe-buffer').Buffer;\n\nvar isEncoding = Buffer.isEncoding || function (encoding) {\n encoding = '' + encoding;\n switch (encoding && encoding.toLowerCase()) {\n case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':\n return true;\n default:\n return false;\n }\n};\n\nfunction _normalizeEncoding(enc) {\n if (!enc) return 'utf8';\n var retried;\n while (true) {\n switch (enc) {\n case 'utf8':\n case 'utf-8':\n return 'utf8';\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return 'utf16le';\n case 'latin1':\n case 'binary':\n return 'latin1';\n case 'base64':\n case 'ascii':\n case 'hex':\n return enc;\n default:\n if (retried) return; // undefined\n enc = ('' + enc).toLowerCase();\n retried = true;\n }\n }\n};\n\n// Do not cache `Buffer.isEncoding` when checking encoding names as some\n// modules monkey-patch it to support additional encodings\nfunction normalizeEncoding(enc) {\n var nenc = _normalizeEncoding(enc);\n if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n return nenc || enc;\n}\n\n// StringDecoder provides an interface for efficiently splitting a series of\n// buffers into a series of JS strings without breaking apart multi-byte\n// characters.\nexports.StringDecoder = StringDecoder;\nfunction StringDecoder(encoding) {\n this.encoding = normalizeEncoding(encoding);\n var nb;\n switch (this.encoding) {\n case 'utf16le':\n this.text = utf16Text;\n this.end = utf16End;\n nb = 4;\n break;\n case 'utf8':\n this.fillLast = utf8FillLast;\n nb = 4;\n break;\n case 'base64':\n this.text = base64Text;\n this.end = base64End;\n nb = 3;\n break;\n default:\n this.write = simpleWrite;\n this.end = simpleEnd;\n return;\n }\n this.lastNeed = 0;\n this.lastTotal = 0;\n this.lastChar = Buffer.allocUnsafe(nb);\n}\n\nStringDecoder.prototype.write = function (buf) {\n if (buf.length === 0) return '';\n var r;\n var i;\n if (this.lastNeed) {\n r = this.fillLast(buf);\n if (r === undefined) return '';\n i = this.lastNeed;\n this.lastNeed = 0;\n } else {\n i = 0;\n }\n if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);\n return r || '';\n};\n\nStringDecoder.prototype.end = utf8End;\n\n// Returns only complete characters in a Buffer\nStringDecoder.prototype.text = utf8Text;\n\n// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer\nStringDecoder.prototype.fillLast = function (buf) {\n if (this.lastNeed <= buf.length) {\n buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);\n return this.lastChar.toString(this.encoding, 0, this.lastTotal);\n }\n buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);\n this.lastNeed -= buf.length;\n};\n\n// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a\n// continuation byte.\nfunction utf8CheckByte(byte) {\n if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;\n return -1;\n}\n\n// Checks at most 3 bytes at the end of a Buffer in order to detect an\n// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)\n// needed to complete the UTF-8 character (if applicable) are returned.\nfunction utf8CheckIncomplete(self, buf, i) {\n var j = buf.length - 1;\n if (j < i) return 0;\n var nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 1;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) self.lastNeed = nb - 2;\n return nb;\n }\n if (--j < i) return 0;\n nb = utf8CheckByte(buf[j]);\n if (nb >= 0) {\n if (nb > 0) {\n if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n }\n return nb;\n }\n return 0;\n}\n\n// Validates as many continuation bytes for a multi-byte UTF-8 character as\n// needed or are available. If we see a non-continuation byte where we expect\n// one, we \"replace\" the validated continuation bytes we've seen so far with\n// UTF-8 replacement characters ('\\ufffd'), to match v8's UTF-8 decoding\n// behavior. The continuation byte check is included three times in the case\n// where all of the continuation bytes for a character exist in the same buffer.\n// It is also done this way as a slight performance increase instead of using a\n// loop.\nfunction utf8CheckExtraBytes(self, buf, p) {\n if ((buf[0] & 0xC0) !== 0x80) {\n self.lastNeed = 0;\n return '\\ufffd'.repeat(p);\n }\n if (self.lastNeed > 1 && buf.length > 1) {\n if ((buf[1] & 0xC0) !== 0x80) {\n self.lastNeed = 1;\n return '\\ufffd'.repeat(p + 1);\n }\n if (self.lastNeed > 2 && buf.length > 2) {\n if ((buf[2] & 0xC0) !== 0x80) {\n self.lastNeed = 2;\n return '\\ufffd'.repeat(p + 2);\n }\n }\n }\n}\n\n// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.\nfunction utf8FillLast(buf) {\n var p = this.lastTotal - this.lastNeed;\n var r = utf8CheckExtraBytes(this, buf, p);\n if (r !== undefined) return r;\n if (this.lastNeed <= buf.length) {\n buf.copy(this.lastChar, p, 0, this.lastNeed);\n return this.lastChar.toString(this.encoding, 0, this.lastTotal);\n }\n buf.copy(this.lastChar, p, 0, buf.length);\n this.lastNeed -= buf.length;\n}\n\n// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a\n// partial character, the character's bytes are buffered until the required\n// number of bytes are available.\nfunction utf8Text(buf, i) {\n var total = utf8CheckIncomplete(this, buf, i);\n if (!this.lastNeed) return buf.toString('utf8', i);\n this.lastTotal = total;\n var end = buf.length - (total - this.lastNeed);\n buf.copy(this.lastChar, 0, end);\n return buf.toString('utf8', i, end);\n}\n\n// For UTF-8, a replacement character for each buffered byte of a (partial)\n// character needs to be added to the output.\nfunction utf8End(buf) {\n var r = buf && buf.length ? this.write(buf) : '';\n if (this.lastNeed) return r + '\\ufffd'.repeat(this.lastTotal - this.lastNeed);\n return r;\n}\n\n// UTF-16LE typically needs two bytes per character, but even if we have an even\n// number of bytes available, we need to check if we end on a leading/high\n// surrogate. In that case, we need to wait for the next two bytes in order to\n// decode the last character properly.\nfunction utf16Text(buf, i) {\n if ((buf.length - i) % 2 === 0) {\n var r = buf.toString('utf16le', i);\n if (r) {\n var c = r.charCodeAt(r.length - 1);\n if (c >= 0xD800 && c <= 0xDBFF) {\n this.lastNeed = 2;\n this.lastTotal = 4;\n this.lastChar[0] = buf[buf.length - 2];\n this.lastChar[1] = buf[buf.length - 1];\n return r.slice(0, -1);\n }\n }\n return r;\n }\n this.lastNeed = 1;\n this.lastTotal = 2;\n this.lastChar[0] = buf[buf.length - 1];\n return buf.toString('utf16le', i, buf.length - 1);\n}\n\n// For UTF-16LE we do not explicitly append special replacement characters if we\n// end on a partial character, we simply let v8 handle that.\nfunction utf16End(buf) {\n var r = buf && buf.length ? this.write(buf) : '';\n if (this.lastNeed) {\n var end = this.lastTotal - this.lastNeed;\n return r + this.lastChar.toString('utf16le', 0, end);\n }\n return r;\n}\n\nfunction base64Text(buf, i) {\n var n = (buf.length - i) % 3;\n if (n === 0) return buf.toString('base64', i);\n this.lastNeed = 3 - n;\n this.lastTotal = 3;\n if (n === 1) {\n this.lastChar[0] = buf[buf.length - 1];\n } else {\n this.lastChar[0] = buf[buf.length - 2];\n this.lastChar[1] = buf[buf.length - 1];\n }\n return buf.toString('base64', i, buf.length - n);\n}\n\nfunction base64End(buf) {\n var r = buf && buf.length ? this.write(buf) : '';\n if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);\n return r;\n}\n\n// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)\nfunction simpleWrite(buf) {\n return buf.toString(this.encoding);\n}\n\nfunction simpleEnd(buf) {\n return buf && buf.length ? this.write(buf) : '';\n}","(function (module, exports) {\n 'use strict';\n\n // Utils\n function assert (val, msg) {\n if (!val) throw new Error(msg || 'Assertion failed');\n }\n\n // Could use `inherits` module, but don't want to move from single file\n // architecture yet.\n function inherits (ctor, superCtor) {\n ctor.super_ = superCtor;\n var TempCtor = function () {};\n TempCtor.prototype = superCtor.prototype;\n ctor.prototype = new TempCtor();\n ctor.prototype.constructor = ctor;\n }\n\n // BN\n\n function BN (number, base, endian) {\n if (BN.isBN(number)) {\n return number;\n }\n\n this.negative = 0;\n this.words = null;\n this.length = 0;\n\n // Reduction context\n this.red = null;\n\n if (number !== null) {\n if (base === 'le' || base === 'be') {\n endian = base;\n base = 10;\n }\n\n this._init(number || 0, base || 10, endian || 'be');\n }\n }\n if (typeof module === 'object') {\n module.exports = BN;\n } else {\n exports.BN = BN;\n }\n\n BN.BN = BN;\n BN.wordSize = 26;\n\n var Buffer;\n try {\n Buffer = require('buf' + 'fer').Buffer;\n } catch (e) {\n }\n\n BN.isBN = function isBN (num) {\n if (num instanceof BN) {\n return true;\n }\n\n return num !== null && typeof num === 'object' &&\n num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);\n };\n\n BN.max = function max (left, right) {\n if (left.cmp(right) > 0) return left;\n return right;\n };\n\n BN.min = function min (left, right) {\n if (left.cmp(right) < 0) return left;\n return right;\n };\n\n BN.prototype._init = function init (number, base, endian) {\n if (typeof number === 'number') {\n return this._initNumber(number, base, endian);\n }\n\n if (typeof number === 'object') {\n return this._initArray(number, base, endian);\n }\n\n if (base === 'hex') {\n base = 16;\n }\n assert(base === (base | 0) && base >= 2 && base <= 36);\n\n number = number.toString().replace(/\\s+/g, '');\n var start = 0;\n if (number[0] === '-') {\n start++;\n }\n\n if (base === 16) {\n this._parseHex(number, start);\n } else {\n this._parseBase(number, base, start);\n }\n\n if (number[0] === '-') {\n this.negative = 1;\n }\n\n this.strip();\n\n if (endian !== 'le') return;\n\n this._initArray(this.toArray(), base, endian);\n };\n\n BN.prototype._initNumber = function _initNumber (number, base, endian) {\n if (number < 0) {\n this.negative = 1;\n number = -number;\n }\n if (number < 0x4000000) {\n this.words = [ number & 0x3ffffff ];\n this.length = 1;\n } else if (number < 0x10000000000000) {\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff\n ];\n this.length = 2;\n } else {\n assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff,\n 1\n ];\n this.length = 3;\n }\n\n if (endian !== 'le') return;\n\n // Reverse the bytes\n this._initArray(this.toArray(), base, endian);\n };\n\n BN.prototype._initArray = function _initArray (number, base, endian) {\n // Perhaps a Uint8Array\n assert(typeof number.length === 'number');\n if (number.length <= 0) {\n this.words = [ 0 ];\n this.length = 1;\n return this;\n }\n\n this.length = Math.ceil(number.length / 3);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n var j, w;\n var off = 0;\n if (endian === 'be') {\n for (i = number.length - 1, j = 0; i >= 0; i -= 3) {\n w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n } else if (endian === 'le') {\n for (i = 0, j = 0; i < number.length; i += 3) {\n w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n }\n return this.strip();\n };\n\n function parseHex (str, start, end) {\n var r = 0;\n var len = Math.min(str.length, end);\n for (var i = start; i < len; i++) {\n var c = str.charCodeAt(i) - 48;\n\n r <<= 4;\n\n // 'a' - 'f'\n if (c >= 49 && c <= 54) {\n r |= c - 49 + 0xa;\n\n // 'A' - 'F'\n } else if (c >= 17 && c <= 22) {\n r |= c - 17 + 0xa;\n\n // '0' - '9'\n } else {\n r |= c & 0xf;\n }\n }\n return r;\n }\n\n BN.prototype._parseHex = function _parseHex (number, start) {\n // Create possibly bigger array to ensure that it fits the number\n this.length = Math.ceil((number.length - start) / 6);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n var j, w;\n // Scan 24-bit chunks and add them to the number\n var off = 0;\n for (i = number.length - 6, j = 0; i >= start; i -= 6) {\n w = parseHex(number, i, i + 6);\n this.words[j] |= (w << off) & 0x3ffffff;\n // NOTE: `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb\n this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n if (i + 6 !== start) {\n w = parseHex(number, start, i + 6);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;\n }\n this.strip();\n };\n\n function parseBase (str, start, end, mul) {\n var r = 0;\n var len = Math.min(str.length, end);\n for (var i = start; i < len; i++) {\n var c = str.charCodeAt(i) - 48;\n\n r *= mul;\n\n // 'a'\n if (c >= 49) {\n r += c - 49 + 0xa;\n\n // 'A'\n } else if (c >= 17) {\n r += c - 17 + 0xa;\n\n // '0' - '9'\n } else {\n r += c;\n }\n }\n return r;\n }\n\n BN.prototype._parseBase = function _parseBase (number, base, start) {\n // Initialize as zero\n this.words = [ 0 ];\n this.length = 1;\n\n // Find length of limb in base\n for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {\n limbLen++;\n }\n limbLen--;\n limbPow = (limbPow / base) | 0;\n\n var total = number.length - start;\n var mod = total % limbLen;\n var end = Math.min(total, total - mod) + start;\n\n var word = 0;\n for (var i = start; i < end; i += limbLen) {\n word = parseBase(number, i, i + limbLen, base);\n\n this.imuln(limbPow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n if (mod !== 0) {\n var pow = 1;\n word = parseBase(number, i, number.length, base);\n\n for (i = 0; i < mod; i++) {\n pow *= base;\n }\n\n this.imuln(pow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n };\n\n BN.prototype.copy = function copy (dest) {\n dest.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n dest.words[i] = this.words[i];\n }\n dest.length = this.length;\n dest.negative = this.negative;\n dest.red = this.red;\n };\n\n BN.prototype.clone = function clone () {\n var r = new BN(null);\n this.copy(r);\n return r;\n };\n\n BN.prototype._expand = function _expand (size) {\n while (this.length < size) {\n this.words[this.length++] = 0;\n }\n return this;\n };\n\n // Remove leading `0` from `this`\n BN.prototype.strip = function strip () {\n while (this.length > 1 && this.words[this.length - 1] === 0) {\n this.length--;\n }\n return this._normSign();\n };\n\n BN.prototype._normSign = function _normSign () {\n // -0 = 0\n if (this.length === 1 && this.words[0] === 0) {\n this.negative = 0;\n }\n return this;\n };\n\n BN.prototype.inspect = function inspect () {\n return (this.red ? '';\n };\n\n /*\n\n var zeros = [];\n var groupSizes = [];\n var groupBases = [];\n\n var s = '';\n var i = -1;\n while (++i < BN.wordSize) {\n zeros[i] = s;\n s += '0';\n }\n groupSizes[0] = 0;\n groupSizes[1] = 0;\n groupBases[0] = 0;\n groupBases[1] = 0;\n var base = 2 - 1;\n while (++base < 36 + 1) {\n var groupSize = 0;\n var groupBase = 1;\n while (groupBase < (1 << BN.wordSize) / base) {\n groupBase *= base;\n groupSize += 1;\n }\n groupSizes[base] = groupSize;\n groupBases[base] = groupBase;\n }\n\n */\n\n var zeros = [\n '',\n '0',\n '00',\n '000',\n '0000',\n '00000',\n '000000',\n '0000000',\n '00000000',\n '000000000',\n '0000000000',\n '00000000000',\n '000000000000',\n '0000000000000',\n '00000000000000',\n '000000000000000',\n '0000000000000000',\n '00000000000000000',\n '000000000000000000',\n '0000000000000000000',\n '00000000000000000000',\n '000000000000000000000',\n '0000000000000000000000',\n '00000000000000000000000',\n '000000000000000000000000',\n '0000000000000000000000000'\n ];\n\n var groupSizes = [\n 0, 0,\n 25, 16, 12, 11, 10, 9, 8,\n 8, 7, 7, 7, 7, 6, 6,\n 6, 6, 6, 6, 6, 5, 5,\n 5, 5, 5, 5, 5, 5, 5,\n 5, 5, 5, 5, 5, 5, 5\n ];\n\n var groupBases = [\n 0, 0,\n 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,\n 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,\n 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,\n 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,\n 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176\n ];\n\n BN.prototype.toString = function toString (base, padding) {\n base = base || 10;\n padding = padding | 0 || 1;\n\n var out;\n if (base === 16 || base === 'hex') {\n out = '';\n var off = 0;\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = this.words[i];\n var word = (((w << off) | carry) & 0xffffff).toString(16);\n carry = (w >>> (24 - off)) & 0xffffff;\n if (carry !== 0 || i !== this.length - 1) {\n out = zeros[6 - word.length] + word + out;\n } else {\n out = word + out;\n }\n off += 2;\n if (off >= 26) {\n off -= 26;\n i--;\n }\n }\n if (carry !== 0) {\n out = carry.toString(16) + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n if (base === (base | 0) && base >= 2 && base <= 36) {\n // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));\n var groupSize = groupSizes[base];\n // var groupBase = Math.pow(base, groupSize);\n var groupBase = groupBases[base];\n out = '';\n var c = this.clone();\n c.negative = 0;\n while (!c.isZero()) {\n var r = c.modn(groupBase).toString(base);\n c = c.idivn(groupBase);\n\n if (!c.isZero()) {\n out = zeros[groupSize - r.length] + r + out;\n } else {\n out = r + out;\n }\n }\n if (this.isZero()) {\n out = '0' + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n assert(false, 'Base should be between 2 and 36');\n };\n\n BN.prototype.toNumber = function toNumber () {\n var ret = this.words[0];\n if (this.length === 2) {\n ret += this.words[1] * 0x4000000;\n } else if (this.length === 3 && this.words[2] === 0x01) {\n // NOTE: at this stage it is known that the top bit is set\n ret += 0x10000000000000 + (this.words[1] * 0x4000000);\n } else if (this.length > 2) {\n assert(false, 'Number can only safely store up to 53 bits');\n }\n return (this.negative !== 0) ? -ret : ret;\n };\n\n BN.prototype.toJSON = function toJSON () {\n return this.toString(16);\n };\n\n BN.prototype.toBuffer = function toBuffer (endian, length) {\n assert(typeof Buffer !== 'undefined');\n return this.toArrayLike(Buffer, endian, length);\n };\n\n BN.prototype.toArray = function toArray (endian, length) {\n return this.toArrayLike(Array, endian, length);\n };\n\n BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {\n var byteLength = this.byteLength();\n var reqLength = length || Math.max(1, byteLength);\n assert(byteLength <= reqLength, 'byte array longer than desired length');\n assert(reqLength > 0, 'Requested array length <= 0');\n\n this.strip();\n var littleEndian = endian === 'le';\n var res = new ArrayType(reqLength);\n\n var b, i;\n var q = this.clone();\n if (!littleEndian) {\n // Assume big-endian\n for (i = 0; i < reqLength - byteLength; i++) {\n res[i] = 0;\n }\n\n for (i = 0; !q.isZero(); i++) {\n b = q.andln(0xff);\n q.iushrn(8);\n\n res[reqLength - i - 1] = b;\n }\n } else {\n for (i = 0; !q.isZero(); i++) {\n b = q.andln(0xff);\n q.iushrn(8);\n\n res[i] = b;\n }\n\n for (; i < reqLength; i++) {\n res[i] = 0;\n }\n }\n\n return res;\n };\n\n if (Math.clz32) {\n BN.prototype._countBits = function _countBits (w) {\n return 32 - Math.clz32(w);\n };\n } else {\n BN.prototype._countBits = function _countBits (w) {\n var t = w;\n var r = 0;\n if (t >= 0x1000) {\n r += 13;\n t >>>= 13;\n }\n if (t >= 0x40) {\n r += 7;\n t >>>= 7;\n }\n if (t >= 0x8) {\n r += 4;\n t >>>= 4;\n }\n if (t >= 0x02) {\n r += 2;\n t >>>= 2;\n }\n return r + t;\n };\n }\n\n BN.prototype._zeroBits = function _zeroBits (w) {\n // Short-cut\n if (w === 0) return 26;\n\n var t = w;\n var r = 0;\n if ((t & 0x1fff) === 0) {\n r += 13;\n t >>>= 13;\n }\n if ((t & 0x7f) === 0) {\n r += 7;\n t >>>= 7;\n }\n if ((t & 0xf) === 0) {\n r += 4;\n t >>>= 4;\n }\n if ((t & 0x3) === 0) {\n r += 2;\n t >>>= 2;\n }\n if ((t & 0x1) === 0) {\n r++;\n }\n return r;\n };\n\n // Return number of used bits in a BN\n BN.prototype.bitLength = function bitLength () {\n var w = this.words[this.length - 1];\n var hi = this._countBits(w);\n return (this.length - 1) * 26 + hi;\n };\n\n function toBitArray (num) {\n var w = new Array(num.bitLength());\n\n for (var bit = 0; bit < w.length; bit++) {\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n w[bit] = (num.words[off] & (1 << wbit)) >>> wbit;\n }\n\n return w;\n }\n\n // Number of trailing zero bits\n BN.prototype.zeroBits = function zeroBits () {\n if (this.isZero()) return 0;\n\n var r = 0;\n for (var i = 0; i < this.length; i++) {\n var b = this._zeroBits(this.words[i]);\n r += b;\n if (b !== 26) break;\n }\n return r;\n };\n\n BN.prototype.byteLength = function byteLength () {\n return Math.ceil(this.bitLength() / 8);\n };\n\n BN.prototype.toTwos = function toTwos (width) {\n if (this.negative !== 0) {\n return this.abs().inotn(width).iaddn(1);\n }\n return this.clone();\n };\n\n BN.prototype.fromTwos = function fromTwos (width) {\n if (this.testn(width - 1)) {\n return this.notn(width).iaddn(1).ineg();\n }\n return this.clone();\n };\n\n BN.prototype.isNeg = function isNeg () {\n return this.negative !== 0;\n };\n\n // Return negative clone of `this`\n BN.prototype.neg = function neg () {\n return this.clone().ineg();\n };\n\n BN.prototype.ineg = function ineg () {\n if (!this.isZero()) {\n this.negative ^= 1;\n }\n\n return this;\n };\n\n // Or `num` with `this` in-place\n BN.prototype.iuor = function iuor (num) {\n while (this.length < num.length) {\n this.words[this.length++] = 0;\n }\n\n for (var i = 0; i < num.length; i++) {\n this.words[i] = this.words[i] | num.words[i];\n }\n\n return this.strip();\n };\n\n BN.prototype.ior = function ior (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuor(num);\n };\n\n // Or `num` with `this`\n BN.prototype.or = function or (num) {\n if (this.length > num.length) return this.clone().ior(num);\n return num.clone().ior(this);\n };\n\n BN.prototype.uor = function uor (num) {\n if (this.length > num.length) return this.clone().iuor(num);\n return num.clone().iuor(this);\n };\n\n // And `num` with `this` in-place\n BN.prototype.iuand = function iuand (num) {\n // b = min-length(num, this)\n var b;\n if (this.length > num.length) {\n b = num;\n } else {\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = this.words[i] & num.words[i];\n }\n\n this.length = b.length;\n\n return this.strip();\n };\n\n BN.prototype.iand = function iand (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuand(num);\n };\n\n // And `num` with `this`\n BN.prototype.and = function and (num) {\n if (this.length > num.length) return this.clone().iand(num);\n return num.clone().iand(this);\n };\n\n BN.prototype.uand = function uand (num) {\n if (this.length > num.length) return this.clone().iuand(num);\n return num.clone().iuand(this);\n };\n\n // Xor `num` with `this` in-place\n BN.prototype.iuxor = function iuxor (num) {\n // a.length > b.length\n var a;\n var b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = a.words[i] ^ b.words[i];\n }\n\n if (this !== a) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = a.length;\n\n return this.strip();\n };\n\n BN.prototype.ixor = function ixor (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuxor(num);\n };\n\n // Xor `num` with `this`\n BN.prototype.xor = function xor (num) {\n if (this.length > num.length) return this.clone().ixor(num);\n return num.clone().ixor(this);\n };\n\n BN.prototype.uxor = function uxor (num) {\n if (this.length > num.length) return this.clone().iuxor(num);\n return num.clone().iuxor(this);\n };\n\n // Not ``this`` with ``width`` bitwidth\n BN.prototype.inotn = function inotn (width) {\n assert(typeof width === 'number' && width >= 0);\n\n var bytesNeeded = Math.ceil(width / 26) | 0;\n var bitsLeft = width % 26;\n\n // Extend the buffer with leading zeroes\n this._expand(bytesNeeded);\n\n if (bitsLeft > 0) {\n bytesNeeded--;\n }\n\n // Handle complete words\n for (var i = 0; i < bytesNeeded; i++) {\n this.words[i] = ~this.words[i] & 0x3ffffff;\n }\n\n // Handle the residue\n if (bitsLeft > 0) {\n this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));\n }\n\n // And remove leading zeroes\n return this.strip();\n };\n\n BN.prototype.notn = function notn (width) {\n return this.clone().inotn(width);\n };\n\n // Set `bit` of `this`\n BN.prototype.setn = function setn (bit, val) {\n assert(typeof bit === 'number' && bit >= 0);\n\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n this._expand(off + 1);\n\n if (val) {\n this.words[off] = this.words[off] | (1 << wbit);\n } else {\n this.words[off] = this.words[off] & ~(1 << wbit);\n }\n\n return this.strip();\n };\n\n // Add `num` to `this` in-place\n BN.prototype.iadd = function iadd (num) {\n var r;\n\n // negative + positive\n if (this.negative !== 0 && num.negative === 0) {\n this.negative = 0;\n r = this.isub(num);\n this.negative ^= 1;\n return this._normSign();\n\n // positive + negative\n } else if (this.negative === 0 && num.negative !== 0) {\n num.negative = 0;\n r = this.isub(num);\n num.negative = 1;\n return r._normSign();\n }\n\n // a.length > b.length\n var a, b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n\n this.length = a.length;\n if (carry !== 0) {\n this.words[this.length] = carry;\n this.length++;\n // Copy the rest of the words\n } else if (a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n return this;\n };\n\n // Add `num` to `this`\n BN.prototype.add = function add (num) {\n var res;\n if (num.negative !== 0 && this.negative === 0) {\n num.negative = 0;\n res = this.sub(num);\n num.negative ^= 1;\n return res;\n } else if (num.negative === 0 && this.negative !== 0) {\n this.negative = 0;\n res = num.sub(this);\n this.negative = 1;\n return res;\n }\n\n if (this.length > num.length) return this.clone().iadd(num);\n\n return num.clone().iadd(this);\n };\n\n // Subtract `num` from `this` in-place\n BN.prototype.isub = function isub (num) {\n // this - (-num) = this + num\n if (num.negative !== 0) {\n num.negative = 0;\n var r = this.iadd(num);\n num.negative = 1;\n return r._normSign();\n\n // -this - num = -(this + num)\n } else if (this.negative !== 0) {\n this.negative = 0;\n this.iadd(num);\n this.negative = 1;\n return this._normSign();\n }\n\n // At this point both numbers are positive\n var cmp = this.cmp(num);\n\n // Optimization - zeroify\n if (cmp === 0) {\n this.negative = 0;\n this.length = 1;\n this.words[0] = 0;\n return this;\n }\n\n // a > b\n var a, b;\n if (cmp > 0) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n\n // Copy rest of the words\n if (carry === 0 && i < a.length && a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = Math.max(this.length, i);\n\n if (a !== this) {\n this.negative = 1;\n }\n\n return this.strip();\n };\n\n // Subtract `num` from `this`\n BN.prototype.sub = function sub (num) {\n return this.clone().isub(num);\n };\n\n function smallMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n var len = (self.length + num.length) | 0;\n out.length = len;\n len = (len - 1) | 0;\n\n // Peel one iteration (compiler can't do it, because of code complexity)\n var a = self.words[0] | 0;\n var b = num.words[0] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n var carry = (r / 0x4000000) | 0;\n out.words[0] = lo;\n\n for (var k = 1; k < len; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = carry >>> 26;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = (k - j) | 0;\n a = self.words[i] | 0;\n b = num.words[j] | 0;\n r = a * b + rword;\n ncarry += (r / 0x4000000) | 0;\n rword = r & 0x3ffffff;\n }\n out.words[k] = rword | 0;\n carry = ncarry | 0;\n }\n if (carry !== 0) {\n out.words[k] = carry | 0;\n } else {\n out.length--;\n }\n\n return out.strip();\n }\n\n // TODO(indutny): it may be reasonable to omit it for users who don't need\n // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit\n // multiplication (like elliptic secp256k1).\n var comb10MulTo = function comb10MulTo (self, num, out) {\n var a = self.words;\n var b = num.words;\n var o = out.words;\n var c = 0;\n var lo;\n var mid;\n var hi;\n var a0 = a[0] | 0;\n var al0 = a0 & 0x1fff;\n var ah0 = a0 >>> 13;\n var a1 = a[1] | 0;\n var al1 = a1 & 0x1fff;\n var ah1 = a1 >>> 13;\n var a2 = a[2] | 0;\n var al2 = a2 & 0x1fff;\n var ah2 = a2 >>> 13;\n var a3 = a[3] | 0;\n var al3 = a3 & 0x1fff;\n var ah3 = a3 >>> 13;\n var a4 = a[4] | 0;\n var al4 = a4 & 0x1fff;\n var ah4 = a4 >>> 13;\n var a5 = a[5] | 0;\n var al5 = a5 & 0x1fff;\n var ah5 = a5 >>> 13;\n var a6 = a[6] | 0;\n var al6 = a6 & 0x1fff;\n var ah6 = a6 >>> 13;\n var a7 = a[7] | 0;\n var al7 = a7 & 0x1fff;\n var ah7 = a7 >>> 13;\n var a8 = a[8] | 0;\n var al8 = a8 & 0x1fff;\n var ah8 = a8 >>> 13;\n var a9 = a[9] | 0;\n var al9 = a9 & 0x1fff;\n var ah9 = a9 >>> 13;\n var b0 = b[0] | 0;\n var bl0 = b0 & 0x1fff;\n var bh0 = b0 >>> 13;\n var b1 = b[1] | 0;\n var bl1 = b1 & 0x1fff;\n var bh1 = b1 >>> 13;\n var b2 = b[2] | 0;\n var bl2 = b2 & 0x1fff;\n var bh2 = b2 >>> 13;\n var b3 = b[3] | 0;\n var bl3 = b3 & 0x1fff;\n var bh3 = b3 >>> 13;\n var b4 = b[4] | 0;\n var bl4 = b4 & 0x1fff;\n var bh4 = b4 >>> 13;\n var b5 = b[5] | 0;\n var bl5 = b5 & 0x1fff;\n var bh5 = b5 >>> 13;\n var b6 = b[6] | 0;\n var bl6 = b6 & 0x1fff;\n var bh6 = b6 >>> 13;\n var b7 = b[7] | 0;\n var bl7 = b7 & 0x1fff;\n var bh7 = b7 >>> 13;\n var b8 = b[8] | 0;\n var bl8 = b8 & 0x1fff;\n var bh8 = b8 >>> 13;\n var b9 = b[9] | 0;\n var bl9 = b9 & 0x1fff;\n var bh9 = b9 >>> 13;\n\n out.negative = self.negative ^ num.negative;\n out.length = 19;\n /* k = 0 */\n lo = Math.imul(al0, bl0);\n mid = Math.imul(al0, bh0);\n mid = (mid + Math.imul(ah0, bl0)) | 0;\n hi = Math.imul(ah0, bh0);\n var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\n w0 &= 0x3ffffff;\n /* k = 1 */\n lo = Math.imul(al1, bl0);\n mid = Math.imul(al1, bh0);\n mid = (mid + Math.imul(ah1, bl0)) | 0;\n hi = Math.imul(ah1, bh0);\n lo = (lo + Math.imul(al0, bl1)) | 0;\n mid = (mid + Math.imul(al0, bh1)) | 0;\n mid = (mid + Math.imul(ah0, bl1)) | 0;\n hi = (hi + Math.imul(ah0, bh1)) | 0;\n var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\n w1 &= 0x3ffffff;\n /* k = 2 */\n lo = Math.imul(al2, bl0);\n mid = Math.imul(al2, bh0);\n mid = (mid + Math.imul(ah2, bl0)) | 0;\n hi = Math.imul(ah2, bh0);\n lo = (lo + Math.imul(al1, bl1)) | 0;\n mid = (mid + Math.imul(al1, bh1)) | 0;\n mid = (mid + Math.imul(ah1, bl1)) | 0;\n hi = (hi + Math.imul(ah1, bh1)) | 0;\n lo = (lo + Math.imul(al0, bl2)) | 0;\n mid = (mid + Math.imul(al0, bh2)) | 0;\n mid = (mid + Math.imul(ah0, bl2)) | 0;\n hi = (hi + Math.imul(ah0, bh2)) | 0;\n var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\n w2 &= 0x3ffffff;\n /* k = 3 */\n lo = Math.imul(al3, bl0);\n mid = Math.imul(al3, bh0);\n mid = (mid + Math.imul(ah3, bl0)) | 0;\n hi = Math.imul(ah3, bh0);\n lo = (lo + Math.imul(al2, bl1)) | 0;\n mid = (mid + Math.imul(al2, bh1)) | 0;\n mid = (mid + Math.imul(ah2, bl1)) | 0;\n hi = (hi + Math.imul(ah2, bh1)) | 0;\n lo = (lo + Math.imul(al1, bl2)) | 0;\n mid = (mid + Math.imul(al1, bh2)) | 0;\n mid = (mid + Math.imul(ah1, bl2)) | 0;\n hi = (hi + Math.imul(ah1, bh2)) | 0;\n lo = (lo + Math.imul(al0, bl3)) | 0;\n mid = (mid + Math.imul(al0, bh3)) | 0;\n mid = (mid + Math.imul(ah0, bl3)) | 0;\n hi = (hi + Math.imul(ah0, bh3)) | 0;\n var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\n w3 &= 0x3ffffff;\n /* k = 4 */\n lo = Math.imul(al4, bl0);\n mid = Math.imul(al4, bh0);\n mid = (mid + Math.imul(ah4, bl0)) | 0;\n hi = Math.imul(ah4, bh0);\n lo = (lo + Math.imul(al3, bl1)) | 0;\n mid = (mid + Math.imul(al3, bh1)) | 0;\n mid = (mid + Math.imul(ah3, bl1)) | 0;\n hi = (hi + Math.imul(ah3, bh1)) | 0;\n lo = (lo + Math.imul(al2, bl2)) | 0;\n mid = (mid + Math.imul(al2, bh2)) | 0;\n mid = (mid + Math.imul(ah2, bl2)) | 0;\n hi = (hi + Math.imul(ah2, bh2)) | 0;\n lo = (lo + Math.imul(al1, bl3)) | 0;\n mid = (mid + Math.imul(al1, bh3)) | 0;\n mid = (mid + Math.imul(ah1, bl3)) | 0;\n hi = (hi + Math.imul(ah1, bh3)) | 0;\n lo = (lo + Math.imul(al0, bl4)) | 0;\n mid = (mid + Math.imul(al0, bh4)) | 0;\n mid = (mid + Math.imul(ah0, bl4)) | 0;\n hi = (hi + Math.imul(ah0, bh4)) | 0;\n var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\n w4 &= 0x3ffffff;\n /* k = 5 */\n lo = Math.imul(al5, bl0);\n mid = Math.imul(al5, bh0);\n mid = (mid + Math.imul(ah5, bl0)) | 0;\n hi = Math.imul(ah5, bh0);\n lo = (lo + Math.imul(al4, bl1)) | 0;\n mid = (mid + Math.imul(al4, bh1)) | 0;\n mid = (mid + Math.imul(ah4, bl1)) | 0;\n hi = (hi + Math.imul(ah4, bh1)) | 0;\n lo = (lo + Math.imul(al3, bl2)) | 0;\n mid = (mid + Math.imul(al3, bh2)) | 0;\n mid = (mid + Math.imul(ah3, bl2)) | 0;\n hi = (hi + Math.imul(ah3, bh2)) | 0;\n lo = (lo + Math.imul(al2, bl3)) | 0;\n mid = (mid + Math.imul(al2, bh3)) | 0;\n mid = (mid + Math.imul(ah2, bl3)) | 0;\n hi = (hi + Math.imul(ah2, bh3)) | 0;\n lo = (lo + Math.imul(al1, bl4)) | 0;\n mid = (mid + Math.imul(al1, bh4)) | 0;\n mid = (mid + Math.imul(ah1, bl4)) | 0;\n hi = (hi + Math.imul(ah1, bh4)) | 0;\n lo = (lo + Math.imul(al0, bl5)) | 0;\n mid = (mid + Math.imul(al0, bh5)) | 0;\n mid = (mid + Math.imul(ah0, bl5)) | 0;\n hi = (hi + Math.imul(ah0, bh5)) | 0;\n var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\n w5 &= 0x3ffffff;\n /* k = 6 */\n lo = Math.imul(al6, bl0);\n mid = Math.imul(al6, bh0);\n mid = (mid + Math.imul(ah6, bl0)) | 0;\n hi = Math.imul(ah6, bh0);\n lo = (lo + Math.imul(al5, bl1)) | 0;\n mid = (mid + Math.imul(al5, bh1)) | 0;\n mid = (mid + Math.imul(ah5, bl1)) | 0;\n hi = (hi + Math.imul(ah5, bh1)) | 0;\n lo = (lo + Math.imul(al4, bl2)) | 0;\n mid = (mid + Math.imul(al4, bh2)) | 0;\n mid = (mid + Math.imul(ah4, bl2)) | 0;\n hi = (hi + Math.imul(ah4, bh2)) | 0;\n lo = (lo + Math.imul(al3, bl3)) | 0;\n mid = (mid + Math.imul(al3, bh3)) | 0;\n mid = (mid + Math.imul(ah3, bl3)) | 0;\n hi = (hi + Math.imul(ah3, bh3)) | 0;\n lo = (lo + Math.imul(al2, bl4)) | 0;\n mid = (mid + Math.imul(al2, bh4)) | 0;\n mid = (mid + Math.imul(ah2, bl4)) | 0;\n hi = (hi + Math.imul(ah2, bh4)) | 0;\n lo = (lo + Math.imul(al1, bl5)) | 0;\n mid = (mid + Math.imul(al1, bh5)) | 0;\n mid = (mid + Math.imul(ah1, bl5)) | 0;\n hi = (hi + Math.imul(ah1, bh5)) | 0;\n lo = (lo + Math.imul(al0, bl6)) | 0;\n mid = (mid + Math.imul(al0, bh6)) | 0;\n mid = (mid + Math.imul(ah0, bl6)) | 0;\n hi = (hi + Math.imul(ah0, bh6)) | 0;\n var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\n w6 &= 0x3ffffff;\n /* k = 7 */\n lo = Math.imul(al7, bl0);\n mid = Math.imul(al7, bh0);\n mid = (mid + Math.imul(ah7, bl0)) | 0;\n hi = Math.imul(ah7, bh0);\n lo = (lo + Math.imul(al6, bl1)) | 0;\n mid = (mid + Math.imul(al6, bh1)) | 0;\n mid = (mid + Math.imul(ah6, bl1)) | 0;\n hi = (hi + Math.imul(ah6, bh1)) | 0;\n lo = (lo + Math.imul(al5, bl2)) | 0;\n mid = (mid + Math.imul(al5, bh2)) | 0;\n mid = (mid + Math.imul(ah5, bl2)) | 0;\n hi = (hi + Math.imul(ah5, bh2)) | 0;\n lo = (lo + Math.imul(al4, bl3)) | 0;\n mid = (mid + Math.imul(al4, bh3)) | 0;\n mid = (mid + Math.imul(ah4, bl3)) | 0;\n hi = (hi + Math.imul(ah4, bh3)) | 0;\n lo = (lo + Math.imul(al3, bl4)) | 0;\n mid = (mid + Math.imul(al3, bh4)) | 0;\n mid = (mid + Math.imul(ah3, bl4)) | 0;\n hi = (hi + Math.imul(ah3, bh4)) | 0;\n lo = (lo + Math.imul(al2, bl5)) | 0;\n mid = (mid + Math.imul(al2, bh5)) | 0;\n mid = (mid + Math.imul(ah2, bl5)) | 0;\n hi = (hi + Math.imul(ah2, bh5)) | 0;\n lo = (lo + Math.imul(al1, bl6)) | 0;\n mid = (mid + Math.imul(al1, bh6)) | 0;\n mid = (mid + Math.imul(ah1, bl6)) | 0;\n hi = (hi + Math.imul(ah1, bh6)) | 0;\n lo = (lo + Math.imul(al0, bl7)) | 0;\n mid = (mid + Math.imul(al0, bh7)) | 0;\n mid = (mid + Math.imul(ah0, bl7)) | 0;\n hi = (hi + Math.imul(ah0, bh7)) | 0;\n var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\n w7 &= 0x3ffffff;\n /* k = 8 */\n lo = Math.imul(al8, bl0);\n mid = Math.imul(al8, bh0);\n mid = (mid + Math.imul(ah8, bl0)) | 0;\n hi = Math.imul(ah8, bh0);\n lo = (lo + Math.imul(al7, bl1)) | 0;\n mid = (mid + Math.imul(al7, bh1)) | 0;\n mid = (mid + Math.imul(ah7, bl1)) | 0;\n hi = (hi + Math.imul(ah7, bh1)) | 0;\n lo = (lo + Math.imul(al6, bl2)) | 0;\n mid = (mid + Math.imul(al6, bh2)) | 0;\n mid = (mid + Math.imul(ah6, bl2)) | 0;\n hi = (hi + Math.imul(ah6, bh2)) | 0;\n lo = (lo + Math.imul(al5, bl3)) | 0;\n mid = (mid + Math.imul(al5, bh3)) | 0;\n mid = (mid + Math.imul(ah5, bl3)) | 0;\n hi = (hi + Math.imul(ah5, bh3)) | 0;\n lo = (lo + Math.imul(al4, bl4)) | 0;\n mid = (mid + Math.imul(al4, bh4)) | 0;\n mid = (mid + Math.imul(ah4, bl4)) | 0;\n hi = (hi + Math.imul(ah4, bh4)) | 0;\n lo = (lo + Math.imul(al3, bl5)) | 0;\n mid = (mid + Math.imul(al3, bh5)) | 0;\n mid = (mid + Math.imul(ah3, bl5)) | 0;\n hi = (hi + Math.imul(ah3, bh5)) | 0;\n lo = (lo + Math.imul(al2, bl6)) | 0;\n mid = (mid + Math.imul(al2, bh6)) | 0;\n mid = (mid + Math.imul(ah2, bl6)) | 0;\n hi = (hi + Math.imul(ah2, bh6)) | 0;\n lo = (lo + Math.imul(al1, bl7)) | 0;\n mid = (mid + Math.imul(al1, bh7)) | 0;\n mid = (mid + Math.imul(ah1, bl7)) | 0;\n hi = (hi + Math.imul(ah1, bh7)) | 0;\n lo = (lo + Math.imul(al0, bl8)) | 0;\n mid = (mid + Math.imul(al0, bh8)) | 0;\n mid = (mid + Math.imul(ah0, bl8)) | 0;\n hi = (hi + Math.imul(ah0, bh8)) | 0;\n var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\n w8 &= 0x3ffffff;\n /* k = 9 */\n lo = Math.imul(al9, bl0);\n mid = Math.imul(al9, bh0);\n mid = (mid + Math.imul(ah9, bl0)) | 0;\n hi = Math.imul(ah9, bh0);\n lo = (lo + Math.imul(al8, bl1)) | 0;\n mid = (mid + Math.imul(al8, bh1)) | 0;\n mid = (mid + Math.imul(ah8, bl1)) | 0;\n hi = (hi + Math.imul(ah8, bh1)) | 0;\n lo = (lo + Math.imul(al7, bl2)) | 0;\n mid = (mid + Math.imul(al7, bh2)) | 0;\n mid = (mid + Math.imul(ah7, bl2)) | 0;\n hi = (hi + Math.imul(ah7, bh2)) | 0;\n lo = (lo + Math.imul(al6, bl3)) | 0;\n mid = (mid + Math.imul(al6, bh3)) | 0;\n mid = (mid + Math.imul(ah6, bl3)) | 0;\n hi = (hi + Math.imul(ah6, bh3)) | 0;\n lo = (lo + Math.imul(al5, bl4)) | 0;\n mid = (mid + Math.imul(al5, bh4)) | 0;\n mid = (mid + Math.imul(ah5, bl4)) | 0;\n hi = (hi + Math.imul(ah5, bh4)) | 0;\n lo = (lo + Math.imul(al4, bl5)) | 0;\n mid = (mid + Math.imul(al4, bh5)) | 0;\n mid = (mid + Math.imul(ah4, bl5)) | 0;\n hi = (hi + Math.imul(ah4, bh5)) | 0;\n lo = (lo + Math.imul(al3, bl6)) | 0;\n mid = (mid + Math.imul(al3, bh6)) | 0;\n mid = (mid + Math.imul(ah3, bl6)) | 0;\n hi = (hi + Math.imul(ah3, bh6)) | 0;\n lo = (lo + Math.imul(al2, bl7)) | 0;\n mid = (mid + Math.imul(al2, bh7)) | 0;\n mid = (mid + Math.imul(ah2, bl7)) | 0;\n hi = (hi + Math.imul(ah2, bh7)) | 0;\n lo = (lo + Math.imul(al1, bl8)) | 0;\n mid = (mid + Math.imul(al1, bh8)) | 0;\n mid = (mid + Math.imul(ah1, bl8)) | 0;\n hi = (hi + Math.imul(ah1, bh8)) | 0;\n lo = (lo + Math.imul(al0, bl9)) | 0;\n mid = (mid + Math.imul(al0, bh9)) | 0;\n mid = (mid + Math.imul(ah0, bl9)) | 0;\n hi = (hi + Math.imul(ah0, bh9)) | 0;\n var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\n w9 &= 0x3ffffff;\n /* k = 10 */\n lo = Math.imul(al9, bl1);\n mid = Math.imul(al9, bh1);\n mid = (mid + Math.imul(ah9, bl1)) | 0;\n hi = Math.imul(ah9, bh1);\n lo = (lo + Math.imul(al8, bl2)) | 0;\n mid = (mid + Math.imul(al8, bh2)) | 0;\n mid = (mid + Math.imul(ah8, bl2)) | 0;\n hi = (hi + Math.imul(ah8, bh2)) | 0;\n lo = (lo + Math.imul(al7, bl3)) | 0;\n mid = (mid + Math.imul(al7, bh3)) | 0;\n mid = (mid + Math.imul(ah7, bl3)) | 0;\n hi = (hi + Math.imul(ah7, bh3)) | 0;\n lo = (lo + Math.imul(al6, bl4)) | 0;\n mid = (mid + Math.imul(al6, bh4)) | 0;\n mid = (mid + Math.imul(ah6, bl4)) | 0;\n hi = (hi + Math.imul(ah6, bh4)) | 0;\n lo = (lo + Math.imul(al5, bl5)) | 0;\n mid = (mid + Math.imul(al5, bh5)) | 0;\n mid = (mid + Math.imul(ah5, bl5)) | 0;\n hi = (hi + Math.imul(ah5, bh5)) | 0;\n lo = (lo + Math.imul(al4, bl6)) | 0;\n mid = (mid + Math.imul(al4, bh6)) | 0;\n mid = (mid + Math.imul(ah4, bl6)) | 0;\n hi = (hi + Math.imul(ah4, bh6)) | 0;\n lo = (lo + Math.imul(al3, bl7)) | 0;\n mid = (mid + Math.imul(al3, bh7)) | 0;\n mid = (mid + Math.imul(ah3, bl7)) | 0;\n hi = (hi + Math.imul(ah3, bh7)) | 0;\n lo = (lo + Math.imul(al2, bl8)) | 0;\n mid = (mid + Math.imul(al2, bh8)) | 0;\n mid = (mid + Math.imul(ah2, bl8)) | 0;\n hi = (hi + Math.imul(ah2, bh8)) | 0;\n lo = (lo + Math.imul(al1, bl9)) | 0;\n mid = (mid + Math.imul(al1, bh9)) | 0;\n mid = (mid + Math.imul(ah1, bl9)) | 0;\n hi = (hi + Math.imul(ah1, bh9)) | 0;\n var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\n w10 &= 0x3ffffff;\n /* k = 11 */\n lo = Math.imul(al9, bl2);\n mid = Math.imul(al9, bh2);\n mid = (mid + Math.imul(ah9, bl2)) | 0;\n hi = Math.imul(ah9, bh2);\n lo = (lo + Math.imul(al8, bl3)) | 0;\n mid = (mid + Math.imul(al8, bh3)) | 0;\n mid = (mid + Math.imul(ah8, bl3)) | 0;\n hi = (hi + Math.imul(ah8, bh3)) | 0;\n lo = (lo + Math.imul(al7, bl4)) | 0;\n mid = (mid + Math.imul(al7, bh4)) | 0;\n mid = (mid + Math.imul(ah7, bl4)) | 0;\n hi = (hi + Math.imul(ah7, bh4)) | 0;\n lo = (lo + Math.imul(al6, bl5)) | 0;\n mid = (mid + Math.imul(al6, bh5)) | 0;\n mid = (mid + Math.imul(ah6, bl5)) | 0;\n hi = (hi + Math.imul(ah6, bh5)) | 0;\n lo = (lo + Math.imul(al5, bl6)) | 0;\n mid = (mid + Math.imul(al5, bh6)) | 0;\n mid = (mid + Math.imul(ah5, bl6)) | 0;\n hi = (hi + Math.imul(ah5, bh6)) | 0;\n lo = (lo + Math.imul(al4, bl7)) | 0;\n mid = (mid + Math.imul(al4, bh7)) | 0;\n mid = (mid + Math.imul(ah4, bl7)) | 0;\n hi = (hi + Math.imul(ah4, bh7)) | 0;\n lo = (lo + Math.imul(al3, bl8)) | 0;\n mid = (mid + Math.imul(al3, bh8)) | 0;\n mid = (mid + Math.imul(ah3, bl8)) | 0;\n hi = (hi + Math.imul(ah3, bh8)) | 0;\n lo = (lo + Math.imul(al2, bl9)) | 0;\n mid = (mid + Math.imul(al2, bh9)) | 0;\n mid = (mid + Math.imul(ah2, bl9)) | 0;\n hi = (hi + Math.imul(ah2, bh9)) | 0;\n var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\n w11 &= 0x3ffffff;\n /* k = 12 */\n lo = Math.imul(al9, bl3);\n mid = Math.imul(al9, bh3);\n mid = (mid + Math.imul(ah9, bl3)) | 0;\n hi = Math.imul(ah9, bh3);\n lo = (lo + Math.imul(al8, bl4)) | 0;\n mid = (mid + Math.imul(al8, bh4)) | 0;\n mid = (mid + Math.imul(ah8, bl4)) | 0;\n hi = (hi + Math.imul(ah8, bh4)) | 0;\n lo = (lo + Math.imul(al7, bl5)) | 0;\n mid = (mid + Math.imul(al7, bh5)) | 0;\n mid = (mid + Math.imul(ah7, bl5)) | 0;\n hi = (hi + Math.imul(ah7, bh5)) | 0;\n lo = (lo + Math.imul(al6, bl6)) | 0;\n mid = (mid + Math.imul(al6, bh6)) | 0;\n mid = (mid + Math.imul(ah6, bl6)) | 0;\n hi = (hi + Math.imul(ah6, bh6)) | 0;\n lo = (lo + Math.imul(al5, bl7)) | 0;\n mid = (mid + Math.imul(al5, bh7)) | 0;\n mid = (mid + Math.imul(ah5, bl7)) | 0;\n hi = (hi + Math.imul(ah5, bh7)) | 0;\n lo = (lo + Math.imul(al4, bl8)) | 0;\n mid = (mid + Math.imul(al4, bh8)) | 0;\n mid = (mid + Math.imul(ah4, bl8)) | 0;\n hi = (hi + Math.imul(ah4, bh8)) | 0;\n lo = (lo + Math.imul(al3, bl9)) | 0;\n mid = (mid + Math.imul(al3, bh9)) | 0;\n mid = (mid + Math.imul(ah3, bl9)) | 0;\n hi = (hi + Math.imul(ah3, bh9)) | 0;\n var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\n w12 &= 0x3ffffff;\n /* k = 13 */\n lo = Math.imul(al9, bl4);\n mid = Math.imul(al9, bh4);\n mid = (mid + Math.imul(ah9, bl4)) | 0;\n hi = Math.imul(ah9, bh4);\n lo = (lo + Math.imul(al8, bl5)) | 0;\n mid = (mid + Math.imul(al8, bh5)) | 0;\n mid = (mid + Math.imul(ah8, bl5)) | 0;\n hi = (hi + Math.imul(ah8, bh5)) | 0;\n lo = (lo + Math.imul(al7, bl6)) | 0;\n mid = (mid + Math.imul(al7, bh6)) | 0;\n mid = (mid + Math.imul(ah7, bl6)) | 0;\n hi = (hi + Math.imul(ah7, bh6)) | 0;\n lo = (lo + Math.imul(al6, bl7)) | 0;\n mid = (mid + Math.imul(al6, bh7)) | 0;\n mid = (mid + Math.imul(ah6, bl7)) | 0;\n hi = (hi + Math.imul(ah6, bh7)) | 0;\n lo = (lo + Math.imul(al5, bl8)) | 0;\n mid = (mid + Math.imul(al5, bh8)) | 0;\n mid = (mid + Math.imul(ah5, bl8)) | 0;\n hi = (hi + Math.imul(ah5, bh8)) | 0;\n lo = (lo + Math.imul(al4, bl9)) | 0;\n mid = (mid + Math.imul(al4, bh9)) | 0;\n mid = (mid + Math.imul(ah4, bl9)) | 0;\n hi = (hi + Math.imul(ah4, bh9)) | 0;\n var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\n w13 &= 0x3ffffff;\n /* k = 14 */\n lo = Math.imul(al9, bl5);\n mid = Math.imul(al9, bh5);\n mid = (mid + Math.imul(ah9, bl5)) | 0;\n hi = Math.imul(ah9, bh5);\n lo = (lo + Math.imul(al8, bl6)) | 0;\n mid = (mid + Math.imul(al8, bh6)) | 0;\n mid = (mid + Math.imul(ah8, bl6)) | 0;\n hi = (hi + Math.imul(ah8, bh6)) | 0;\n lo = (lo + Math.imul(al7, bl7)) | 0;\n mid = (mid + Math.imul(al7, bh7)) | 0;\n mid = (mid + Math.imul(ah7, bl7)) | 0;\n hi = (hi + Math.imul(ah7, bh7)) | 0;\n lo = (lo + Math.imul(al6, bl8)) | 0;\n mid = (mid + Math.imul(al6, bh8)) | 0;\n mid = (mid + Math.imul(ah6, bl8)) | 0;\n hi = (hi + Math.imul(ah6, bh8)) | 0;\n lo = (lo + Math.imul(al5, bl9)) | 0;\n mid = (mid + Math.imul(al5, bh9)) | 0;\n mid = (mid + Math.imul(ah5, bl9)) | 0;\n hi = (hi + Math.imul(ah5, bh9)) | 0;\n var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\n w14 &= 0x3ffffff;\n /* k = 15 */\n lo = Math.imul(al9, bl6);\n mid = Math.imul(al9, bh6);\n mid = (mid + Math.imul(ah9, bl6)) | 0;\n hi = Math.imul(ah9, bh6);\n lo = (lo + Math.imul(al8, bl7)) | 0;\n mid = (mid + Math.imul(al8, bh7)) | 0;\n mid = (mid + Math.imul(ah8, bl7)) | 0;\n hi = (hi + Math.imul(ah8, bh7)) | 0;\n lo = (lo + Math.imul(al7, bl8)) | 0;\n mid = (mid + Math.imul(al7, bh8)) | 0;\n mid = (mid + Math.imul(ah7, bl8)) | 0;\n hi = (hi + Math.imul(ah7, bh8)) | 0;\n lo = (lo + Math.imul(al6, bl9)) | 0;\n mid = (mid + Math.imul(al6, bh9)) | 0;\n mid = (mid + Math.imul(ah6, bl9)) | 0;\n hi = (hi + Math.imul(ah6, bh9)) | 0;\n var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\n w15 &= 0x3ffffff;\n /* k = 16 */\n lo = Math.imul(al9, bl7);\n mid = Math.imul(al9, bh7);\n mid = (mid + Math.imul(ah9, bl7)) | 0;\n hi = Math.imul(ah9, bh7);\n lo = (lo + Math.imul(al8, bl8)) | 0;\n mid = (mid + Math.imul(al8, bh8)) | 0;\n mid = (mid + Math.imul(ah8, bl8)) | 0;\n hi = (hi + Math.imul(ah8, bh8)) | 0;\n lo = (lo + Math.imul(al7, bl9)) | 0;\n mid = (mid + Math.imul(al7, bh9)) | 0;\n mid = (mid + Math.imul(ah7, bl9)) | 0;\n hi = (hi + Math.imul(ah7, bh9)) | 0;\n var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\n w16 &= 0x3ffffff;\n /* k = 17 */\n lo = Math.imul(al9, bl8);\n mid = Math.imul(al9, bh8);\n mid = (mid + Math.imul(ah9, bl8)) | 0;\n hi = Math.imul(ah9, bh8);\n lo = (lo + Math.imul(al8, bl9)) | 0;\n mid = (mid + Math.imul(al8, bh9)) | 0;\n mid = (mid + Math.imul(ah8, bl9)) | 0;\n hi = (hi + Math.imul(ah8, bh9)) | 0;\n var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\n w17 &= 0x3ffffff;\n /* k = 18 */\n lo = Math.imul(al9, bl9);\n mid = Math.imul(al9, bh9);\n mid = (mid + Math.imul(ah9, bl9)) | 0;\n hi = Math.imul(ah9, bh9);\n var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\n w18 &= 0x3ffffff;\n o[0] = w0;\n o[1] = w1;\n o[2] = w2;\n o[3] = w3;\n o[4] = w4;\n o[5] = w5;\n o[6] = w6;\n o[7] = w7;\n o[8] = w8;\n o[9] = w9;\n o[10] = w10;\n o[11] = w11;\n o[12] = w12;\n o[13] = w13;\n o[14] = w14;\n o[15] = w15;\n o[16] = w16;\n o[17] = w17;\n o[18] = w18;\n if (c !== 0) {\n o[19] = c;\n out.length++;\n }\n return out;\n };\n\n // Polyfill comb\n if (!Math.imul) {\n comb10MulTo = smallMulTo;\n }\n\n function bigMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n out.length = self.length + num.length;\n\n var carry = 0;\n var hncarry = 0;\n for (var k = 0; k < out.length - 1; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = hncarry;\n hncarry = 0;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = k - j;\n var a = self.words[i] | 0;\n var b = num.words[j] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\n lo = (lo + rword) | 0;\n rword = lo & 0x3ffffff;\n ncarry = (ncarry + (lo >>> 26)) | 0;\n\n hncarry += ncarry >>> 26;\n ncarry &= 0x3ffffff;\n }\n out.words[k] = rword;\n carry = ncarry;\n ncarry = hncarry;\n }\n if (carry !== 0) {\n out.words[k] = carry;\n } else {\n out.length--;\n }\n\n return out.strip();\n }\n\n function jumboMulTo (self, num, out) {\n var fftm = new FFTM();\n return fftm.mulp(self, num, out);\n }\n\n BN.prototype.mulTo = function mulTo (num, out) {\n var res;\n var len = this.length + num.length;\n if (this.length === 10 && num.length === 10) {\n res = comb10MulTo(this, num, out);\n } else if (len < 63) {\n res = smallMulTo(this, num, out);\n } else if (len < 1024) {\n res = bigMulTo(this, num, out);\n } else {\n res = jumboMulTo(this, num, out);\n }\n\n return res;\n };\n\n // Cooley-Tukey algorithm for FFT\n // slightly revisited to rely on looping instead of recursion\n\n function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }\n\n FFTM.prototype.makeRBT = function makeRBT (N) {\n var t = new Array(N);\n var l = BN.prototype._countBits(N) - 1;\n for (var i = 0; i < N; i++) {\n t[i] = this.revBin(i, l, N);\n }\n\n return t;\n };\n\n // Returns binary-reversed representation of `x`\n FFTM.prototype.revBin = function revBin (x, l, N) {\n if (x === 0 || x === N - 1) return x;\n\n var rb = 0;\n for (var i = 0; i < l; i++) {\n rb |= (x & 1) << (l - i - 1);\n x >>= 1;\n }\n\n return rb;\n };\n\n // Performs \"tweedling\" phase, therefore 'emulating'\n // behaviour of the recursive algorithm\n FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {\n for (var i = 0; i < N; i++) {\n rtws[i] = rws[rbt[i]];\n itws[i] = iws[rbt[i]];\n }\n };\n\n FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {\n this.permute(rbt, rws, iws, rtws, itws, N);\n\n for (var s = 1; s < N; s <<= 1) {\n var l = s << 1;\n\n var rtwdf = Math.cos(2 * Math.PI / l);\n var itwdf = Math.sin(2 * Math.PI / l);\n\n for (var p = 0; p < N; p += l) {\n var rtwdf_ = rtwdf;\n var itwdf_ = itwdf;\n\n for (var j = 0; j < s; j++) {\n var re = rtws[p + j];\n var ie = itws[p + j];\n\n var ro = rtws[p + j + s];\n var io = itws[p + j + s];\n\n var rx = rtwdf_ * ro - itwdf_ * io;\n\n io = rtwdf_ * io + itwdf_ * ro;\n ro = rx;\n\n rtws[p + j] = re + ro;\n itws[p + j] = ie + io;\n\n rtws[p + j + s] = re - ro;\n itws[p + j + s] = ie - io;\n\n /* jshint maxdepth : false */\n if (j !== l) {\n rx = rtwdf * rtwdf_ - itwdf * itwdf_;\n\n itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;\n rtwdf_ = rx;\n }\n }\n }\n }\n };\n\n FFTM.prototype.guessLen13b = function guessLen13b (n, m) {\n var N = Math.max(m, n) | 1;\n var odd = N & 1;\n var i = 0;\n for (N = N / 2 | 0; N; N = N >>> 1) {\n i++;\n }\n\n return 1 << i + 1 + odd;\n };\n\n FFTM.prototype.conjugate = function conjugate (rws, iws, N) {\n if (N <= 1) return;\n\n for (var i = 0; i < N / 2; i++) {\n var t = rws[i];\n\n rws[i] = rws[N - i - 1];\n rws[N - i - 1] = t;\n\n t = iws[i];\n\n iws[i] = -iws[N - i - 1];\n iws[N - i - 1] = -t;\n }\n };\n\n FFTM.prototype.normalize13b = function normalize13b (ws, N) {\n var carry = 0;\n for (var i = 0; i < N / 2; i++) {\n var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +\n Math.round(ws[2 * i] / N) +\n carry;\n\n ws[i] = w & 0x3ffffff;\n\n if (w < 0x4000000) {\n carry = 0;\n } else {\n carry = w / 0x4000000 | 0;\n }\n }\n\n return ws;\n };\n\n FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {\n var carry = 0;\n for (var i = 0; i < len; i++) {\n carry = carry + (ws[i] | 0);\n\n rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;\n rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;\n }\n\n // Pad with zeroes\n for (i = 2 * len; i < N; ++i) {\n rws[i] = 0;\n }\n\n assert(carry === 0);\n assert((carry & ~0x1fff) === 0);\n };\n\n FFTM.prototype.stub = function stub (N) {\n var ph = new Array(N);\n for (var i = 0; i < N; i++) {\n ph[i] = 0;\n }\n\n return ph;\n };\n\n FFTM.prototype.mulp = function mulp (x, y, out) {\n var N = 2 * this.guessLen13b(x.length, y.length);\n\n var rbt = this.makeRBT(N);\n\n var _ = this.stub(N);\n\n var rws = new Array(N);\n var rwst = new Array(N);\n var iwst = new Array(N);\n\n var nrws = new Array(N);\n var nrwst = new Array(N);\n var niwst = new Array(N);\n\n var rmws = out.words;\n rmws.length = N;\n\n this.convert13b(x.words, x.length, rws, N);\n this.convert13b(y.words, y.length, nrws, N);\n\n this.transform(rws, _, rwst, iwst, N, rbt);\n this.transform(nrws, _, nrwst, niwst, N, rbt);\n\n for (var i = 0; i < N; i++) {\n var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\n iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];\n rwst[i] = rx;\n }\n\n this.conjugate(rwst, iwst, N);\n this.transform(rwst, iwst, rmws, _, N, rbt);\n this.conjugate(rmws, _, N);\n this.normalize13b(rmws, N);\n\n out.negative = x.negative ^ y.negative;\n out.length = x.length + y.length;\n return out.strip();\n };\n\n // Multiply `this` by `num`\n BN.prototype.mul = function mul (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return this.mulTo(num, out);\n };\n\n // Multiply employing FFT\n BN.prototype.mulf = function mulf (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return jumboMulTo(this, num, out);\n };\n\n // In-place Multiplication\n BN.prototype.imul = function imul (num) {\n return this.clone().mulTo(num, this);\n };\n\n BN.prototype.imuln = function imuln (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n\n // Carry\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = (this.words[i] | 0) * num;\n var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\n carry >>= 26;\n carry += (w / 0x4000000) | 0;\n // NOTE: lo is 27bit maximum\n carry += lo >>> 26;\n this.words[i] = lo & 0x3ffffff;\n }\n\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n\n return this;\n };\n\n BN.prototype.muln = function muln (num) {\n return this.clone().imuln(num);\n };\n\n // `this` * `this`\n BN.prototype.sqr = function sqr () {\n return this.mul(this);\n };\n\n // `this` * `this` in-place\n BN.prototype.isqr = function isqr () {\n return this.imul(this.clone());\n };\n\n // Math.pow(`this`, `num`)\n BN.prototype.pow = function pow (num) {\n var w = toBitArray(num);\n if (w.length === 0) return new BN(1);\n\n // Skip leading zeroes\n var res = this;\n for (var i = 0; i < w.length; i++, res = res.sqr()) {\n if (w[i] !== 0) break;\n }\n\n if (++i < w.length) {\n for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {\n if (w[i] === 0) continue;\n\n res = res.mul(q);\n }\n }\n\n return res;\n };\n\n // Shift-left in-place\n BN.prototype.iushln = function iushln (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);\n var i;\n\n if (r !== 0) {\n var carry = 0;\n\n for (i = 0; i < this.length; i++) {\n var newCarry = this.words[i] & carryMask;\n var c = ((this.words[i] | 0) - newCarry) << r;\n this.words[i] = c | carry;\n carry = newCarry >>> (26 - r);\n }\n\n if (carry) {\n this.words[i] = carry;\n this.length++;\n }\n }\n\n if (s !== 0) {\n for (i = this.length - 1; i >= 0; i--) {\n this.words[i + s] = this.words[i];\n }\n\n for (i = 0; i < s; i++) {\n this.words[i] = 0;\n }\n\n this.length += s;\n }\n\n return this.strip();\n };\n\n BN.prototype.ishln = function ishln (bits) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushln(bits);\n };\n\n // Shift-right in-place\n // NOTE: `hint` is a lowest bit before trailing zeroes\n // NOTE: if `extended` is present - it will be filled with destroyed bits\n BN.prototype.iushrn = function iushrn (bits, hint, extended) {\n assert(typeof bits === 'number' && bits >= 0);\n var h;\n if (hint) {\n h = (hint - (hint % 26)) / 26;\n } else {\n h = 0;\n }\n\n var r = bits % 26;\n var s = Math.min((bits - r) / 26, this.length);\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n var maskedWords = extended;\n\n h -= s;\n h = Math.max(0, h);\n\n // Extended mode, copy masked part\n if (maskedWords) {\n for (var i = 0; i < s; i++) {\n maskedWords.words[i] = this.words[i];\n }\n maskedWords.length = s;\n }\n\n if (s === 0) {\n // No-op, we should not move anything at all\n } else if (this.length > s) {\n this.length -= s;\n for (i = 0; i < this.length; i++) {\n this.words[i] = this.words[i + s];\n }\n } else {\n this.words[0] = 0;\n this.length = 1;\n }\n\n var carry = 0;\n for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {\n var word = this.words[i] | 0;\n this.words[i] = (carry << (26 - r)) | (word >>> r);\n carry = word & mask;\n }\n\n // Push carried bits as a mask\n if (maskedWords && carry !== 0) {\n maskedWords.words[maskedWords.length++] = carry;\n }\n\n if (this.length === 0) {\n this.words[0] = 0;\n this.length = 1;\n }\n\n return this.strip();\n };\n\n BN.prototype.ishrn = function ishrn (bits, hint, extended) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushrn(bits, hint, extended);\n };\n\n // Shift-left\n BN.prototype.shln = function shln (bits) {\n return this.clone().ishln(bits);\n };\n\n BN.prototype.ushln = function ushln (bits) {\n return this.clone().iushln(bits);\n };\n\n // Shift-right\n BN.prototype.shrn = function shrn (bits) {\n return this.clone().ishrn(bits);\n };\n\n BN.prototype.ushrn = function ushrn (bits) {\n return this.clone().iushrn(bits);\n };\n\n // Test if n bit is set\n BN.prototype.testn = function testn (bit) {\n assert(typeof bit === 'number' && bit >= 0);\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) return false;\n\n // Check bit and return\n var w = this.words[s];\n\n return !!(w & q);\n };\n\n // Return only lowers bits of number (in-place)\n BN.prototype.imaskn = function imaskn (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n\n assert(this.negative === 0, 'imaskn works only with positive numbers');\n\n if (this.length <= s) {\n return this;\n }\n\n if (r !== 0) {\n s++;\n }\n this.length = Math.min(s, this.length);\n\n if (r !== 0) {\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n this.words[this.length - 1] &= mask;\n }\n\n return this.strip();\n };\n\n // Return only lowers bits of number\n BN.prototype.maskn = function maskn (bits) {\n return this.clone().imaskn(bits);\n };\n\n // Add plain number `num` to `this`\n BN.prototype.iaddn = function iaddn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.isubn(-num);\n\n // Possible sign change\n if (this.negative !== 0) {\n if (this.length === 1 && (this.words[0] | 0) < num) {\n this.words[0] = num - (this.words[0] | 0);\n this.negative = 0;\n return this;\n }\n\n this.negative = 0;\n this.isubn(num);\n this.negative = 1;\n return this;\n }\n\n // Add without checks\n return this._iaddn(num);\n };\n\n BN.prototype._iaddn = function _iaddn (num) {\n this.words[0] += num;\n\n // Carry\n for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {\n this.words[i] -= 0x4000000;\n if (i === this.length - 1) {\n this.words[i + 1] = 1;\n } else {\n this.words[i + 1]++;\n }\n }\n this.length = Math.max(this.length, i + 1);\n\n return this;\n };\n\n // Subtract plain number `num` from `this`\n BN.prototype.isubn = function isubn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.iaddn(-num);\n\n if (this.negative !== 0) {\n this.negative = 0;\n this.iaddn(num);\n this.negative = 1;\n return this;\n }\n\n this.words[0] -= num;\n\n if (this.length === 1 && this.words[0] < 0) {\n this.words[0] = -this.words[0];\n this.negative = 1;\n } else {\n // Carry\n for (var i = 0; i < this.length && this.words[i] < 0; i++) {\n this.words[i] += 0x4000000;\n this.words[i + 1] -= 1;\n }\n }\n\n return this.strip();\n };\n\n BN.prototype.addn = function addn (num) {\n return this.clone().iaddn(num);\n };\n\n BN.prototype.subn = function subn (num) {\n return this.clone().isubn(num);\n };\n\n BN.prototype.iabs = function iabs () {\n this.negative = 0;\n\n return this;\n };\n\n BN.prototype.abs = function abs () {\n return this.clone().iabs();\n };\n\n BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {\n var len = num.length + shift;\n var i;\n\n this._expand(len);\n\n var w;\n var carry = 0;\n for (i = 0; i < num.length; i++) {\n w = (this.words[i + shift] | 0) + carry;\n var right = (num.words[i] | 0) * mul;\n w -= right & 0x3ffffff;\n carry = (w >> 26) - ((right / 0x4000000) | 0);\n this.words[i + shift] = w & 0x3ffffff;\n }\n for (; i < this.length - shift; i++) {\n w = (this.words[i + shift] | 0) + carry;\n carry = w >> 26;\n this.words[i + shift] = w & 0x3ffffff;\n }\n\n if (carry === 0) return this.strip();\n\n // Subtraction overflow\n assert(carry === -1);\n carry = 0;\n for (i = 0; i < this.length; i++) {\n w = -(this.words[i] | 0) + carry;\n carry = w >> 26;\n this.words[i] = w & 0x3ffffff;\n }\n this.negative = 1;\n\n return this.strip();\n };\n\n BN.prototype._wordDiv = function _wordDiv (num, mode) {\n var shift = this.length - num.length;\n\n var a = this.clone();\n var b = num;\n\n // Normalize\n var bhi = b.words[b.length - 1] | 0;\n var bhiBits = this._countBits(bhi);\n shift = 26 - bhiBits;\n if (shift !== 0) {\n b = b.ushln(shift);\n a.iushln(shift);\n bhi = b.words[b.length - 1] | 0;\n }\n\n // Initialize quotient\n var m = a.length - b.length;\n var q;\n\n if (mode !== 'mod') {\n q = new BN(null);\n q.length = m + 1;\n q.words = new Array(q.length);\n for (var i = 0; i < q.length; i++) {\n q.words[i] = 0;\n }\n }\n\n var diff = a.clone()._ishlnsubmul(b, 1, m);\n if (diff.negative === 0) {\n a = diff;\n if (q) {\n q.words[m] = 1;\n }\n }\n\n for (var j = m - 1; j >= 0; j--) {\n var qj = (a.words[b.length + j] | 0) * 0x4000000 +\n (a.words[b.length + j - 1] | 0);\n\n // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max\n // (0x7ffffff)\n qj = Math.min((qj / bhi) | 0, 0x3ffffff);\n\n a._ishlnsubmul(b, qj, j);\n while (a.negative !== 0) {\n qj--;\n a.negative = 0;\n a._ishlnsubmul(b, 1, j);\n if (!a.isZero()) {\n a.negative ^= 1;\n }\n }\n if (q) {\n q.words[j] = qj;\n }\n }\n if (q) {\n q.strip();\n }\n a.strip();\n\n // Denormalize\n if (mode !== 'div' && shift !== 0) {\n a.iushrn(shift);\n }\n\n return {\n div: q || null,\n mod: a\n };\n };\n\n // NOTE: 1) `mode` can be set to `mod` to request mod only,\n // to `div` to request div only, or be absent to\n // request both div & mod\n // 2) `positive` is true if unsigned mod is requested\n BN.prototype.divmod = function divmod (num, mode, positive) {\n assert(!num.isZero());\n\n if (this.isZero()) {\n return {\n div: new BN(0),\n mod: new BN(0)\n };\n }\n\n var div, mod, res;\n if (this.negative !== 0 && num.negative === 0) {\n res = this.neg().divmod(num, mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.iadd(num);\n }\n }\n\n return {\n div: div,\n mod: mod\n };\n }\n\n if (this.negative === 0 && num.negative !== 0) {\n res = this.divmod(num.neg(), mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n return {\n div: div,\n mod: res.mod\n };\n }\n\n if ((this.negative & num.negative) !== 0) {\n res = this.neg().divmod(num.neg(), mode);\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.isub(num);\n }\n }\n\n return {\n div: res.div,\n mod: mod\n };\n }\n\n // Both numbers are positive at this point\n\n // Strip both numbers to approximate shift value\n if (num.length > this.length || this.cmp(num) < 0) {\n return {\n div: new BN(0),\n mod: this\n };\n }\n\n // Very short reduction\n if (num.length === 1) {\n if (mode === 'div') {\n return {\n div: this.divn(num.words[0]),\n mod: null\n };\n }\n\n if (mode === 'mod') {\n return {\n div: null,\n mod: new BN(this.modn(num.words[0]))\n };\n }\n\n return {\n div: this.divn(num.words[0]),\n mod: new BN(this.modn(num.words[0]))\n };\n }\n\n return this._wordDiv(num, mode);\n };\n\n // Find `this` / `num`\n BN.prototype.div = function div (num) {\n return this.divmod(num, 'div', false).div;\n };\n\n // Find `this` % `num`\n BN.prototype.mod = function mod (num) {\n return this.divmod(num, 'mod', false).mod;\n };\n\n BN.prototype.umod = function umod (num) {\n return this.divmod(num, 'mod', true).mod;\n };\n\n // Find Round(`this` / `num`)\n BN.prototype.divRound = function divRound (num) {\n var dm = this.divmod(num);\n\n // Fast case - exact division\n if (dm.mod.isZero()) return dm.div;\n\n var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;\n\n var half = num.ushrn(1);\n var r2 = num.andln(1);\n var cmp = mod.cmp(half);\n\n // Round down\n if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;\n\n // Round up\n return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);\n };\n\n BN.prototype.modn = function modn (num) {\n assert(num <= 0x3ffffff);\n var p = (1 << 26) % num;\n\n var acc = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n acc = (p * acc + (this.words[i] | 0)) % num;\n }\n\n return acc;\n };\n\n // In-place division by number\n BN.prototype.idivn = function idivn (num) {\n assert(num <= 0x3ffffff);\n\n var carry = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var w = (this.words[i] | 0) + carry * 0x4000000;\n this.words[i] = (w / num) | 0;\n carry = w % num;\n }\n\n return this.strip();\n };\n\n BN.prototype.divn = function divn (num) {\n return this.clone().idivn(num);\n };\n\n BN.prototype.egcd = function egcd (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var x = this;\n var y = p.clone();\n\n if (x.negative !== 0) {\n x = x.umod(p);\n } else {\n x = x.clone();\n }\n\n // A * x + B * y = x\n var A = new BN(1);\n var B = new BN(0);\n\n // C * x + D * y = y\n var C = new BN(0);\n var D = new BN(1);\n\n var g = 0;\n\n while (x.isEven() && y.isEven()) {\n x.iushrn(1);\n y.iushrn(1);\n ++g;\n }\n\n var yp = y.clone();\n var xp = x.clone();\n\n while (!x.isZero()) {\n for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n x.iushrn(i);\n while (i-- > 0) {\n if (A.isOdd() || B.isOdd()) {\n A.iadd(yp);\n B.isub(xp);\n }\n\n A.iushrn(1);\n B.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n y.iushrn(j);\n while (j-- > 0) {\n if (C.isOdd() || D.isOdd()) {\n C.iadd(yp);\n D.isub(xp);\n }\n\n C.iushrn(1);\n D.iushrn(1);\n }\n }\n\n if (x.cmp(y) >= 0) {\n x.isub(y);\n A.isub(C);\n B.isub(D);\n } else {\n y.isub(x);\n C.isub(A);\n D.isub(B);\n }\n }\n\n return {\n a: C,\n b: D,\n gcd: y.iushln(g)\n };\n };\n\n // This is reduced incarnation of the binary EEA\n // above, designated to invert members of the\n // _prime_ fields F(p) at a maximal speed\n BN.prototype._invmp = function _invmp (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var a = this;\n var b = p.clone();\n\n if (a.negative !== 0) {\n a = a.umod(p);\n } else {\n a = a.clone();\n }\n\n var x1 = new BN(1);\n var x2 = new BN(0);\n\n var delta = b.clone();\n\n while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {\n for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n a.iushrn(i);\n while (i-- > 0) {\n if (x1.isOdd()) {\n x1.iadd(delta);\n }\n\n x1.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n b.iushrn(j);\n while (j-- > 0) {\n if (x2.isOdd()) {\n x2.iadd(delta);\n }\n\n x2.iushrn(1);\n }\n }\n\n if (a.cmp(b) >= 0) {\n a.isub(b);\n x1.isub(x2);\n } else {\n b.isub(a);\n x2.isub(x1);\n }\n }\n\n var res;\n if (a.cmpn(1) === 0) {\n res = x1;\n } else {\n res = x2;\n }\n\n if (res.cmpn(0) < 0) {\n res.iadd(p);\n }\n\n return res;\n };\n\n BN.prototype.gcd = function gcd (num) {\n if (this.isZero()) return num.abs();\n if (num.isZero()) return this.abs();\n\n var a = this.clone();\n var b = num.clone();\n a.negative = 0;\n b.negative = 0;\n\n // Remove common factor of two\n for (var shift = 0; a.isEven() && b.isEven(); shift++) {\n a.iushrn(1);\n b.iushrn(1);\n }\n\n do {\n while (a.isEven()) {\n a.iushrn(1);\n }\n while (b.isEven()) {\n b.iushrn(1);\n }\n\n var r = a.cmp(b);\n if (r < 0) {\n // Swap `a` and `b` to make `a` always bigger than `b`\n var t = a;\n a = b;\n b = t;\n } else if (r === 0 || b.cmpn(1) === 0) {\n break;\n }\n\n a.isub(b);\n } while (true);\n\n return b.iushln(shift);\n };\n\n // Invert number in the field F(num)\n BN.prototype.invm = function invm (num) {\n return this.egcd(num).a.umod(num);\n };\n\n BN.prototype.isEven = function isEven () {\n return (this.words[0] & 1) === 0;\n };\n\n BN.prototype.isOdd = function isOdd () {\n return (this.words[0] & 1) === 1;\n };\n\n // And first word and num\n BN.prototype.andln = function andln (num) {\n return this.words[0] & num;\n };\n\n // Increment at the bit position in-line\n BN.prototype.bincn = function bincn (bit) {\n assert(typeof bit === 'number');\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) {\n this._expand(s + 1);\n this.words[s] |= q;\n return this;\n }\n\n // Add bit and propagate, if needed\n var carry = q;\n for (var i = s; carry !== 0 && i < this.length; i++) {\n var w = this.words[i] | 0;\n w += carry;\n carry = w >>> 26;\n w &= 0x3ffffff;\n this.words[i] = w;\n }\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n return this;\n };\n\n BN.prototype.isZero = function isZero () {\n return this.length === 1 && this.words[0] === 0;\n };\n\n BN.prototype.cmpn = function cmpn (num) {\n var negative = num < 0;\n\n if (this.negative !== 0 && !negative) return -1;\n if (this.negative === 0 && negative) return 1;\n\n this.strip();\n\n var res;\n if (this.length > 1) {\n res = 1;\n } else {\n if (negative) {\n num = -num;\n }\n\n assert(num <= 0x3ffffff, 'Number is too big');\n\n var w = this.words[0] | 0;\n res = w === num ? 0 : w < num ? -1 : 1;\n }\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Compare two numbers and return:\n // 1 - if `this` > `num`\n // 0 - if `this` == `num`\n // -1 - if `this` < `num`\n BN.prototype.cmp = function cmp (num) {\n if (this.negative !== 0 && num.negative === 0) return -1;\n if (this.negative === 0 && num.negative !== 0) return 1;\n\n var res = this.ucmp(num);\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Unsigned comparison\n BN.prototype.ucmp = function ucmp (num) {\n // At this point both numbers have the same sign\n if (this.length > num.length) return 1;\n if (this.length < num.length) return -1;\n\n var res = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var a = this.words[i] | 0;\n var b = num.words[i] | 0;\n\n if (a === b) continue;\n if (a < b) {\n res = -1;\n } else if (a > b) {\n res = 1;\n }\n break;\n }\n return res;\n };\n\n BN.prototype.gtn = function gtn (num) {\n return this.cmpn(num) === 1;\n };\n\n BN.prototype.gt = function gt (num) {\n return this.cmp(num) === 1;\n };\n\n BN.prototype.gten = function gten (num) {\n return this.cmpn(num) >= 0;\n };\n\n BN.prototype.gte = function gte (num) {\n return this.cmp(num) >= 0;\n };\n\n BN.prototype.ltn = function ltn (num) {\n return this.cmpn(num) === -1;\n };\n\n BN.prototype.lt = function lt (num) {\n return this.cmp(num) === -1;\n };\n\n BN.prototype.lten = function lten (num) {\n return this.cmpn(num) <= 0;\n };\n\n BN.prototype.lte = function lte (num) {\n return this.cmp(num) <= 0;\n };\n\n BN.prototype.eqn = function eqn (num) {\n return this.cmpn(num) === 0;\n };\n\n BN.prototype.eq = function eq (num) {\n return this.cmp(num) === 0;\n };\n\n //\n // A reduce context, could be using montgomery or something better, depending\n // on the `m` itself.\n //\n BN.red = function red (num) {\n return new Red(num);\n };\n\n BN.prototype.toRed = function toRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n assert(this.negative === 0, 'red works only with positives');\n return ctx.convertTo(this)._forceRed(ctx);\n };\n\n BN.prototype.fromRed = function fromRed () {\n assert(this.red, 'fromRed works only with numbers in reduction context');\n return this.red.convertFrom(this);\n };\n\n BN.prototype._forceRed = function _forceRed (ctx) {\n this.red = ctx;\n return this;\n };\n\n BN.prototype.forceRed = function forceRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n return this._forceRed(ctx);\n };\n\n BN.prototype.redAdd = function redAdd (num) {\n assert(this.red, 'redAdd works only with red numbers');\n return this.red.add(this, num);\n };\n\n BN.prototype.redIAdd = function redIAdd (num) {\n assert(this.red, 'redIAdd works only with red numbers');\n return this.red.iadd(this, num);\n };\n\n BN.prototype.redSub = function redSub (num) {\n assert(this.red, 'redSub works only with red numbers');\n return this.red.sub(this, num);\n };\n\n BN.prototype.redISub = function redISub (num) {\n assert(this.red, 'redISub works only with red numbers');\n return this.red.isub(this, num);\n };\n\n BN.prototype.redShl = function redShl (num) {\n assert(this.red, 'redShl works only with red numbers');\n return this.red.shl(this, num);\n };\n\n BN.prototype.redMul = function redMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.mul(this, num);\n };\n\n BN.prototype.redIMul = function redIMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.imul(this, num);\n };\n\n BN.prototype.redSqr = function redSqr () {\n assert(this.red, 'redSqr works only with red numbers');\n this.red._verify1(this);\n return this.red.sqr(this);\n };\n\n BN.prototype.redISqr = function redISqr () {\n assert(this.red, 'redISqr works only with red numbers');\n this.red._verify1(this);\n return this.red.isqr(this);\n };\n\n // Square root over p\n BN.prototype.redSqrt = function redSqrt () {\n assert(this.red, 'redSqrt works only with red numbers');\n this.red._verify1(this);\n return this.red.sqrt(this);\n };\n\n BN.prototype.redInvm = function redInvm () {\n assert(this.red, 'redInvm works only with red numbers');\n this.red._verify1(this);\n return this.red.invm(this);\n };\n\n // Return negative clone of `this` % `red modulo`\n BN.prototype.redNeg = function redNeg () {\n assert(this.red, 'redNeg works only with red numbers');\n this.red._verify1(this);\n return this.red.neg(this);\n };\n\n BN.prototype.redPow = function redPow (num) {\n assert(this.red && !num.red, 'redPow(normalNum)');\n this.red._verify1(this);\n return this.red.pow(this, num);\n };\n\n // Prime numbers with efficient reduction\n var primes = {\n k256: null,\n p224: null,\n p192: null,\n p25519: null\n };\n\n // Pseudo-Mersenne prime\n function MPrime (name, p) {\n // P = 2 ^ N - K\n this.name = name;\n this.p = new BN(p, 16);\n this.n = this.p.bitLength();\n this.k = new BN(1).iushln(this.n).isub(this.p);\n\n this.tmp = this._tmp();\n }\n\n MPrime.prototype._tmp = function _tmp () {\n var tmp = new BN(null);\n tmp.words = new Array(Math.ceil(this.n / 13));\n return tmp;\n };\n\n MPrime.prototype.ireduce = function ireduce (num) {\n // Assumes that `num` is less than `P^2`\n // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)\n var r = num;\n var rlen;\n\n do {\n this.split(r, this.tmp);\n r = this.imulK(r);\n r = r.iadd(this.tmp);\n rlen = r.bitLength();\n } while (rlen > this.n);\n\n var cmp = rlen < this.n ? -1 : r.ucmp(this.p);\n if (cmp === 0) {\n r.words[0] = 0;\n r.length = 1;\n } else if (cmp > 0) {\n r.isub(this.p);\n } else {\n r.strip();\n }\n\n return r;\n };\n\n MPrime.prototype.split = function split (input, out) {\n input.iushrn(this.n, 0, out);\n };\n\n MPrime.prototype.imulK = function imulK (num) {\n return num.imul(this.k);\n };\n\n function K256 () {\n MPrime.call(\n this,\n 'k256',\n 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');\n }\n inherits(K256, MPrime);\n\n K256.prototype.split = function split (input, output) {\n // 256 = 9 * 26 + 22\n var mask = 0x3fffff;\n\n var outLen = Math.min(input.length, 9);\n for (var i = 0; i < outLen; i++) {\n output.words[i] = input.words[i];\n }\n output.length = outLen;\n\n if (input.length <= 9) {\n input.words[0] = 0;\n input.length = 1;\n return;\n }\n\n // Shift by 9 limbs\n var prev = input.words[9];\n output.words[output.length++] = prev & mask;\n\n for (i = 10; i < input.length; i++) {\n var next = input.words[i] | 0;\n input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\n prev = next;\n }\n prev >>>= 22;\n input.words[i - 10] = prev;\n if (prev === 0 && input.length > 10) {\n input.length -= 10;\n } else {\n input.length -= 9;\n }\n };\n\n K256.prototype.imulK = function imulK (num) {\n // K = 0x1000003d1 = [ 0x40, 0x3d1 ]\n num.words[num.length] = 0;\n num.words[num.length + 1] = 0;\n num.length += 2;\n\n // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\n var lo = 0;\n for (var i = 0; i < num.length; i++) {\n var w = num.words[i] | 0;\n lo += w * 0x3d1;\n num.words[i] = lo & 0x3ffffff;\n lo = w * 0x40 + ((lo / 0x4000000) | 0);\n }\n\n // Fast length reduction\n if (num.words[num.length - 1] === 0) {\n num.length--;\n if (num.words[num.length - 1] === 0) {\n num.length--;\n }\n }\n return num;\n };\n\n function P224 () {\n MPrime.call(\n this,\n 'p224',\n 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');\n }\n inherits(P224, MPrime);\n\n function P192 () {\n MPrime.call(\n this,\n 'p192',\n 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');\n }\n inherits(P192, MPrime);\n\n function P25519 () {\n // 2 ^ 255 - 19\n MPrime.call(\n this,\n '25519',\n '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');\n }\n inherits(P25519, MPrime);\n\n P25519.prototype.imulK = function imulK (num) {\n // K = 0x13\n var carry = 0;\n for (var i = 0; i < num.length; i++) {\n var hi = (num.words[i] | 0) * 0x13 + carry;\n var lo = hi & 0x3ffffff;\n hi >>>= 26;\n\n num.words[i] = lo;\n carry = hi;\n }\n if (carry !== 0) {\n num.words[num.length++] = carry;\n }\n return num;\n };\n\n // Exported mostly for testing purposes, use plain name instead\n BN._prime = function prime (name) {\n // Cached version of prime\n if (primes[name]) return primes[name];\n\n var prime;\n if (name === 'k256') {\n prime = new K256();\n } else if (name === 'p224') {\n prime = new P224();\n } else if (name === 'p192') {\n prime = new P192();\n } else if (name === 'p25519') {\n prime = new P25519();\n } else {\n throw new Error('Unknown prime ' + name);\n }\n primes[name] = prime;\n\n return prime;\n };\n\n //\n // Base reduction engine\n //\n function Red (m) {\n if (typeof m === 'string') {\n var prime = BN._prime(m);\n this.m = prime.p;\n this.prime = prime;\n } else {\n assert(m.gtn(1), 'modulus must be greater than 1');\n this.m = m;\n this.prime = null;\n }\n }\n\n Red.prototype._verify1 = function _verify1 (a) {\n assert(a.negative === 0, 'red works only with positives');\n assert(a.red, 'red works only with red numbers');\n };\n\n Red.prototype._verify2 = function _verify2 (a, b) {\n assert((a.negative | b.negative) === 0, 'red works only with positives');\n assert(a.red && a.red === b.red,\n 'red works only with red numbers');\n };\n\n Red.prototype.imod = function imod (a) {\n if (this.prime) return this.prime.ireduce(a)._forceRed(this);\n return a.umod(this.m)._forceRed(this);\n };\n\n Red.prototype.neg = function neg (a) {\n if (a.isZero()) {\n return a.clone();\n }\n\n return this.m.sub(a)._forceRed(this);\n };\n\n Red.prototype.add = function add (a, b) {\n this._verify2(a, b);\n\n var res = a.add(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.iadd = function iadd (a, b) {\n this._verify2(a, b);\n\n var res = a.iadd(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res;\n };\n\n Red.prototype.sub = function sub (a, b) {\n this._verify2(a, b);\n\n var res = a.sub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.isub = function isub (a, b) {\n this._verify2(a, b);\n\n var res = a.isub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res;\n };\n\n Red.prototype.shl = function shl (a, num) {\n this._verify1(a);\n return this.imod(a.ushln(num));\n };\n\n Red.prototype.imul = function imul (a, b) {\n this._verify2(a, b);\n return this.imod(a.imul(b));\n };\n\n Red.prototype.mul = function mul (a, b) {\n this._verify2(a, b);\n return this.imod(a.mul(b));\n };\n\n Red.prototype.isqr = function isqr (a) {\n return this.imul(a, a.clone());\n };\n\n Red.prototype.sqr = function sqr (a) {\n return this.mul(a, a);\n };\n\n Red.prototype.sqrt = function sqrt (a) {\n if (a.isZero()) return a.clone();\n\n var mod3 = this.m.andln(3);\n assert(mod3 % 2 === 1);\n\n // Fast case\n if (mod3 === 3) {\n var pow = this.m.add(new BN(1)).iushrn(2);\n return this.pow(a, pow);\n }\n\n // Tonelli-Shanks algorithm (Totally unoptimized and slow)\n //\n // Find Q and S, that Q * 2 ^ S = (P - 1)\n var q = this.m.subn(1);\n var s = 0;\n while (!q.isZero() && q.andln(1) === 0) {\n s++;\n q.iushrn(1);\n }\n assert(!q.isZero());\n\n var one = new BN(1).toRed(this);\n var nOne = one.redNeg();\n\n // Find quadratic non-residue\n // NOTE: Max is such because of generalized Riemann hypothesis.\n var lpow = this.m.subn(1).iushrn(1);\n var z = this.m.bitLength();\n z = new BN(2 * z * z).toRed(this);\n\n while (this.pow(z, lpow).cmp(nOne) !== 0) {\n z.redIAdd(nOne);\n }\n\n var c = this.pow(z, q);\n var r = this.pow(a, q.addn(1).iushrn(1));\n var t = this.pow(a, q);\n var m = s;\n while (t.cmp(one) !== 0) {\n var tmp = t;\n for (var i = 0; tmp.cmp(one) !== 0; i++) {\n tmp = tmp.redSqr();\n }\n assert(i < m);\n var b = this.pow(c, new BN(1).iushln(m - i - 1));\n\n r = r.redMul(b);\n c = b.redSqr();\n t = t.redMul(c);\n m = i;\n }\n\n return r;\n };\n\n Red.prototype.invm = function invm (a) {\n var inv = a._invmp(this.m);\n if (inv.negative !== 0) {\n inv.negative = 0;\n return this.imod(inv).redNeg();\n } else {\n return this.imod(inv);\n }\n };\n\n Red.prototype.pow = function pow (a, num) {\n if (num.isZero()) return new BN(1);\n if (num.cmpn(1) === 0) return a.clone();\n\n var windowSize = 4;\n var wnd = new Array(1 << windowSize);\n wnd[0] = new BN(1).toRed(this);\n wnd[1] = a;\n for (var i = 2; i < wnd.length; i++) {\n wnd[i] = this.mul(wnd[i - 1], a);\n }\n\n var res = wnd[0];\n var current = 0;\n var currentLen = 0;\n var start = num.bitLength() % 26;\n if (start === 0) {\n start = 26;\n }\n\n for (i = num.length - 1; i >= 0; i--) {\n var word = num.words[i];\n for (var j = start - 1; j >= 0; j--) {\n var bit = (word >> j) & 1;\n if (res !== wnd[0]) {\n res = this.sqr(res);\n }\n\n if (bit === 0 && current === 0) {\n currentLen = 0;\n continue;\n }\n\n current <<= 1;\n current |= bit;\n currentLen++;\n if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;\n\n res = this.mul(res, wnd[current]);\n currentLen = 0;\n current = 0;\n }\n start = 26;\n }\n\n return res;\n };\n\n Red.prototype.convertTo = function convertTo (num) {\n var r = num.umod(this.m);\n\n return r === num ? r.clone() : r;\n };\n\n Red.prototype.convertFrom = function convertFrom (num) {\n var res = num.clone();\n res.red = null;\n return res;\n };\n\n //\n // Montgomery method engine\n //\n\n BN.mont = function mont (num) {\n return new Mont(num);\n };\n\n function Mont (m) {\n Red.call(this, m);\n\n this.shift = this.m.bitLength();\n if (this.shift % 26 !== 0) {\n this.shift += 26 - (this.shift % 26);\n }\n\n this.r = new BN(1).iushln(this.shift);\n this.r2 = this.imod(this.r.sqr());\n this.rinv = this.r._invmp(this.m);\n\n this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);\n this.minv = this.minv.umod(this.r);\n this.minv = this.r.sub(this.minv);\n }\n inherits(Mont, Red);\n\n Mont.prototype.convertTo = function convertTo (num) {\n return this.imod(num.ushln(this.shift));\n };\n\n Mont.prototype.convertFrom = function convertFrom (num) {\n var r = this.imod(num.mul(this.rinv));\n r.red = null;\n return r;\n };\n\n Mont.prototype.imul = function imul (a, b) {\n if (a.isZero() || b.isZero()) {\n a.words[0] = 0;\n a.length = 1;\n return a;\n }\n\n var t = a.imul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.mul = function mul (a, b) {\n if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);\n\n var t = a.mul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.invm = function invm (a) {\n // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\n var res = this.imod(a._invmp(this.m).mul(this.r2));\n return res._forceRed(this);\n };\n})(typeof module === 'undefined' || module, this);\n","var BN = require('bn.js');\nvar stripHexPrefix = require('strip-hex-prefix');\n\n/**\n * Returns a BN object, converts a number value to a BN\n * @param {String|Number|Object} `arg` input a string number, hex string number, number, BigNumber or BN object\n * @return {Object} `output` BN object of the number\n * @throws if the argument is not an array, object that isn't a bignumber, not a string number or number\n */\nmodule.exports = function numberToBN(arg) {\n if (typeof arg === 'string' || typeof arg === 'number') {\n var multiplier = new BN(1); // eslint-disable-line\n var formattedString = String(arg).toLowerCase().trim();\n var isHexPrefixed = formattedString.substr(0, 2) === '0x' || formattedString.substr(0, 3) === '-0x';\n var stringArg = stripHexPrefix(formattedString); // eslint-disable-line\n if (stringArg.substr(0, 1) === '-') {\n stringArg = stripHexPrefix(stringArg.slice(1));\n multiplier = new BN(-1, 10);\n }\n stringArg = stringArg === '' ? '0' : stringArg;\n\n if ((!stringArg.match(/^-?[0-9]+$/) && stringArg.match(/^[0-9A-Fa-f]+$/))\n || stringArg.match(/^[a-fA-F]+$/)\n || (isHexPrefixed === true && stringArg.match(/^[0-9A-Fa-f]+$/))) {\n return new BN(stringArg, 16).mul(multiplier);\n }\n\n if ((stringArg.match(/^-?[0-9]+$/) || stringArg === '') && isHexPrefixed === false) {\n return new BN(stringArg, 10).mul(multiplier);\n }\n } else if (typeof arg === 'object' && arg.toString && (!arg.pop && !arg.push)) {\n if (arg.toString(10).match(/^-?[0-9]+$/) && (arg.mul || arg.dividedToIntegerBy)) {\n return new BN(arg.toString(10), 10);\n }\n }\n\n throw new Error('[number-to-bn] while converting number ' + JSON.stringify(arg) + ' to BN.js instance, error: invalid number value. Value must be an integer, hex string, BN or BigNumber instance. Note, decimals are not supported.');\n}\n","/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n","// This file is the concatenation of many js files.\n// See http://github.com/jimhigson/oboe.js for the raw source\n\n// having a local undefined, window, Object etc allows slightly better minification:\n(function (window, Object, Array, Error, JSON, undefined ) {\n\n // v2.1.3\n\n/*\n\nCopyright (c) 2013, Jim Higson\n\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n1. Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS\nIS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\nTO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\nPARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nHOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\nTO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n*/\n\n/** \n * Partially complete a function.\n * \n * var add3 = partialComplete( function add(a,b){return a+b}, 3 );\n * \n * add3(4) // gives 7\n * \n * function wrap(left, right, cen){return left + \" \" + cen + \" \" + right;}\n * \n * var pirateGreeting = partialComplete( wrap , \"I'm\", \", a mighty pirate!\" );\n * \n * pirateGreeting(\"Guybrush Threepwood\"); \n * // gives \"I'm Guybrush Threepwood, a mighty pirate!\"\n */\nvar partialComplete = varArgs(function( fn, args ) {\n\n // this isn't the shortest way to write this but it does\n // avoid creating a new array each time to pass to fn.apply,\n // otherwise could just call boundArgs.concat(callArgs) \n\n var numBoundArgs = args.length;\n\n return varArgs(function( callArgs ) {\n \n for (var i = 0; i < callArgs.length; i++) {\n args[numBoundArgs + i] = callArgs[i];\n }\n \n args.length = numBoundArgs + callArgs.length; \n \n return fn.apply(this, args);\n }); \n }),\n\n/**\n * Compose zero or more functions:\n * \n * compose(f1, f2, f3)(x) = f1(f2(f3(x))))\n * \n * The last (inner-most) function may take more than one parameter:\n * \n * compose(f1, f2, f3)(x,y) = f1(f2(f3(x,y))))\n */\n compose = varArgs(function(fns) {\n\n var fnsList = arrayAsList(fns);\n \n function next(params, curFn) { \n return [apply(params, curFn)]; \n }\n \n return varArgs(function(startParams){\n \n return foldR(next, startParams, fnsList)[0];\n });\n });\n\n/**\n * A more optimised version of compose that takes exactly two functions\n * @param f1\n * @param f2\n */\nfunction compose2(f1, f2){\n return function(){\n return f1.call(this,f2.apply(this,arguments));\n }\n}\n\n/**\n * Generic form for a function to get a property from an object\n * \n * var o = {\n * foo:'bar'\n * }\n * \n * var getFoo = attr('foo')\n * \n * fetFoo(o) // returns 'bar'\n * \n * @param {String} key the property name\n */\nfunction attr(key) {\n return function(o) { return o[key]; };\n}\n \n/**\n * Call a list of functions with the same args until one returns a \n * truthy result. Similar to the || operator.\n * \n * So:\n * lazyUnion([f1,f2,f3 ... fn])( p1, p2 ... pn )\n * \n * Is equivalent to: \n * apply([p1, p2 ... pn], f1) || \n * apply([p1, p2 ... pn], f2) || \n * apply([p1, p2 ... pn], f3) ... apply(fn, [p1, p2 ... pn]) \n * \n * @returns the first return value that is given that is truthy.\n */\n var lazyUnion = varArgs(function(fns) {\n\n return varArgs(function(params){\n \n var maybeValue;\n \n for (var i = 0; i < len(fns); i++) {\n \n maybeValue = apply(params, fns[i]);\n \n if( maybeValue ) {\n return maybeValue;\n }\n }\n });\n }); \n\n/**\n * This file declares various pieces of functional programming.\n * \n * This isn't a general purpose functional library, to keep things small it\n * has just the parts useful for Oboe.js.\n */\n\n\n/**\n * Call a single function with the given arguments array.\n * Basically, a functional-style version of the OO-style Function#apply for \n * when we don't care about the context ('this') of the call.\n * \n * The order of arguments allows partial completion of the arguments array\n */\nfunction apply(args, fn) {\n return fn.apply(undefined, args);\n}\n\n/**\n * Define variable argument functions but cut out all that tedious messing about \n * with the arguments object. Delivers the variable-length part of the arguments\n * list as an array.\n * \n * Eg:\n * \n * var myFunction = varArgs(\n * function( fixedArgument, otherFixedArgument, variableNumberOfArguments ){\n * console.log( variableNumberOfArguments );\n * }\n * )\n * \n * myFunction('a', 'b', 1, 2, 3); // logs [1,2,3]\n * \n * var myOtherFunction = varArgs(function( variableNumberOfArguments ){\n * console.log( variableNumberOfArguments );\n * })\n * \n * myFunction(1, 2, 3); // logs [1,2,3]\n * \n */\nfunction varArgs(fn){\n\n var numberOfFixedArguments = fn.length -1,\n slice = Array.prototype.slice; \n \n \n if( numberOfFixedArguments == 0 ) {\n // an optimised case for when there are no fixed args: \n \n return function(){\n return fn.call(this, slice.call(arguments));\n }\n \n } else if( numberOfFixedArguments == 1 ) {\n // an optimised case for when there are is one fixed args:\n \n return function(){\n return fn.call(this, arguments[0], slice.call(arguments, 1));\n }\n }\n \n // general case \n\n // we know how many arguments fn will always take. Create a\n // fixed-size array to hold that many, to be re-used on\n // every call to the returned function\n var argsHolder = Array(fn.length); \n \n return function(){\n \n for (var i = 0; i < numberOfFixedArguments; i++) {\n argsHolder[i] = arguments[i]; \n }\n\n argsHolder[numberOfFixedArguments] = \n slice.call(arguments, numberOfFixedArguments);\n \n return fn.apply( this, argsHolder); \n } \n}\n\n\n/**\n * Swap the order of parameters to a binary function\n * \n * A bit like this flip: http://zvon.org/other/haskell/Outputprelude/flip_f.html\n */\nfunction flip(fn){\n return function(a, b){\n return fn(b,a);\n }\n}\n\n\n/**\n * Create a function which is the intersection of two other functions.\n * \n * Like the && operator, if the first is truthy, the second is never called,\n * otherwise the return value from the second is returned.\n */\nfunction lazyIntersection(fn1, fn2) {\n\n return function (param) {\n \n return fn1(param) && fn2(param);\n }; \n}\n\n/**\n * A function which does nothing\n */\nfunction noop(){}\n\n/**\n * A function which is always happy\n */\nfunction always(){return true}\n\n/**\n * Create a function which always returns the same\n * value\n * \n * var return3 = functor(3);\n * \n * return3() // gives 3\n * return3() // still gives 3\n * return3() // will always give 3\n */\nfunction functor(val){\n return function(){\n return val;\n }\n}\n\n/**\n * This file defines some loosely associated syntactic sugar for \n * Javascript programming \n */\n\n\n/**\n * Returns true if the given candidate is of type T\n */\nfunction isOfType(T, maybeSomething){\n return maybeSomething && maybeSomething.constructor === T;\n}\n\nvar len = attr('length'), \n isString = partialComplete(isOfType, String);\n\n/** \n * I don't like saying this:\n * \n * foo !=== undefined\n * \n * because of the double-negative. I find this:\n * \n * defined(foo)\n * \n * easier to read.\n */ \nfunction defined( value ) {\n return value !== undefined;\n}\n\n/**\n * Returns true if object o has a key named like every property in \n * the properties array. Will give false if any are missing, or if o \n * is not an object.\n */\nfunction hasAllProperties(fieldList, o) {\n\n return (o instanceof Object) \n &&\n all(function (field) { \n return (field in o); \n }, fieldList);\n}\n/**\n * Like cons in Lisp\n */\nfunction cons(x, xs) {\n \n /* Internally lists are linked 2-element Javascript arrays.\n \n Ideally the return here would be Object.freeze([x,xs])\n so that bugs related to mutation are found fast.\n However, cons is right on the critical path for\n performance and this slows oboe-mark down by\n ~25%. Under theoretical future JS engines that freeze more\n efficiently (possibly even use immutability to\n run faster) this should be considered for\n restoration.\n */\n \n return [x,xs];\n}\n\n/**\n * The empty list\n */\nvar emptyList = null,\n\n/**\n * Get the head of a list.\n * \n * Ie, head(cons(a,b)) = a\n */\n head = attr(0),\n\n/**\n * Get the tail of a list.\n * \n * Ie, tail(cons(a,b)) = b\n */\n tail = attr(1);\n\n\n/** \n * Converts an array to a list \n * \n * asList([a,b,c])\n * \n * is equivalent to:\n * \n * cons(a, cons(b, cons(c, emptyList))) \n **/\nfunction arrayAsList(inputArray){\n\n return reverseList( \n inputArray.reduce(\n flip(cons),\n emptyList \n )\n );\n}\n\n/**\n * A varargs version of arrayAsList. Works a bit like list\n * in LISP.\n * \n * list(a,b,c) \n * \n * is equivalent to:\n * \n * cons(a, cons(b, cons(c, emptyList)))\n */\nvar list = varArgs(arrayAsList);\n\n/**\n * Convert a list back to a js native array\n */\nfunction listAsArray(list){\n\n return foldR( function(arraySoFar, listItem){\n \n arraySoFar.unshift(listItem);\n return arraySoFar;\n \n }, [], list );\n \n}\n\n/**\n * Map a function over a list \n */\nfunction map(fn, list) {\n\n return list\n ? cons(fn(head(list)), map(fn,tail(list)))\n : emptyList\n ;\n}\n\n/**\n * foldR implementation. Reduce a list down to a single value.\n * \n * @pram {Function} fn (rightEval, curVal) -> result \n */\nfunction foldR(fn, startValue, list) {\n \n return list \n ? fn(foldR(fn, startValue, tail(list)), head(list))\n : startValue\n ;\n}\n\n/**\n * foldR implementation. Reduce a list down to a single value.\n * \n * @pram {Function} fn (rightEval, curVal) -> result \n */\nfunction foldR1(fn, list) {\n \n return tail(list) \n ? fn(foldR1(fn, tail(list)), head(list))\n : head(list)\n ;\n}\n\n\n/**\n * Return a list like the one given but with the first instance equal \n * to item removed \n */\nfunction without(list, test, removedFn) {\n \n return withoutInner(list, removedFn || noop);\n \n function withoutInner(subList, removedFn) {\n return subList \n ? ( test(head(subList)) \n ? (removedFn(head(subList)), tail(subList)) \n : cons(head(subList), withoutInner(tail(subList), removedFn))\n )\n : emptyList\n ;\n } \n}\n\n/** \n * Returns true if the given function holds for every item in \n * the list, false otherwise \n */\nfunction all(fn, list) {\n \n return !list || \n ( fn(head(list)) && all(fn, tail(list)) );\n}\n\n/**\n * Call every function in a list of functions with the same arguments\n * \n * This doesn't make any sense if we're doing pure functional because \n * it doesn't return anything. Hence, this is only really useful if the\n * functions being called have side-effects. \n */\nfunction applyEach(fnList, args) {\n\n if( fnList ) { \n head(fnList).apply(null, args);\n \n applyEach(tail(fnList), args);\n }\n}\n\n/**\n * Reverse the order of a list\n */\nfunction reverseList(list){ \n\n // js re-implementation of 3rd solution from:\n // http://www.haskell.org/haskellwiki/99_questions/Solutions/5\n function reverseInner( list, reversedAlready ) {\n if( !list ) {\n return reversedAlready;\n }\n \n return reverseInner(tail(list), cons(head(list), reversedAlready))\n }\n\n return reverseInner(list, emptyList);\n}\n\nfunction first(test, list) {\n return list &&\n (test(head(list)) \n ? head(list) \n : first(test,tail(list))); \n}\n\n/* \n This is a slightly hacked-up browser only version of clarinet \n \n * some features removed to help keep browser Oboe under \n the 5k micro-library limit\n * plug directly into event bus\n \n For the original go here:\n https://github.com/dscape/clarinet\n\n We receive the events:\n STREAM_DATA\n STREAM_END\n \n We emit the events:\n SAX_KEY\n SAX_VALUE_OPEN\n SAX_VALUE_CLOSE \n FAIL_EVENT \n */\n\nfunction clarinet(eventBus) {\n \"use strict\";\n \n var \n // shortcut some events on the bus\n emitSaxKey = eventBus(SAX_KEY).emit,\n emitValueOpen = eventBus(SAX_VALUE_OPEN).emit,\n emitValueClose = eventBus(SAX_VALUE_CLOSE).emit,\n emitFail = eventBus(FAIL_EVENT).emit,\n \n MAX_BUFFER_LENGTH = 64 * 1024\n , stringTokenPattern = /[\\\\\"\\n]/g\n , _n = 0\n \n // states\n , BEGIN = _n++\n , VALUE = _n++ // general stuff\n , OPEN_OBJECT = _n++ // {\n , CLOSE_OBJECT = _n++ // }\n , OPEN_ARRAY = _n++ // [\n , CLOSE_ARRAY = _n++ // ]\n , STRING = _n++ // \"\"\n , OPEN_KEY = _n++ // , \"a\"\n , CLOSE_KEY = _n++ // :\n , TRUE = _n++ // r\n , TRUE2 = _n++ // u\n , TRUE3 = _n++ // e\n , FALSE = _n++ // a\n , FALSE2 = _n++ // l\n , FALSE3 = _n++ // s\n , FALSE4 = _n++ // e\n , NULL = _n++ // u\n , NULL2 = _n++ // l\n , NULL3 = _n++ // l\n , NUMBER_DECIMAL_POINT = _n++ // .\n , NUMBER_DIGIT = _n // [0-9]\n\n // setup initial parser values\n , bufferCheckPosition = MAX_BUFFER_LENGTH\n , latestError \n , c \n , p \n , textNode = undefined\n , numberNode = \"\" \n , slashed = false\n , closed = false\n , state = BEGIN\n , stack = []\n , unicodeS = null\n , unicodeI = 0\n , depth = 0\n , position = 0\n , column = 0 //mostly for error reporting\n , line = 1\n ;\n\n function checkBufferLength () {\n \n var maxActual = 0;\n \n if (textNode !== undefined && textNode.length > MAX_BUFFER_LENGTH) {\n emitError(\"Max buffer length exceeded: textNode\");\n maxActual = Math.max(maxActual, textNode.length);\n }\n if (numberNode.length > MAX_BUFFER_LENGTH) {\n emitError(\"Max buffer length exceeded: numberNode\");\n maxActual = Math.max(maxActual, numberNode.length);\n }\n \n bufferCheckPosition = (MAX_BUFFER_LENGTH - maxActual)\n + position;\n }\n\n eventBus(STREAM_DATA).on(handleData);\n\n /* At the end of the http content close the clarinet \n This will provide an error if the total content provided was not \n valid json, ie if not all arrays, objects and Strings closed properly */\n eventBus(STREAM_END).on(handleStreamEnd); \n\n function emitError (errorString) {\n if (textNode !== undefined) {\n emitValueOpen(textNode);\n emitValueClose();\n textNode = undefined;\n }\n\n latestError = Error(errorString + \"\\nLn: \"+line+\n \"\\nCol: \"+column+\n \"\\nChr: \"+c);\n \n emitFail(errorReport(undefined, undefined, latestError));\n }\n\n function handleStreamEnd() {\n if( state == BEGIN ) {\n // Handle the case where the stream closes without ever receiving\n // any input. This isn't an error - response bodies can be blank,\n // particularly for 204 http responses\n \n // Because of how Oboe is currently implemented, we parse a\n // completely empty stream as containing an empty object.\n // This is because Oboe's done event is only fired when the\n // root object of the JSON stream closes.\n \n // This should be decoupled and attached instead to the input stream\n // from the http (or whatever) resource ending.\n // If this decoupling could happen the SAX parser could simply emit\n // zero events on a completely empty input.\n emitValueOpen({});\n emitValueClose();\n\n closed = true;\n return;\n }\n \n if (state !== VALUE || depth !== 0)\n emitError(\"Unexpected end\");\n \n if (textNode !== undefined) {\n emitValueOpen(textNode);\n emitValueClose();\n textNode = undefined;\n }\n \n closed = true;\n }\n\n function whitespace(c){\n return c == '\\r' || c == '\\n' || c == ' ' || c == '\\t';\n }\n \n function handleData (chunk) {\n \n // this used to throw the error but inside Oboe we will have already\n // gotten the error when it was emitted. The important thing is to\n // not continue with the parse.\n if (latestError)\n return;\n \n if (closed) {\n return emitError(\"Cannot write after close\");\n }\n\n var i = 0;\n c = chunk[0]; \n\n while (c) {\n p = c;\n c = chunk[i++];\n if(!c) break;\n\n position ++;\n if (c == \"\\n\") {\n line ++;\n column = 0;\n } else column ++;\n switch (state) {\n\n case BEGIN:\n if (c === \"{\") state = OPEN_OBJECT;\n else if (c === \"[\") state = OPEN_ARRAY;\n else if (!whitespace(c))\n return emitError(\"Non-whitespace before {[.\");\n continue;\n\n case OPEN_KEY:\n case OPEN_OBJECT:\n if (whitespace(c)) continue;\n if(state === OPEN_KEY) stack.push(CLOSE_KEY);\n else {\n if(c === '}') {\n emitValueOpen({});\n emitValueClose();\n state = stack.pop() || VALUE;\n continue;\n } else stack.push(CLOSE_OBJECT);\n }\n if(c === '\"')\n state = STRING;\n else\n return emitError(\"Malformed object key should start with \\\" \");\n continue;\n\n case CLOSE_KEY:\n case CLOSE_OBJECT:\n if (whitespace(c)) continue;\n\n if(c===':') {\n if(state === CLOSE_OBJECT) {\n stack.push(CLOSE_OBJECT);\n\n if (textNode !== undefined) {\n // was previously (in upstream Clarinet) one event\n // - object open came with the text of the first\n emitValueOpen({});\n emitSaxKey(textNode);\n textNode = undefined;\n }\n depth++;\n } else {\n if (textNode !== undefined) {\n emitSaxKey(textNode);\n textNode = undefined;\n }\n }\n state = VALUE;\n } else if (c==='}') {\n if (textNode !== undefined) {\n emitValueOpen(textNode);\n emitValueClose();\n textNode = undefined;\n }\n emitValueClose();\n depth--;\n state = stack.pop() || VALUE;\n } else if(c===',') {\n if(state === CLOSE_OBJECT)\n stack.push(CLOSE_OBJECT);\n if (textNode !== undefined) {\n emitValueOpen(textNode);\n emitValueClose();\n textNode = undefined;\n }\n state = OPEN_KEY;\n } else \n return emitError('Bad object');\n continue;\n\n case OPEN_ARRAY: // after an array there always a value\n case VALUE:\n if (whitespace(c)) continue;\n if(state===OPEN_ARRAY) {\n emitValueOpen([]);\n depth++; \n state = VALUE;\n if(c === ']') {\n emitValueClose();\n depth--;\n state = stack.pop() || VALUE;\n continue;\n } else {\n stack.push(CLOSE_ARRAY);\n }\n }\n if(c === '\"') state = STRING;\n else if(c === '{') state = OPEN_OBJECT;\n else if(c === '[') state = OPEN_ARRAY;\n else if(c === 't') state = TRUE;\n else if(c === 'f') state = FALSE;\n else if(c === 'n') state = NULL;\n else if(c === '-') { // keep and continue\n numberNode += c;\n } else if(c==='0') {\n numberNode += c;\n state = NUMBER_DIGIT;\n } else if('123456789'.indexOf(c) !== -1) {\n numberNode += c;\n state = NUMBER_DIGIT;\n } else \n return emitError(\"Bad value\");\n continue;\n\n case CLOSE_ARRAY:\n if(c===',') {\n stack.push(CLOSE_ARRAY);\n if (textNode !== undefined) {\n emitValueOpen(textNode);\n emitValueClose();\n textNode = undefined;\n }\n state = VALUE;\n } else if (c===']') {\n if (textNode !== undefined) {\n emitValueOpen(textNode);\n emitValueClose();\n textNode = undefined;\n }\n emitValueClose();\n depth--;\n state = stack.pop() || VALUE;\n } else if (whitespace(c))\n continue;\n else \n return emitError('Bad array');\n continue;\n\n case STRING:\n if (textNode === undefined) {\n textNode = \"\";\n }\n\n // thanks thejh, this is an about 50% performance improvement.\n var starti = i-1;\n \n STRING_BIGLOOP: while (true) {\n\n // zero means \"no unicode active\". 1-4 mean \"parse some more\". end after 4.\n while (unicodeI > 0) {\n unicodeS += c;\n c = chunk.charAt(i++);\n if (unicodeI === 4) {\n // TODO this might be slow? well, probably not used too often anyway\n textNode += String.fromCharCode(parseInt(unicodeS, 16));\n unicodeI = 0;\n starti = i-1;\n } else {\n unicodeI++;\n }\n // we can just break here: no stuff we skipped that still has to be sliced out or so\n if (!c) break STRING_BIGLOOP;\n }\n if (c === '\"' && !slashed) {\n state = stack.pop() || VALUE;\n textNode += chunk.substring(starti, i-1);\n break;\n }\n if (c === '\\\\' && !slashed) {\n slashed = true;\n textNode += chunk.substring(starti, i-1);\n c = chunk.charAt(i++);\n if (!c) break;\n }\n if (slashed) {\n slashed = false;\n if (c === 'n') { textNode += '\\n'; }\n else if (c === 'r') { textNode += '\\r'; }\n else if (c === 't') { textNode += '\\t'; }\n else if (c === 'f') { textNode += '\\f'; }\n else if (c === 'b') { textNode += '\\b'; }\n else if (c === 'u') {\n // \\uxxxx. meh!\n unicodeI = 1;\n unicodeS = '';\n } else {\n textNode += c;\n }\n c = chunk.charAt(i++);\n starti = i-1;\n if (!c) break;\n else continue;\n }\n\n stringTokenPattern.lastIndex = i;\n var reResult = stringTokenPattern.exec(chunk);\n if (!reResult) {\n i = chunk.length+1;\n textNode += chunk.substring(starti, i-1);\n break;\n }\n i = reResult.index+1;\n c = chunk.charAt(reResult.index);\n if (!c) {\n textNode += chunk.substring(starti, i-1);\n break;\n }\n }\n continue;\n\n case TRUE:\n if (!c) continue; // strange buffers\n if (c==='r') state = TRUE2;\n else\n return emitError( 'Invalid true started with t'+ c);\n continue;\n\n case TRUE2:\n if (!c) continue;\n if (c==='u') state = TRUE3;\n else\n return emitError('Invalid true started with tr'+ c);\n continue;\n\n case TRUE3:\n if (!c) continue;\n if(c==='e') {\n emitValueOpen(true);\n emitValueClose();\n state = stack.pop() || VALUE;\n } else\n return emitError('Invalid true started with tru'+ c);\n continue;\n\n case FALSE:\n if (!c) continue;\n if (c==='a') state = FALSE2;\n else\n return emitError('Invalid false started with f'+ c);\n continue;\n\n case FALSE2:\n if (!c) continue;\n if (c==='l') state = FALSE3;\n else\n return emitError('Invalid false started with fa'+ c);\n continue;\n\n case FALSE3:\n if (!c) continue;\n if (c==='s') state = FALSE4;\n else\n return emitError('Invalid false started with fal'+ c);\n continue;\n\n case FALSE4:\n if (!c) continue;\n if (c==='e') {\n emitValueOpen(false);\n emitValueClose();\n state = stack.pop() || VALUE;\n } else\n return emitError('Invalid false started with fals'+ c);\n continue;\n\n case NULL:\n if (!c) continue;\n if (c==='u') state = NULL2;\n else\n return emitError('Invalid null started with n'+ c);\n continue;\n\n case NULL2:\n if (!c) continue;\n if (c==='l') state = NULL3;\n else\n return emitError('Invalid null started with nu'+ c);\n continue;\n\n case NULL3:\n if (!c) continue;\n if(c==='l') {\n emitValueOpen(null);\n emitValueClose();\n state = stack.pop() || VALUE;\n } else \n return emitError('Invalid null started with nul'+ c);\n continue;\n\n case NUMBER_DECIMAL_POINT:\n if(c==='.') {\n numberNode += c;\n state = NUMBER_DIGIT;\n } else \n return emitError('Leading zero not followed by .');\n continue;\n\n case NUMBER_DIGIT:\n if('0123456789'.indexOf(c) !== -1) numberNode += c;\n else if (c==='.') {\n if(numberNode.indexOf('.')!==-1)\n return emitError('Invalid number has two dots');\n numberNode += c;\n } else if (c==='e' || c==='E') {\n if(numberNode.indexOf('e')!==-1 ||\n numberNode.indexOf('E')!==-1 )\n return emitError('Invalid number has two exponential');\n numberNode += c;\n } else if (c===\"+\" || c===\"-\") {\n if(!(p==='e' || p==='E'))\n return emitError('Invalid symbol in number');\n numberNode += c;\n } else {\n if (numberNode) {\n emitValueOpen(parseFloat(numberNode));\n emitValueClose();\n numberNode = \"\";\n }\n i--; // go back one\n state = stack.pop() || VALUE;\n }\n continue;\n\n default:\n return emitError(\"Unknown state: \" + state);\n }\n }\n if (position >= bufferCheckPosition)\n checkBufferLength();\n }\n}\n\n\n/** \n * A bridge used to assign stateless functions to listen to clarinet.\n * \n * As well as the parameter from clarinet, each callback will also be passed\n * the result of the last callback.\n * \n * This may also be used to clear all listeners by assigning zero handlers:\n * \n * ascentManager( clarinet, {} )\n */\nfunction ascentManager(oboeBus, handlers){\n \"use strict\";\n \n var listenerId = {},\n ascent;\n\n function stateAfter(handler) {\n return function(param){\n ascent = handler( ascent, param);\n }\n }\n \n for( var eventName in handlers ) {\n\n oboeBus(eventName).on(stateAfter(handlers[eventName]), listenerId);\n }\n \n oboeBus(NODE_SWAP).on(function(newNode) {\n \n var oldHead = head(ascent),\n key = keyOf(oldHead),\n ancestors = tail(ascent),\n parentNode;\n\n if( ancestors ) {\n parentNode = nodeOf(head(ancestors));\n parentNode[key] = newNode;\n }\n });\n\n oboeBus(NODE_DROP).on(function() {\n\n var oldHead = head(ascent),\n key = keyOf(oldHead),\n ancestors = tail(ascent),\n parentNode;\n\n if( ancestors ) {\n parentNode = nodeOf(head(ancestors));\n \n delete parentNode[key];\n }\n });\n\n oboeBus(ABORTING).on(function(){\n \n for( var eventName in handlers ) {\n oboeBus(eventName).un(listenerId);\n }\n }); \n}\n\n// based on gist https://gist.github.com/monsur/706839\n\n/**\n * XmlHttpRequest's getAllResponseHeaders() method returns a string of response\n * headers according to the format described here:\n * http://www.w3.org/TR/XMLHttpRequest/#the-getallresponseheaders-method\n * This method parses that string into a user-friendly key/value pair object.\n */\nfunction parseResponseHeaders(headerStr) {\n var headers = {};\n \n headerStr && headerStr.split('\\u000d\\u000a')\n .forEach(function(headerPair){\n \n // Can't use split() here because it does the wrong thing\n // if the header value has the string \": \" in it.\n var index = headerPair.indexOf('\\u003a\\u0020');\n \n headers[headerPair.substring(0, index)] \n = headerPair.substring(index + 2);\n });\n \n return headers;\n}\n\n/**\n * Detect if a given URL is cross-origin in the scope of the\n * current page.\n * \n * Browser only (since cross-origin has no meaning in Node.js)\n *\n * @param {Object} pageLocation - as in window.location\n * @param {Object} ajaxHost - an object like window.location describing the \n * origin of the url that we want to ajax in\n */\nfunction isCrossOrigin(pageLocation, ajaxHost) {\n\n /*\n * NB: defaultPort only knows http and https.\n * Returns undefined otherwise.\n */\n function defaultPort(protocol) {\n return {'http:':80, 'https:':443}[protocol];\n }\n \n function portOf(location) {\n // pageLocation should always have a protocol. ajaxHost if no port or\n // protocol is specified, should use the port of the containing page\n \n return location.port || defaultPort(location.protocol||pageLocation.protocol);\n }\n\n // if ajaxHost doesn't give a domain, port is the same as pageLocation\n // it can't give a protocol but not a domain\n // it can't give a port but not a domain\n \n return !!( (ajaxHost.protocol && (ajaxHost.protocol != pageLocation.protocol)) ||\n (ajaxHost.host && (ajaxHost.host != pageLocation.host)) ||\n (ajaxHost.host && (portOf(ajaxHost) != portOf(pageLocation)))\n );\n}\n\n/* turn any url into an object like window.location */\nfunction parseUrlOrigin(url) {\n // url could be domain-relative\n // url could give a domain\n\n // cross origin means:\n // same domain\n // same port\n // some protocol\n // so, same everything up to the first (single) slash \n // if such is given\n //\n // can ignore everything after that \n \n var URL_HOST_PATTERN = /(\\w+:)?(?:\\/\\/)([\\w.-]+)?(?::(\\d+))?\\/?/,\n\n // if no match, use an empty array so that\n // subexpressions 1,2,3 are all undefined\n // and will ultimately return all empty\n // strings as the parse result:\n urlHostMatch = URL_HOST_PATTERN.exec(url) || [];\n \n return {\n protocol: urlHostMatch[1] || '',\n host: urlHostMatch[2] || '',\n port: urlHostMatch[3] || ''\n };\n}\n\nfunction httpTransport(){\n return new XMLHttpRequest();\n}\n\n/**\n * A wrapper around the browser XmlHttpRequest object that raises an \n * event whenever a new part of the response is available.\n * \n * In older browsers progressive reading is impossible so all the \n * content is given in a single call. For newer ones several events\n * should be raised, allowing progressive interpretation of the response.\n * \n * @param {Function} oboeBus an event bus local to this Oboe instance\n * @param {XMLHttpRequest} xhr the xhr to use as the transport. Under normal\n * operation, will have been created using httpTransport() above\n * but for tests a stub can be provided instead.\n * @param {String} method one of 'GET' 'POST' 'PUT' 'PATCH' 'DELETE'\n * @param {String} url the url to make a request to\n * @param {String|Null} data some content to be sent with the request.\n * Only valid if method is POST or PUT.\n * @param {Object} [headers] the http request headers to send\n * @param {boolean} withCredentials the XHR withCredentials property will be\n * set to this value\n */ \nfunction streamingHttp(oboeBus, xhr, method, url, data, headers, withCredentials) {\n \n \"use strict\";\n \n var emitStreamData = oboeBus(STREAM_DATA).emit,\n emitFail = oboeBus(FAIL_EVENT).emit,\n numberOfCharsAlreadyGivenToCallback = 0,\n stillToSendStartEvent = true;\n\n // When an ABORTING message is put on the event bus abort \n // the ajax request \n oboeBus( ABORTING ).on( function(){\n \n // if we keep the onreadystatechange while aborting the XHR gives \n // a callback like a successful call so first remove this listener\n // by assigning null:\n xhr.onreadystatechange = null;\n \n xhr.abort();\n });\n\n /** \n * Handle input from the underlying xhr: either a state change,\n * the progress event or the request being complete.\n */\n function handleProgress() {\n \n var textSoFar = xhr.responseText,\n newText = textSoFar.substr(numberOfCharsAlreadyGivenToCallback);\n \n \n /* Raise the event for new text.\n \n On older browsers, the new text is the whole response. \n On newer/better ones, the fragment part that we got since \n last progress. */\n \n if( newText ) {\n emitStreamData( newText );\n } \n\n numberOfCharsAlreadyGivenToCallback = len(textSoFar);\n }\n \n \n if('onprogress' in xhr){ // detect browser support for progressive delivery\n xhr.onprogress = handleProgress;\n }\n \n xhr.onreadystatechange = function() {\n\n function sendStartIfNotAlready() {\n // Internet Explorer is very unreliable as to when xhr.status etc can\n // be read so has to be protected with try/catch and tried again on \n // the next readyState if it fails\n try{\n stillToSendStartEvent && oboeBus( HTTP_START ).emit(\n xhr.status,\n parseResponseHeaders(xhr.getAllResponseHeaders()) );\n stillToSendStartEvent = false;\n } catch(e){/* do nothing, will try again on next readyState*/}\n }\n \n switch( xhr.readyState ) {\n \n case 2: // HEADERS_RECEIVED\n case 3: // LOADING\n return sendStartIfNotAlready();\n \n case 4: // DONE\n sendStartIfNotAlready(); // if xhr.status hasn't been available yet, it must be NOW, huh IE?\n \n // is this a 2xx http code?\n var successful = String(xhr.status)[0] == 2;\n \n if( successful ) {\n // In Chrome 29 (not 28) no onprogress is emitted when a response\n // is complete before the onload. We need to always do handleInput\n // in case we get the load but have not had a final progress event.\n // This looks like a bug and may change in future but let's take\n // the safest approach and assume we might not have received a \n // progress event for each part of the response\n handleProgress();\n \n oboeBus(STREAM_END).emit();\n } else {\n\n emitFail( errorReport(\n xhr.status, \n xhr.responseText\n ));\n }\n }\n };\n \n try{\n \n xhr.open(method, url, true);\n \n for( var headerName in headers ){\n xhr.setRequestHeader(headerName, headers[headerName]);\n }\n \n if( !isCrossOrigin(window.location, parseUrlOrigin(url)) ) {\n xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n }\n\n xhr.withCredentials = withCredentials;\n \n xhr.send(data);\n \n } catch( e ) {\n \n // To keep a consistent interface with Node, we can't emit an event here.\n // Node's streaming http adaptor receives the error as an asynchronous\n // event rather than as an exception. If we emitted now, the Oboe user\n // has had no chance to add a .fail listener so there is no way\n // the event could be useful. For both these reasons defer the\n // firing to the next JS frame. \n window.setTimeout(\n partialComplete(emitFail, errorReport(undefined, undefined, e))\n , 0\n );\n } \n}\n\nvar jsonPathSyntax = (function() {\n \n var\n \n /** \n * Export a regular expression as a simple function by exposing just \n * the Regex#exec. This allows regex tests to be used under the same \n * interface as differently implemented tests, or for a user of the\n * tests to not concern themselves with their implementation as regular\n * expressions.\n * \n * This could also be expressed point-free as:\n * Function.prototype.bind.bind(RegExp.prototype.exec),\n * \n * But that's far too confusing! (and not even smaller once minified \n * and gzipped)\n */\n regexDescriptor = function regexDescriptor(regex) {\n return regex.exec.bind(regex);\n }\n \n /**\n * Join several regular expressions and express as a function.\n * This allows the token patterns to reuse component regular expressions\n * instead of being expressed in full using huge and confusing regular\n * expressions.\n */ \n , jsonPathClause = varArgs(function( componentRegexes ) {\n\n // The regular expressions all start with ^ because we \n // only want to find matches at the start of the \n // JSONPath fragment we are inspecting \n componentRegexes.unshift(/^/);\n \n return regexDescriptor(\n RegExp(\n componentRegexes.map(attr('source')).join('')\n )\n );\n })\n \n , possiblyCapturing = /(\\$?)/\n , namedNode = /([\\w-_]+|\\*)/\n , namePlaceholder = /()/\n , nodeInArrayNotation = /\\[\"([^\"]+)\"\\]/\n , numberedNodeInArrayNotation = /\\[(\\d+|\\*)\\]/\n , fieldList = /{([\\w ]*?)}/\n , optionalFieldList = /(?:{([\\w ]*?)})?/\n \n\n // foo or * \n , jsonPathNamedNodeInObjectNotation = jsonPathClause( \n possiblyCapturing, \n namedNode, \n optionalFieldList\n )\n \n // [\"foo\"] \n , jsonPathNamedNodeInArrayNotation = jsonPathClause( \n possiblyCapturing, \n nodeInArrayNotation, \n optionalFieldList\n ) \n\n // [2] or [*] \n , jsonPathNumberedNodeInArrayNotation = jsonPathClause( \n possiblyCapturing, \n numberedNodeInArrayNotation, \n optionalFieldList\n )\n\n // {a b c} \n , jsonPathPureDuckTyping = jsonPathClause( \n possiblyCapturing, \n namePlaceholder, \n fieldList\n )\n \n // ..\n , jsonPathDoubleDot = jsonPathClause(/\\.\\./) \n \n // .\n , jsonPathDot = jsonPathClause(/\\./) \n \n // !\n , jsonPathBang = jsonPathClause(\n possiblyCapturing, \n /!/\n ) \n \n // nada!\n , emptyString = jsonPathClause(/$/) \n \n ;\n \n \n /* We export only a single function. When called, this function injects \n into another function the descriptors from above. \n */\n return function (fn){ \n return fn( \n lazyUnion(\n jsonPathNamedNodeInObjectNotation\n , jsonPathNamedNodeInArrayNotation\n , jsonPathNumberedNodeInArrayNotation\n , jsonPathPureDuckTyping \n )\n , jsonPathDoubleDot\n , jsonPathDot\n , jsonPathBang\n , emptyString \n );\n }; \n\n}());\n/**\n * Get a new key->node mapping\n * \n * @param {String|Number} key\n * @param {Object|Array|String|Number|null} node a value found in the json\n */\nfunction namedNode(key, node) {\n return {key:key, node:node};\n}\n\n/** get the key of a namedNode */\nvar keyOf = attr('key');\n\n/** get the node from a namedNode */\nvar nodeOf = attr('node');\n/** \n * This file provides various listeners which can be used to build up\n * a changing ascent based on the callbacks provided by Clarinet. It listens\n * to the low-level events from Clarinet and emits higher-level ones.\n * \n * The building up is stateless so to track a JSON file\n * ascentManager.js is required to store the ascent state\n * between calls.\n */\n\n\n\n/** \n * A special value to use in the path list to represent the path 'to' a root \n * object (which doesn't really have any path). This prevents the need for \n * special-casing detection of the root object and allows it to be treated \n * like any other object. We might think of this as being similar to the \n * 'unnamed root' domain \".\", eg if I go to \n * http://en.wikipedia.org./wiki/En/Main_page the dot after 'org' deliminates \n * the unnamed root of the DNS.\n * \n * This is kept as an object to take advantage that in Javascript's OO objects \n * are guaranteed to be distinct, therefore no other object can possibly clash \n * with this one. Strings, numbers etc provide no such guarantee. \n **/\nvar ROOT_PATH = {};\n\n\n/**\n * Create a new set of handlers for clarinet's events, bound to the emit \n * function given. \n */ \nfunction incrementalContentBuilder( oboeBus ) {\n\n var emitNodeOpened = oboeBus(NODE_OPENED).emit,\n emitNodeClosed = oboeBus(NODE_CLOSED).emit,\n emitRootOpened = oboeBus(ROOT_PATH_FOUND).emit,\n emitRootClosed = oboeBus(ROOT_NODE_FOUND).emit;\n\n function arrayIndicesAreKeys( possiblyInconsistentAscent, newDeepestNode) {\n \n /* for values in arrays we aren't pre-warned of the coming paths \n (Clarinet gives no call to onkey like it does for values in objects) \n so if we are in an array we need to create this path ourselves. The \n key will be len(parentNode) because array keys are always sequential \n numbers. */\n\n var parentNode = nodeOf( head( possiblyInconsistentAscent));\n \n return isOfType( Array, parentNode)\n ?\n keyFound( possiblyInconsistentAscent, \n len(parentNode), \n newDeepestNode\n )\n : \n // nothing needed, return unchanged\n possiblyInconsistentAscent \n ;\n }\n \n function nodeOpened( ascent, newDeepestNode ) {\n \n if( !ascent ) {\n // we discovered the root node, \n emitRootOpened( newDeepestNode);\n \n return keyFound( ascent, ROOT_PATH, newDeepestNode); \n }\n\n // we discovered a non-root node\n \n var arrayConsistentAscent = arrayIndicesAreKeys( ascent, newDeepestNode), \n ancestorBranches = tail( arrayConsistentAscent),\n previouslyUnmappedName = keyOf( head( arrayConsistentAscent));\n \n appendBuiltContent( \n ancestorBranches, \n previouslyUnmappedName, \n newDeepestNode \n );\n \n return cons( \n namedNode( previouslyUnmappedName, newDeepestNode ), \n ancestorBranches\n ); \n }\n\n\n /**\n * Add a new value to the object we are building up to represent the\n * parsed JSON\n */\n function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }\n\n \n /**\n * For when we find a new key in the json.\n * \n * @param {String|Number|Object} newDeepestName the key. If we are in an \n * array will be a number, otherwise a string. May take the special \n * value ROOT_PATH if the root node has just been found\n * \n * @param {String|Number|Object|Array|Null|undefined} [maybeNewDeepestNode] \n * usually this won't be known so can be undefined. Can't use null \n * to represent unknown because null is a valid value in JSON\n **/ \n function keyFound(ascent, newDeepestName, maybeNewDeepestNode) {\n\n if( ascent ) { // if not root\n \n // If we have the key but (unless adding to an array) no known value\n // yet. Put that key in the output but against no defined value: \n appendBuiltContent( ascent, newDeepestName, maybeNewDeepestNode );\n }\n \n var ascentWithNewPath = cons( \n namedNode( newDeepestName, \n maybeNewDeepestNode), \n ascent\n );\n\n emitNodeOpened( ascentWithNewPath);\n \n return ascentWithNewPath;\n }\n\n\n /**\n * For when the current node ends.\n */\n function nodeClosed( ascent ) {\n\n emitNodeClosed( ascent);\n \n return tail( ascent) ||\n // If there are no nodes left in the ascent the root node\n // just closed. Emit a special event for this: \n emitRootClosed(nodeOf(head(ascent)));\n } \n\n var contentBuilderHandlers = {};\n contentBuilderHandlers[SAX_VALUE_OPEN] = nodeOpened;\n contentBuilderHandlers[SAX_VALUE_CLOSE] = nodeClosed;\n contentBuilderHandlers[SAX_KEY] = keyFound;\n return contentBuilderHandlers;\n}\n\n/**\n * The jsonPath evaluator compiler used for Oboe.js. \n * \n * One function is exposed. This function takes a String JSONPath spec and \n * returns a function to test candidate ascents for matches.\n * \n * String jsonPath -> (List ascent) -> Boolean|Object\n *\n * This file is coded in a pure functional style. That is, no function has \n * side effects, every function evaluates to the same value for the same \n * arguments and no variables are reassigned.\n */ \n// the call to jsonPathSyntax injects the token syntaxes that are needed \n// inside the compiler\nvar jsonPathCompiler = jsonPathSyntax(function (pathNodeSyntax, \n doubleDotSyntax, \n dotSyntax,\n bangSyntax,\n emptySyntax ) {\n\n var CAPTURING_INDEX = 1;\n var NAME_INDEX = 2;\n var FIELD_LIST_INDEX = 3;\n\n var headKey = compose2(keyOf, head),\n headNode = compose2(nodeOf, head);\n \n /**\n * Create an evaluator function for a named path node, expressed in the\n * JSONPath like:\n * foo\n * [\"bar\"]\n * [2] \n */\n function nameClause(previousExpr, detection ) {\n \n var name = detection[NAME_INDEX],\n \n matchesName = ( !name || name == '*' ) \n ? always\n : function(ascent){return headKey(ascent) == name};\n \n\n return lazyIntersection(matchesName, previousExpr);\n }\n\n /**\n * Create an evaluator function for a a duck-typed node, expressed like:\n * \n * {spin, taste, colour}\n * .particle{spin, taste, colour}\n * *{spin, taste, colour}\n */\n function duckTypeClause(previousExpr, detection) {\n\n var fieldListStr = detection[FIELD_LIST_INDEX];\n\n if (!fieldListStr) \n return previousExpr; // don't wrap at all, return given expr as-is \n\n var hasAllrequiredFields = partialComplete(\n hasAllProperties, \n arrayAsList(fieldListStr.split(/\\W+/))\n ),\n \n isMatch = compose2( \n hasAllrequiredFields, \n headNode\n );\n\n return lazyIntersection(isMatch, previousExpr);\n }\n\n /**\n * Expression for $, returns the evaluator function\n */\n function capture( previousExpr, detection ) {\n\n // extract meaning from the detection \n var capturing = !!detection[CAPTURING_INDEX];\n\n if (!capturing) \n return previousExpr; // don't wrap at all, return given expr as-is \n \n return lazyIntersection(previousExpr, head);\n \n } \n \n /**\n * Create an evaluator function that moves onto the next item on the \n * lists. This function is the place where the logic to move up a \n * level in the ascent exists. \n * \n * Eg, for JSONPath \".foo\" we need skip1(nameClause(always, [,'foo']))\n */\n function skip1(previousExpr) {\n \n \n if( previousExpr == always ) {\n /* If there is no previous expression this consume command \n is at the start of the jsonPath.\n Since JSONPath specifies what we'd like to find but not \n necessarily everything leading down to it, when running\n out of JSONPath to check against we default to true */\n return always;\n }\n\n /** return true if the ascent we have contains only the JSON root,\n * false otherwise\n */\n function notAtRoot(ascent){\n return headKey(ascent) != ROOT_PATH;\n }\n \n return lazyIntersection(\n /* If we're already at the root but there are more \n expressions to satisfy, can't consume any more. No match.\n\n This check is why none of the other exprs have to be able \n to handle empty lists; skip1 is the only evaluator that \n moves onto the next token and it refuses to do so once it \n reaches the last item in the list. */\n notAtRoot,\n \n /* We are not at the root of the ascent yet.\n Move to the next level of the ascent by handing only \n the tail to the previous expression */ \n compose2(previousExpr, tail) \n );\n \n } \n \n /**\n * Create an evaluator function for the .. (double dot) token. Consumes\n * zero or more levels of the ascent, the fewest that are required to find\n * a match when given to previousExpr.\n */ \n function skipMany(previousExpr) {\n\n if( previousExpr == always ) {\n /* If there is no previous expression this consume command \n is at the start of the jsonPath.\n Since JSONPath specifies what we'd like to find but not \n necessarily everything leading down to it, when running\n out of JSONPath to check against we default to true */ \n return always;\n }\n \n var \n // In JSONPath .. is equivalent to !.. so if .. reaches the root\n // the match has succeeded. Ie, we might write ..foo or !..foo\n // and both should match identically.\n terminalCaseWhenArrivingAtRoot = rootExpr(),\n terminalCaseWhenPreviousExpressionIsSatisfied = previousExpr,\n recursiveCase = skip1(function(ascent) {\n return cases(ascent);\n }),\n\n cases = lazyUnion(\n terminalCaseWhenArrivingAtRoot\n , terminalCaseWhenPreviousExpressionIsSatisfied\n , recursiveCase \n );\n \n return cases;\n } \n \n /**\n * Generate an evaluator for ! - matches only the root element of the json\n * and ignores any previous expressions since nothing may precede !. \n */ \n function rootExpr() {\n \n return function(ascent){\n return headKey(ascent) == ROOT_PATH;\n };\n } \n \n /**\n * Generate a statement wrapper to sit around the outermost \n * clause evaluator.\n * \n * Handles the case where the capturing is implicit because the JSONPath\n * did not contain a '$' by returning the last node.\n */ \n function statementExpr(lastClause) {\n \n return function(ascent) {\n \n // kick off the evaluation by passing through to the last clause\n var exprMatch = lastClause(ascent);\n \n return exprMatch === true ? head(ascent) : exprMatch;\n };\n } \n \n /**\n * For when a token has been found in the JSONPath input.\n * Compiles the parser for that token and returns in combination with the\n * parser already generated.\n * \n * @param {Function} exprs a list of the clause evaluator generators for\n * the token that was found\n * @param {Function} parserGeneratedSoFar the parser already found\n * @param {Array} detection the match given by the regex engine when \n * the feature was found\n */\n function expressionsReader( exprs, parserGeneratedSoFar, detection ) {\n \n // if exprs is zero-length foldR will pass back the \n // parserGeneratedSoFar as-is so we don't need to treat \n // this as a special case\n \n return foldR( \n function( parserGeneratedSoFar, expr ){\n \n return expr(parserGeneratedSoFar, detection);\n }, \n parserGeneratedSoFar, \n exprs\n ); \n\n }\n\n /** \n * If jsonPath matches the given detector function, creates a function which\n * evaluates against every clause in the clauseEvaluatorGenerators. The\n * created function is propagated to the onSuccess function, along with\n * the remaining unparsed JSONPath substring.\n * \n * The intended use is to create a clauseMatcher by filling in\n * the first two arguments, thus providing a function that knows\n * some syntax to match and what kind of generator to create if it\n * finds it. The parameter list once completed is:\n * \n * (jsonPath, parserGeneratedSoFar, onSuccess)\n * \n * onSuccess may be compileJsonPathToFunction, to recursively continue \n * parsing after finding a match or returnFoundParser to stop here.\n */\n function generateClauseReaderIfTokenFound (\n \n tokenDetector, clauseEvaluatorGenerators,\n \n jsonPath, parserGeneratedSoFar, onSuccess) {\n \n var detected = tokenDetector(jsonPath);\n\n if(detected) {\n var compiledParser = expressionsReader(\n clauseEvaluatorGenerators, \n parserGeneratedSoFar, \n detected\n ),\n \n remainingUnparsedJsonPath = jsonPath.substr(len(detected[0])); \n \n return onSuccess(remainingUnparsedJsonPath, compiledParser);\n } \n }\n \n /**\n * Partially completes generateClauseReaderIfTokenFound above. \n */\n function clauseMatcher(tokenDetector, exprs) {\n \n return partialComplete( \n generateClauseReaderIfTokenFound, \n tokenDetector, \n exprs \n );\n }\n\n /**\n * clauseForJsonPath is a function which attempts to match against \n * several clause matchers in order until one matches. If non match the\n * jsonPath expression is invalid and an error is thrown.\n * \n * The parameter list is the same as a single clauseMatcher:\n * \n * (jsonPath, parserGeneratedSoFar, onSuccess)\n */ \n var clauseForJsonPath = lazyUnion(\n\n clauseMatcher(pathNodeSyntax , list( capture, \n duckTypeClause, \n nameClause, \n skip1 ))\n \n , clauseMatcher(doubleDotSyntax , list( skipMany))\n \n // dot is a separator only (like whitespace in other languages) but \n // rather than make it a special case, use an empty list of \n // expressions when this token is found\n , clauseMatcher(dotSyntax , list() ) \n \n , clauseMatcher(bangSyntax , list( capture,\n rootExpr))\n \n , clauseMatcher(emptySyntax , list( statementExpr))\n \n , function (jsonPath) {\n throw Error('\"' + jsonPath + '\" could not be tokenised') \n }\n );\n\n\n /**\n * One of two possible values for the onSuccess argument of \n * generateClauseReaderIfTokenFound.\n * \n * When this function is used, generateClauseReaderIfTokenFound simply \n * returns the compiledParser that it made, regardless of if there is \n * any remaining jsonPath to be compiled.\n */\n function returnFoundParser(_remainingJsonPath, compiledParser){ \n return compiledParser \n } \n \n /**\n * Recursively compile a JSONPath expression.\n * \n * This function serves as one of two possible values for the onSuccess \n * argument of generateClauseReaderIfTokenFound, meaning continue to\n * recursively compile. Otherwise, returnFoundParser is given and\n * compilation terminates.\n */\n function compileJsonPathToFunction( uncompiledJsonPath, \n parserGeneratedSoFar ) {\n\n /**\n * On finding a match, if there is remaining text to be compiled\n * we want to either continue parsing using a recursive call to \n * compileJsonPathToFunction. Otherwise, we want to stop and return \n * the parser that we have found so far.\n */\n var onFind = uncompiledJsonPath\n ? compileJsonPathToFunction \n : returnFoundParser;\n \n return clauseForJsonPath( \n uncompiledJsonPath, \n parserGeneratedSoFar, \n onFind\n ); \n }\n\n /**\n * This is the function that we expose to the rest of the library.\n */\n return function(jsonPath){\n \n try {\n // Kick off the recursive parsing of the jsonPath \n return compileJsonPathToFunction(jsonPath, always);\n \n } catch( e ) {\n throw Error( 'Could not compile \"' + jsonPath + \n '\" because ' + e.message\n );\n }\n }\n\n});\n\n/** \n * A pub/sub which is responsible for a single event type. A \n * multi-event type event bus is created by pubSub by collecting\n * several of these.\n * \n * @param {String} eventType \n * the name of the events managed by this singleEventPubSub\n * @param {singleEventPubSub} [newListener] \n * place to notify of new listeners\n * @param {singleEventPubSub} [removeListener] \n * place to notify of when listeners are removed\n */\nfunction singleEventPubSub(eventType, newListener, removeListener){\n\n /** we are optimised for emitting events over firing them.\n * As well as the tuple list which stores event ids and\n * listeners there is a list with just the listeners which \n * can be iterated more quickly when we are emitting\n */\n var listenerTupleList,\n listenerList;\n\n function hasId(id){\n return function(tuple) {\n return tuple.id == id; \n }; \n }\n \n return {\n\n /**\n * @param {Function} listener\n * @param {*} listenerId \n * an id that this listener can later by removed by. \n * Can be of any type, to be compared to other ids using ==\n */\n on:function( listener, listenerId ) {\n \n var tuple = {\n listener: listener\n , id: listenerId || listener // when no id is given use the\n // listener function as the id\n };\n\n if( newListener ) {\n newListener.emit(eventType, listener, tuple.id);\n }\n \n listenerTupleList = cons( tuple, listenerTupleList );\n listenerList = cons( listener, listenerList );\n\n return this; // chaining\n },\n \n emit:function () { \n applyEach( listenerList, arguments );\n },\n \n un: function( listenerId ) {\n \n var removed; \n \n listenerTupleList = without(\n listenerTupleList,\n hasId(listenerId),\n function(tuple){\n removed = tuple;\n }\n ); \n \n if( removed ) {\n listenerList = without( listenerList, function(listener){\n return listener == removed.listener;\n });\n \n if( removeListener ) {\n removeListener.emit(eventType, removed.listener, removed.id);\n }\n }\n },\n \n listeners: function(){\n // differs from Node EventEmitter: returns list, not array\n return listenerList;\n },\n \n hasListener: function(listenerId){\n var test = listenerId? hasId(listenerId) : always;\n \n return defined(first( test, listenerTupleList));\n }\n };\n}\n/**\n * pubSub is a curried interface for listening to and emitting\n * events.\n * \n * If we get a bus:\n * \n * var bus = pubSub();\n * \n * We can listen to event 'foo' like:\n * \n * bus('foo').on(myCallback)\n * \n * And emit event foo like:\n * \n * bus('foo').emit()\n * \n * or, with a parameter:\n * \n * bus('foo').emit('bar')\n * \n * All functions can be cached and don't need to be \n * bound. Ie:\n * \n * var fooEmitter = bus('foo').emit\n * fooEmitter('bar'); // emit an event\n * fooEmitter('baz'); // emit another\n * \n * There's also an uncurried[1] shortcut for .emit and .on:\n * \n * bus.on('foo', callback)\n * bus.emit('foo', 'bar')\n * \n * [1]: http://zvon.org/other/haskell/Outputprelude/uncurry_f.html\n */\nfunction pubSub(){\n\n var singles = {},\n newListener = newSingle('newListener'),\n removeListener = newSingle('removeListener'); \n \n function newSingle(eventName) {\n return singles[eventName] = singleEventPubSub(\n eventName, \n newListener, \n removeListener\n ); \n } \n\n /** pubSub instances are functions */\n function pubSubInstance( eventName ){ \n \n return singles[eventName] || newSingle( eventName ); \n }\n\n // add convenience EventEmitter-style uncurried form of 'emit' and 'on'\n ['emit', 'on', 'un'].forEach(function(methodName){\n \n pubSubInstance[methodName] = varArgs(function(eventName, parameters){\n apply( parameters, pubSubInstance( eventName )[methodName]);\n }); \n });\n \n return pubSubInstance;\n}\n\n/**\n * This file declares some constants to use as names for event types.\n */\n\nvar // the events which are never exported are kept as \n // the smallest possible representation, in numbers:\n _S = 1,\n\n // fired whenever a new node starts in the JSON stream:\n NODE_OPENED = _S++,\n\n // fired whenever a node closes in the JSON stream:\n NODE_CLOSED = _S++,\n\n // called if a .node callback returns a value - \n NODE_SWAP = _S++,\n NODE_DROP = _S++,\n\n FAIL_EVENT = 'fail',\n \n ROOT_NODE_FOUND = _S++,\n ROOT_PATH_FOUND = _S++,\n \n HTTP_START = 'start',\n STREAM_DATA = 'data',\n STREAM_END = 'end',\n ABORTING = _S++,\n\n // SAX events butchered from Clarinet\n SAX_KEY = _S++,\n SAX_VALUE_OPEN = _S++,\n SAX_VALUE_CLOSE = _S++;\n \nfunction errorReport(statusCode, body, error) {\n try{\n var jsonBody = JSON.parse(body);\n }catch(e){}\n\n return {\n statusCode:statusCode,\n body:body,\n jsonBody:jsonBody,\n thrown:error\n };\n} \n\n/** \n * The pattern adaptor listens for newListener and removeListener\n * events. When patterns are added or removed it compiles the JSONPath\n * and wires them up.\n * \n * When nodes and paths are found it emits the fully-qualified match \n * events with parameters ready to ship to the outside world\n */\n\nfunction patternAdapter(oboeBus, jsonPathCompiler) {\n\n var predicateEventMap = {\n node:oboeBus(NODE_CLOSED)\n , path:oboeBus(NODE_OPENED)\n };\n \n function emitMatchingNode(emitMatch, node, ascent) {\n \n /* \n We're now calling to the outside world where Lisp-style \n lists will not be familiar. Convert to standard arrays. \n \n Also, reverse the order because it is more common to \n list paths \"root to leaf\" than \"leaf to root\" */\n var descent = reverseList(ascent);\n \n emitMatch(\n node,\n \n // To make a path, strip off the last item which is the special\n // ROOT_PATH token for the 'path' to the root node \n listAsArray(tail(map(keyOf,descent))), // path\n listAsArray(map(nodeOf, descent)) // ancestors \n ); \n }\n\n /* \n * Set up the catching of events such as NODE_CLOSED and NODE_OPENED and, if \n * matching the specified pattern, propagate to pattern-match events such as \n * oboeBus('node:!')\n * \n * \n * \n * @param {Function} predicateEvent \n * either oboeBus(NODE_CLOSED) or oboeBus(NODE_OPENED).\n * @param {Function} compiledJsonPath \n */\n function addUnderlyingListener( fullEventName, predicateEvent, compiledJsonPath ){\n \n var emitMatch = oboeBus(fullEventName).emit;\n \n predicateEvent.on( function (ascent) {\n\n var maybeMatchingMapping = compiledJsonPath(ascent);\n\n /* Possible values for maybeMatchingMapping are now:\n\n false: \n we did not match \n\n an object/array/string/number/null: \n we matched and have the node that matched.\n Because nulls are valid json values this can be null.\n\n undefined:\n we matched but don't have the matching node yet.\n ie, we know there is an upcoming node that matches but we \n can't say anything else about it. \n */\n if (maybeMatchingMapping !== false) {\n\n emitMatchingNode(\n emitMatch, \n nodeOf(maybeMatchingMapping), \n ascent\n );\n }\n }, fullEventName);\n \n oboeBus('removeListener').on( function(removedEventName){\n\n // if the fully qualified match event listener is later removed, clean up \n // by removing the underlying listener if it was the last using that pattern:\n \n if( removedEventName == fullEventName ) {\n \n if( !oboeBus(removedEventName).listeners( )) {\n predicateEvent.un( fullEventName );\n }\n }\n }); \n }\n\n oboeBus('newListener').on( function(fullEventName){\n\n var match = /(node|path):(.*)/.exec(fullEventName);\n \n if( match ) {\n var predicateEvent = predicateEventMap[match[1]];\n \n if( !predicateEvent.hasListener( fullEventName) ) { \n \n addUnderlyingListener(\n fullEventName,\n predicateEvent, \n jsonPathCompiler( match[2] )\n );\n }\n } \n })\n\n}\n\n/**\n * The instance API is the thing that is returned when oboe() is called.\n * it allows:\n *\n * - listeners for various events to be added and removed\n * - the http response header/headers to be read\n */\nfunction instanceApi(oboeBus, contentSource){\n\n var oboeApi,\n fullyQualifiedNamePattern = /^(node|path):./,\n rootNodeFinishedEvent = oboeBus(ROOT_NODE_FOUND),\n emitNodeDrop = oboeBus(NODE_DROP).emit,\n emitNodeSwap = oboeBus(NODE_SWAP).emit,\n\n /**\n * Add any kind of listener that the instance api exposes\n */\n addListener = varArgs(function( eventId, parameters ){\n\n if( oboeApi[eventId] ) {\n\n // for events added as .on(event, callback), if there is a\n // .event() equivalent with special behaviour , pass through\n // to that:\n apply(parameters, oboeApi[eventId]);\n } else {\n\n // we have a standard Node.js EventEmitter 2-argument call.\n // The first parameter is the listener.\n var event = oboeBus(eventId),\n listener = parameters[0];\n\n if( fullyQualifiedNamePattern.test(eventId) ) {\n\n // allow fully-qualified node/path listeners\n // to be added\n addForgettableCallback(event, listener);\n } else {\n\n // the event has no special handling, pass through\n // directly onto the event bus:\n event.on( listener);\n }\n }\n\n return oboeApi; // chaining\n }),\n\n /**\n * Remove any kind of listener that the instance api exposes\n */\n removeListener = function( eventId, p2, p3 ){\n\n if( eventId == 'done' ) {\n\n rootNodeFinishedEvent.un(p2);\n\n } else if( eventId == 'node' || eventId == 'path' ) {\n\n // allow removal of node and path\n oboeBus.un(eventId + ':' + p2, p3);\n } else {\n\n // we have a standard Node.js EventEmitter 2-argument call.\n // The second parameter is the listener. This may be a call\n // to remove a fully-qualified node/path listener but requires\n // no special handling\n var listener = p2;\n\n oboeBus(eventId).un(listener);\n }\n\n return oboeApi; // chaining\n };\n\n /**\n * Add a callback, wrapped in a try/catch so as to not break the\n * execution of Oboe if an exception is thrown (fail events are\n * fired instead)\n *\n * The callback is used as the listener id so that it can later be\n * removed using .un(callback)\n */\n function addProtectedCallback(eventName, callback) {\n oboeBus(eventName).on(protectedCallback(callback), callback);\n return oboeApi; // chaining\n }\n\n /**\n * Add a callback where, if .forget() is called during the callback's\n * execution, the callback will be de-registered\n */\n function addForgettableCallback(event, callback, listenerId) {\n\n // listenerId is optional and if not given, the original\n // callback will be used\n listenerId = listenerId || callback;\n\n var safeCallback = protectedCallback(callback);\n\n event.on( function() {\n\n var discard = false;\n\n oboeApi.forget = function(){\n discard = true;\n };\n\n apply( arguments, safeCallback );\n\n delete oboeApi.forget;\n\n if( discard ) {\n event.un(listenerId);\n }\n }, listenerId);\n\n return oboeApi; // chaining\n }\n\n /**\n * wrap a callback so that if it throws, Oboe.js doesn't crash but instead\n * throw the error in another event loop\n */\n function protectedCallback( callback ) {\n return function() {\n try{\n return callback.apply(oboeApi, arguments);\n }catch(e) {\n setTimeout(function() {\n throw e;\n });\n }\n }\n }\n\n /**\n * Return the fully qualified event for when a pattern matches\n * either a node or a path\n *\n * @param type {String} either 'node' or 'path'\n */\n function fullyQualifiedPatternMatchEvent(type, pattern) {\n return oboeBus(type + ':' + pattern);\n }\n\n function wrapCallbackToSwapNodeIfSomethingReturned( callback ) {\n return function() {\n var returnValueFromCallback = callback.apply(this, arguments);\n\n if( defined(returnValueFromCallback) ) {\n\n if( returnValueFromCallback == oboe.drop ) {\n emitNodeDrop();\n } else {\n emitNodeSwap(returnValueFromCallback);\n }\n }\n }\n }\n\n function addSingleNodeOrPathListener(eventId, pattern, callback) {\n\n var effectiveCallback;\n\n if( eventId == 'node' ) {\n effectiveCallback = wrapCallbackToSwapNodeIfSomethingReturned(callback);\n } else {\n effectiveCallback = callback;\n }\n\n addForgettableCallback(\n fullyQualifiedPatternMatchEvent(eventId, pattern),\n effectiveCallback,\n callback\n );\n }\n\n /**\n * Add several listeners at a time, from a map\n */\n function addMultipleNodeOrPathListeners(eventId, listenerMap) {\n\n for( var pattern in listenerMap ) {\n addSingleNodeOrPathListener(eventId, pattern, listenerMap[pattern]);\n }\n }\n\n /**\n * implementation behind .onPath() and .onNode()\n */\n function addNodeOrPathListenerApi( eventId, jsonPathOrListenerMap, callback ){\n\n if( isString(jsonPathOrListenerMap) ) {\n addSingleNodeOrPathListener(eventId, jsonPathOrListenerMap, callback);\n\n } else {\n addMultipleNodeOrPathListeners(eventId, jsonPathOrListenerMap);\n }\n\n return oboeApi; // chaining\n }\n\n\n // some interface methods are only filled in after we receive\n // values and are noops before that:\n oboeBus(ROOT_PATH_FOUND).on( function(rootNode) {\n oboeApi.root = functor(rootNode);\n });\n\n /**\n * When content starts make the headers readable through the\n * instance API\n */\n oboeBus(HTTP_START).on( function(_statusCode, headers) {\n\n oboeApi.header = function(name) {\n return name ? headers[name]\n : headers\n ;\n }\n });\n\n /**\n * Construct and return the public API of the Oboe instance to be\n * returned to the calling application\n */\n return oboeApi = {\n on : addListener,\n addListener : addListener,\n removeListener : removeListener,\n emit : oboeBus.emit,\n\n node : partialComplete(addNodeOrPathListenerApi, 'node'),\n path : partialComplete(addNodeOrPathListenerApi, 'path'),\n\n done : partialComplete(addForgettableCallback, rootNodeFinishedEvent),\n start : partialComplete(addProtectedCallback, HTTP_START ),\n\n // fail doesn't use protectedCallback because\n // could lead to non-terminating loops\n fail : oboeBus(FAIL_EVENT).on,\n\n // public api calling abort fires the ABORTING event\n abort : oboeBus(ABORTING).emit,\n\n // initially return nothing for header and root\n header : noop,\n root : noop,\n\n source : contentSource\n };\n}\n\n/**\n * This file sits just behind the API which is used to attain a new\n * Oboe instance. It creates the new components that are required\n * and introduces them to each other.\n */\n\nfunction wire (httpMethodName, contentSource, body, headers, withCredentials){\n\n var oboeBus = pubSub();\n \n // Wire the input stream in if we are given a content source.\n // This will usually be the case. If not, the instance created\n // will have to be passed content from an external source.\n \n if( contentSource ) {\n\n streamingHttp( oboeBus,\n httpTransport(), \n httpMethodName,\n contentSource,\n body,\n headers,\n withCredentials\n );\n }\n\n clarinet(oboeBus);\n\n ascentManager(oboeBus, incrementalContentBuilder(oboeBus));\n \n patternAdapter(oboeBus, jsonPathCompiler); \n \n return instanceApi(oboeBus, contentSource);\n}\n\nfunction applyDefaults( passthrough, url, httpMethodName, body, headers, withCredentials, cached ){\n\n headers = headers ?\n // Shallow-clone the headers array. This allows it to be\n // modified without side effects to the caller. We don't\n // want to change objects that the user passes in.\n JSON.parse(JSON.stringify(headers))\n : {};\n\n if( body ) {\n if( !isString(body) ) {\n\n // If the body is not a string, stringify it. This allows objects to\n // be given which will be sent as JSON.\n body = JSON.stringify(body);\n\n // Default Content-Type to JSON unless given otherwise.\n headers['Content-Type'] = headers['Content-Type'] || 'application/json';\n }\n } else {\n body = null;\n }\n\n // support cache busting like jQuery.ajax({cache:false})\n function modifiedUrl(baseUrl, cached) {\n\n if( cached === false ) {\n\n if( baseUrl.indexOf('?') == -1 ) {\n baseUrl += '?';\n } else {\n baseUrl += '&';\n }\n\n baseUrl += '_=' + new Date().getTime();\n }\n return baseUrl;\n }\n\n return passthrough( httpMethodName || 'GET', modifiedUrl(url, cached), body, headers, withCredentials || false );\n}\n\n// export public API\nfunction oboe(arg1) {\n\n // We use duck-typing to detect if the parameter given is a stream, with the\n // below list of parameters.\n // Unpipe and unshift would normally be present on a stream but this breaks\n // compatibility with Request streams.\n // See https://github.com/jimhigson/oboe.js/issues/65\n \n var nodeStreamMethodNames = list('resume', 'pause', 'pipe'),\n isStream = partialComplete(\n hasAllProperties\n , nodeStreamMethodNames\n );\n \n if( arg1 ) {\n if (isStream(arg1) || isString(arg1)) {\n\n // simple version for GETs. Signature is:\n // oboe( url )\n // or, under node:\n // oboe( readableStream )\n return applyDefaults(\n wire,\n arg1 // url\n );\n\n } else {\n\n // method signature is:\n // oboe({method:m, url:u, body:b, headers:{...}})\n\n return applyDefaults(\n wire,\n arg1.url,\n arg1.method,\n arg1.body,\n arg1.headers,\n arg1.withCredentials,\n arg1.cached\n );\n \n }\n } else {\n // wire up a no-AJAX, no-stream Oboe. Will have to have content \n // fed in externally and using .emit.\n return wire();\n }\n}\n\n/* oboe.drop is a special value. If a node callback returns this value the\n parsed node is deleted from the JSON\n */\noboe.drop = function() {\n return oboe.drop;\n};\n\n\n if ( typeof define === \"function\" && define.amd ) {\n define( \"oboe\", [], function () { return oboe; } );\n } else if (typeof exports === 'object') {\n module.exports = oboe;\n } else {\n window.oboe = oboe;\n }\n})((function(){\n // Access to the window object throws an exception in HTML5 web workers so\n // point it to \"self\" if it runs in a web worker\n try {\n return window;\n } catch (e) {\n return self;\n }\n }()), Object, Array, Error, JSON);\n","// from https://github.com/indutny/self-signed/blob/gh-pages/lib/asn1.js\n// Fedor, you are amazing.\n'use strict'\n\nvar asn1 = require('asn1.js')\n\nexports.certificate = require('./certificate')\n\nvar RSAPrivateKey = asn1.define('RSAPrivateKey', function () {\n this.seq().obj(\n this.key('version').int(),\n this.key('modulus').int(),\n this.key('publicExponent').int(),\n this.key('privateExponent').int(),\n this.key('prime1').int(),\n this.key('prime2').int(),\n this.key('exponent1').int(),\n this.key('exponent2').int(),\n this.key('coefficient').int()\n )\n})\nexports.RSAPrivateKey = RSAPrivateKey\n\nvar RSAPublicKey = asn1.define('RSAPublicKey', function () {\n this.seq().obj(\n this.key('modulus').int(),\n this.key('publicExponent').int()\n )\n})\nexports.RSAPublicKey = RSAPublicKey\n\nvar PublicKey = asn1.define('SubjectPublicKeyInfo', function () {\n this.seq().obj(\n this.key('algorithm').use(AlgorithmIdentifier),\n this.key('subjectPublicKey').bitstr()\n )\n})\nexports.PublicKey = PublicKey\n\nvar AlgorithmIdentifier = asn1.define('AlgorithmIdentifier', function () {\n this.seq().obj(\n this.key('algorithm').objid(),\n this.key('none').null_().optional(),\n this.key('curve').objid().optional(),\n this.key('params').seq().obj(\n this.key('p').int(),\n this.key('q').int(),\n this.key('g').int()\n ).optional()\n )\n})\n\nvar PrivateKeyInfo = asn1.define('PrivateKeyInfo', function () {\n this.seq().obj(\n this.key('version').int(),\n this.key('algorithm').use(AlgorithmIdentifier),\n this.key('subjectPrivateKey').octstr()\n )\n})\nexports.PrivateKey = PrivateKeyInfo\nvar EncryptedPrivateKeyInfo = asn1.define('EncryptedPrivateKeyInfo', function () {\n this.seq().obj(\n this.key('algorithm').seq().obj(\n this.key('id').objid(),\n this.key('decrypt').seq().obj(\n this.key('kde').seq().obj(\n this.key('id').objid(),\n this.key('kdeparams').seq().obj(\n this.key('salt').octstr(),\n this.key('iters').int()\n )\n ),\n this.key('cipher').seq().obj(\n this.key('algo').objid(),\n this.key('iv').octstr()\n )\n )\n ),\n this.key('subjectPrivateKey').octstr()\n )\n})\n\nexports.EncryptedPrivateKey = EncryptedPrivateKeyInfo\n\nvar DSAPrivateKey = asn1.define('DSAPrivateKey', function () {\n this.seq().obj(\n this.key('version').int(),\n this.key('p').int(),\n this.key('q').int(),\n this.key('g').int(),\n this.key('pub_key').int(),\n this.key('priv_key').int()\n )\n})\nexports.DSAPrivateKey = DSAPrivateKey\n\nexports.DSAparam = asn1.define('DSAparam', function () {\n this.int()\n})\n\nvar ECPrivateKey = asn1.define('ECPrivateKey', function () {\n this.seq().obj(\n this.key('version').int(),\n this.key('privateKey').octstr(),\n this.key('parameters').optional().explicit(0).use(ECParameters),\n this.key('publicKey').optional().explicit(1).bitstr()\n )\n})\nexports.ECPrivateKey = ECPrivateKey\n\nvar ECParameters = asn1.define('ECParameters', function () {\n this.choice({\n namedCurve: this.objid()\n })\n})\n\nexports.signature = asn1.define('signature', function () {\n this.seq().obj(\n this.key('r').int(),\n this.key('s').int()\n )\n})\n","// from https://github.com/Rantanen/node-dtls/blob/25a7dc861bda38cfeac93a723500eea4f0ac2e86/Certificate.js\n// thanks to @Rantanen\n\n'use strict'\n\nvar asn = require('asn1.js')\n\nvar Time = asn.define('Time', function () {\n this.choice({\n utcTime: this.utctime(),\n generalTime: this.gentime()\n })\n})\n\nvar AttributeTypeValue = asn.define('AttributeTypeValue', function () {\n this.seq().obj(\n this.key('type').objid(),\n this.key('value').any()\n )\n})\n\nvar AlgorithmIdentifier = asn.define('AlgorithmIdentifier', function () {\n this.seq().obj(\n this.key('algorithm').objid(),\n this.key('parameters').optional()\n )\n})\n\nvar SubjectPublicKeyInfo = asn.define('SubjectPublicKeyInfo', function () {\n this.seq().obj(\n this.key('algorithm').use(AlgorithmIdentifier),\n this.key('subjectPublicKey').bitstr()\n )\n})\n\nvar RelativeDistinguishedName = asn.define('RelativeDistinguishedName', function () {\n this.setof(AttributeTypeValue)\n})\n\nvar RDNSequence = asn.define('RDNSequence', function () {\n this.seqof(RelativeDistinguishedName)\n})\n\nvar Name = asn.define('Name', function () {\n this.choice({\n rdnSequence: this.use(RDNSequence)\n })\n})\n\nvar Validity = asn.define('Validity', function () {\n this.seq().obj(\n this.key('notBefore').use(Time),\n this.key('notAfter').use(Time)\n )\n})\n\nvar Extension = asn.define('Extension', function () {\n this.seq().obj(\n this.key('extnID').objid(),\n this.key('critical').bool().def(false),\n this.key('extnValue').octstr()\n )\n})\n\nvar TBSCertificate = asn.define('TBSCertificate', function () {\n this.seq().obj(\n this.key('version').explicit(0).int(),\n this.key('serialNumber').int(),\n this.key('signature').use(AlgorithmIdentifier),\n this.key('issuer').use(Name),\n this.key('validity').use(Validity),\n this.key('subject').use(Name),\n this.key('subjectPublicKeyInfo').use(SubjectPublicKeyInfo),\n this.key('issuerUniqueID').implicit(1).bitstr().optional(),\n this.key('subjectUniqueID').implicit(2).bitstr().optional(),\n this.key('extensions').explicit(3).seqof(Extension).optional()\n )\n})\n\nvar X509Certificate = asn.define('X509Certificate', function () {\n this.seq().obj(\n this.key('tbsCertificate').use(TBSCertificate),\n this.key('signatureAlgorithm').use(AlgorithmIdentifier),\n this.key('signatureValue').bitstr()\n )\n})\n\nmodule.exports = X509Certificate\n","// adapted from https://github.com/apatil/pemstrip\nvar findProc = /Proc-Type: 4,ENCRYPTED\\n\\r?DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)\\n\\r?\\n\\r?([0-9A-z\\n\\r\\+\\/\\=]+)\\n\\r?/m\nvar startRegex = /^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\\n/m\nvar fullRegex = /^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\\n\\r?([0-9A-z\\n\\r\\+\\/\\=]+)\\n\\r?-----END \\1-----$/m\nvar evp = require('evp_bytestokey')\nvar ciphers = require('browserify-aes')\nmodule.exports = function (okey, password) {\n var key = okey.toString()\n var match = key.match(findProc)\n var decrypted\n if (!match) {\n var match2 = key.match(fullRegex)\n decrypted = new Buffer(match2[2].replace(/\\r?\\n/g, ''), 'base64')\n } else {\n var suite = 'aes' + match[1]\n var iv = new Buffer(match[2], 'hex')\n var cipherText = new Buffer(match[3].replace(/\\r?\\n/g, ''), 'base64')\n var cipherKey = evp(password, iv.slice(0, 8), parseInt(match[1], 10)).key\n var out = []\n var cipher = ciphers.createDecipheriv(suite, cipherKey, iv)\n out.push(cipher.update(cipherText))\n out.push(cipher.final())\n decrypted = Buffer.concat(out)\n }\n var tag = key.match(startRegex)[1]\n return {\n tag: tag,\n data: decrypted\n }\n}\n","var asn1 = require('./asn1')\nvar aesid = require('./aesid.json')\nvar fixProc = require('./fixProc')\nvar ciphers = require('browserify-aes')\nvar compat = require('pbkdf2')\nmodule.exports = parseKeys\n\nfunction parseKeys (buffer) {\n var password\n if (typeof buffer === 'object' && !Buffer.isBuffer(buffer)) {\n password = buffer.passphrase\n buffer = buffer.key\n }\n if (typeof buffer === 'string') {\n buffer = new Buffer(buffer)\n }\n\n var stripped = fixProc(buffer, password)\n\n var type = stripped.tag\n var data = stripped.data\n var subtype, ndata\n switch (type) {\n case 'CERTIFICATE':\n ndata = asn1.certificate.decode(data, 'der').tbsCertificate.subjectPublicKeyInfo\n // falls through\n case 'PUBLIC KEY':\n if (!ndata) {\n ndata = asn1.PublicKey.decode(data, 'der')\n }\n subtype = ndata.algorithm.algorithm.join('.')\n switch (subtype) {\n case '1.2.840.113549.1.1.1':\n return asn1.RSAPublicKey.decode(ndata.subjectPublicKey.data, 'der')\n case '1.2.840.10045.2.1':\n ndata.subjectPrivateKey = ndata.subjectPublicKey\n return {\n type: 'ec',\n data: ndata\n }\n case '1.2.840.10040.4.1':\n ndata.algorithm.params.pub_key = asn1.DSAparam.decode(ndata.subjectPublicKey.data, 'der')\n return {\n type: 'dsa',\n data: ndata.algorithm.params\n }\n default: throw new Error('unknown key id ' + subtype)\n }\n throw new Error('unknown key type ' + type)\n case 'ENCRYPTED PRIVATE KEY':\n data = asn1.EncryptedPrivateKey.decode(data, 'der')\n data = decrypt(data, password)\n // falls through\n case 'PRIVATE KEY':\n ndata = asn1.PrivateKey.decode(data, 'der')\n subtype = ndata.algorithm.algorithm.join('.')\n switch (subtype) {\n case '1.2.840.113549.1.1.1':\n return asn1.RSAPrivateKey.decode(ndata.subjectPrivateKey, 'der')\n case '1.2.840.10045.2.1':\n return {\n curve: ndata.algorithm.curve,\n privateKey: asn1.ECPrivateKey.decode(ndata.subjectPrivateKey, 'der').privateKey\n }\n case '1.2.840.10040.4.1':\n ndata.algorithm.params.priv_key = asn1.DSAparam.decode(ndata.subjectPrivateKey, 'der')\n return {\n type: 'dsa',\n params: ndata.algorithm.params\n }\n default: throw new Error('unknown key id ' + subtype)\n }\n throw new Error('unknown key type ' + type)\n case 'RSA PUBLIC KEY':\n return asn1.RSAPublicKey.decode(data, 'der')\n case 'RSA PRIVATE KEY':\n return asn1.RSAPrivateKey.decode(data, 'der')\n case 'DSA PRIVATE KEY':\n return {\n type: 'dsa',\n params: asn1.DSAPrivateKey.decode(data, 'der')\n }\n case 'EC PRIVATE KEY':\n data = asn1.ECPrivateKey.decode(data, 'der')\n return {\n curve: data.parameters.value,\n privateKey: data.privateKey\n }\n default: throw new Error('unknown key type ' + type)\n }\n}\nparseKeys.signature = asn1.signature\nfunction decrypt (data, password) {\n var salt = data.algorithm.decrypt.kde.kdeparams.salt\n var iters = parseInt(data.algorithm.decrypt.kde.kdeparams.iters.toString(), 10)\n var algo = aesid[data.algorithm.decrypt.cipher.algo.join('.')]\n var iv = data.algorithm.decrypt.cipher.iv\n var cipherText = data.subjectPrivateKey\n var keylen = parseInt(algo.split('-')[1], 10) / 8\n var key = compat.pbkdf2Sync(password, salt, iters, keylen)\n var cipher = ciphers.createDecipheriv(algo, key, iv)\n var out = []\n out.push(cipher.update(cipherText))\n out.push(cipher.final())\n return Buffer.concat(out)\n}\n","var trim = require('trim')\n , forEach = require('for-each')\n , isArray = function(arg) {\n return Object.prototype.toString.call(arg) === '[object Array]';\n }\n\nmodule.exports = function (headers) {\n if (!headers)\n return {}\n\n var result = {}\n\n forEach(\n trim(headers).split('\\n')\n , function (row) {\n var index = row.indexOf(':')\n , key = trim(row.slice(0, index)).toLowerCase()\n , value = trim(row.slice(index + 1))\n\n if (typeof(result[key]) === 'undefined') {\n result[key] = value\n } else if (isArray(result[key])) {\n result[key].push(value)\n } else {\n result[key] = [ result[key], value ]\n }\n }\n )\n\n return result\n}","\nexports.pbkdf2 = require('./lib/async')\n\nexports.pbkdf2Sync = require('./lib/sync')\n","var checkParameters = require('./precondition')\nvar defaultEncoding = require('./default-encoding')\nvar sync = require('./sync')\nvar Buffer = require('safe-buffer').Buffer\n\nvar ZERO_BUF\nvar subtle = global.crypto && global.crypto.subtle\nvar toBrowser = {\n 'sha': 'SHA-1',\n 'sha-1': 'SHA-1',\n 'sha1': 'SHA-1',\n 'sha256': 'SHA-256',\n 'sha-256': 'SHA-256',\n 'sha384': 'SHA-384',\n 'sha-384': 'SHA-384',\n 'sha-512': 'SHA-512',\n 'sha512': 'SHA-512'\n}\nvar checks = []\nfunction checkNative (algo) {\n if (global.process && !global.process.browser) {\n return Promise.resolve(false)\n }\n if (!subtle || !subtle.importKey || !subtle.deriveBits) {\n return Promise.resolve(false)\n }\n if (checks[algo] !== undefined) {\n return checks[algo]\n }\n ZERO_BUF = ZERO_BUF || Buffer.alloc(8)\n var prom = browserPbkdf2(ZERO_BUF, ZERO_BUF, 10, 128, algo)\n .then(function () {\n return true\n }).catch(function () {\n return false\n })\n checks[algo] = prom\n return prom\n}\nfunction browserPbkdf2 (password, salt, iterations, length, algo) {\n return subtle.importKey(\n 'raw', password, {name: 'PBKDF2'}, false, ['deriveBits']\n ).then(function (key) {\n return subtle.deriveBits({\n name: 'PBKDF2',\n salt: salt,\n iterations: iterations,\n hash: {\n name: algo\n }\n }, key, length << 3)\n }).then(function (res) {\n return Buffer.from(res)\n })\n}\nfunction resolvePromise (promise, callback) {\n promise.then(function (out) {\n process.nextTick(function () {\n callback(null, out)\n })\n }, function (e) {\n process.nextTick(function () {\n callback(e)\n })\n })\n}\nmodule.exports = function (password, salt, iterations, keylen, digest, callback) {\n if (!Buffer.isBuffer(password)) password = Buffer.from(password, defaultEncoding)\n if (!Buffer.isBuffer(salt)) salt = Buffer.from(salt, defaultEncoding)\n\n checkParameters(iterations, keylen)\n if (typeof digest === 'function') {\n callback = digest\n digest = undefined\n }\n if (typeof callback !== 'function') throw new Error('No callback provided to pbkdf2')\n\n digest = digest || 'sha1'\n var algo = toBrowser[digest.toLowerCase()]\n if (!algo || typeof global.Promise !== 'function') {\n return process.nextTick(function () {\n var out\n try {\n out = sync(password, salt, iterations, keylen, digest)\n } catch (e) {\n return callback(e)\n }\n callback(null, out)\n })\n }\n resolvePromise(checkNative(algo).then(function (resp) {\n if (resp) {\n return browserPbkdf2(password, salt, iterations, keylen, algo)\n } else {\n return sync(password, salt, iterations, keylen, digest)\n }\n }), callback)\n}\n","var defaultEncoding\n/* istanbul ignore next */\nif (process.browser) {\n defaultEncoding = 'utf-8'\n} else {\n var pVersionMajor = parseInt(process.version.split('.')[0].slice(1), 10)\n\n defaultEncoding = pVersionMajor >= 6 ? 'utf-8' : 'binary'\n}\nmodule.exports = defaultEncoding\n","var MAX_ALLOC = Math.pow(2, 30) - 1 // default in iojs\nmodule.exports = function (iterations, keylen) {\n if (typeof iterations !== 'number') {\n throw new TypeError('Iterations not a number')\n }\n\n if (iterations < 0) {\n throw new TypeError('Bad iterations')\n }\n\n if (typeof keylen !== 'number') {\n throw new TypeError('Key length not a number')\n }\n\n if (keylen < 0 || keylen > MAX_ALLOC || keylen !== keylen) { /* eslint no-self-compare: 0 */\n throw new TypeError('Bad key length')\n }\n}\n","var md5 = require('create-hash/md5')\nvar rmd160 = require('ripemd160')\nvar sha = require('sha.js')\n\nvar checkParameters = require('./precondition')\nvar defaultEncoding = require('./default-encoding')\nvar Buffer = require('safe-buffer').Buffer\nvar ZEROS = Buffer.alloc(128)\nvar sizes = {\n md5: 16,\n sha1: 20,\n sha224: 28,\n sha256: 32,\n sha384: 48,\n sha512: 64,\n rmd160: 20,\n ripemd160: 20\n}\n\nfunction Hmac (alg, key, saltLen) {\n var hash = getDigest(alg)\n var blocksize = (alg === 'sha512' || alg === 'sha384') ? 128 : 64\n\n if (key.length > blocksize) {\n key = hash(key)\n } else if (key.length < blocksize) {\n key = Buffer.concat([key, ZEROS], blocksize)\n }\n\n var ipad = Buffer.allocUnsafe(blocksize + sizes[alg])\n var opad = Buffer.allocUnsafe(blocksize + sizes[alg])\n for (var i = 0; i < blocksize; i++) {\n ipad[i] = key[i] ^ 0x36\n opad[i] = key[i] ^ 0x5C\n }\n\n var ipad1 = Buffer.allocUnsafe(blocksize + saltLen + 4)\n ipad.copy(ipad1, 0, 0, blocksize)\n this.ipad1 = ipad1\n this.ipad2 = ipad\n this.opad = opad\n this.alg = alg\n this.blocksize = blocksize\n this.hash = hash\n this.size = sizes[alg]\n}\n\nHmac.prototype.run = function (data, ipad) {\n data.copy(ipad, this.blocksize)\n var h = this.hash(ipad)\n h.copy(this.opad, this.blocksize)\n return this.hash(this.opad)\n}\n\nfunction getDigest (alg) {\n function shaFunc (data) {\n return sha(alg).update(data).digest()\n }\n\n if (alg === 'rmd160' || alg === 'ripemd160') return rmd160\n if (alg === 'md5') return md5\n return shaFunc\n}\n\nfunction pbkdf2 (password, salt, iterations, keylen, digest) {\n if (!Buffer.isBuffer(password)) password = Buffer.from(password, defaultEncoding)\n if (!Buffer.isBuffer(salt)) salt = Buffer.from(salt, defaultEncoding)\n\n checkParameters(iterations, keylen)\n\n digest = digest || 'sha1'\n\n var hmac = new Hmac(digest, password, salt.length)\n\n var DK = Buffer.allocUnsafe(keylen)\n var block1 = Buffer.allocUnsafe(salt.length + 4)\n salt.copy(block1, 0, 0, salt.length)\n\n var destPos = 0\n var hLen = sizes[digest]\n var l = Math.ceil(keylen / hLen)\n\n for (var i = 1; i <= l; i++) {\n block1.writeUInt32BE(i, salt.length)\n\n var T = hmac.run(block1, hmac.ipad1)\n var U = T\n\n for (var j = 1; j < iterations; j++) {\n U = hmac.run(U, hmac.ipad2)\n for (var k = 0; k < hLen; k++) T[k] ^= U[k]\n }\n\n T.copy(DK, destPos)\n destPos += hLen\n }\n\n return DK\n}\n\nmodule.exports = pbkdf2\n","'use strict';\n\nif (!process.version ||\n process.version.indexOf('v0.') === 0 ||\n process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {\n module.exports = { nextTick: nextTick };\n} else {\n module.exports = process\n}\n\nfunction nextTick(fn, arg1, arg2, arg3) {\n if (typeof fn !== 'function') {\n throw new TypeError('\"callback\" argument must be a function');\n }\n var len = arguments.length;\n var args, i;\n switch (len) {\n case 0:\n case 1:\n return process.nextTick(fn);\n case 2:\n return process.nextTick(function afterTickOne() {\n fn.call(null, arg1);\n });\n case 3:\n return process.nextTick(function afterTickTwo() {\n fn.call(null, arg1, arg2);\n });\n case 4:\n return process.nextTick(function afterTickThree() {\n fn.call(null, arg1, arg2, arg3);\n });\n default:\n args = new Array(len - 1);\n i = 0;\n while (i < args.length) {\n args[i++] = arguments[i];\n }\n return process.nextTick(function afterTick() {\n fn.apply(null, args);\n });\n }\n}\n\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== 'production') {\n var invariant = require('fbjs/lib/invariant');\n var warning = require('fbjs/lib/warning');\n var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n var loggedTypeFailures = {};\n}\n\n/**\n * Assert that the values match with the type specs.\n * Error messages are memorized and will only be shown once.\n *\n * @param {object} typeSpecs Map of name to a ReactPropType\n * @param {object} values Runtime values that need to be type-checked\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n * @param {string} componentName Name of the component for error messages.\n * @param {?Function} getStack Returns the component stack.\n * @private\n */\nfunction checkPropTypes(typeSpecs, values, location, componentName, getStack) {\n if (process.env.NODE_ENV !== 'production') {\n for (var typeSpecName in typeSpecs) {\n if (typeSpecs.hasOwnProperty(typeSpecName)) {\n var error;\n // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'the `prop-types` package, but received `%s`.', componentName || 'React class', location, typeSpecName, typeof typeSpecs[typeSpecName]);\n error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);\n } catch (ex) {\n error = ex;\n }\n warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error);\n if (error instanceof Error && !(error.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error.message] = true;\n\n var stack = getStack ? getStack() : '';\n\n warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');\n }\n }\n }\n }\n}\n\nmodule.exports = checkPropTypes;\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar emptyFunction = require('fbjs/lib/emptyFunction');\nvar invariant = require('fbjs/lib/invariant');\nvar warning = require('fbjs/lib/warning');\nvar assign = require('object-assign');\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\nvar checkPropTypes = require('./checkPropTypes');\n\nmodule.exports = function(isValidElement, throwOnDirectAccess) {\n /* global Symbol */\n var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\n var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.\n\n /**\n * Returns the iterator method function contained on the iterable object.\n *\n * Be sure to invoke the function with the iterable as context:\n *\n * var iteratorFn = getIteratorFn(myIterable);\n * if (iteratorFn) {\n * var iterator = iteratorFn.call(myIterable);\n * ...\n * }\n *\n * @param {?object} maybeIterable\n * @return {?function}\n */\n function getIteratorFn(maybeIterable) {\n var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);\n if (typeof iteratorFn === 'function') {\n return iteratorFn;\n }\n }\n\n /**\n * Collection of methods that allow declaration and validation of props that are\n * supplied to React components. Example usage:\n *\n * var Props = require('ReactPropTypes');\n * var MyArticle = React.createClass({\n * propTypes: {\n * // An optional string prop named \"description\".\n * description: Props.string,\n *\n * // A required enum prop named \"category\".\n * category: Props.oneOf(['News','Photos']).isRequired,\n *\n * // A prop named \"dialog\" that requires an instance of Dialog.\n * dialog: Props.instanceOf(Dialog).isRequired\n * },\n * render: function() { ... }\n * });\n *\n * A more formal specification of how these methods are used:\n *\n * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)\n * decl := ReactPropTypes.{type}(.isRequired)?\n *\n * Each and every declaration produces a function with the same signature. This\n * allows the creation of custom validation functions. For example:\n *\n * var MyLink = React.createClass({\n * propTypes: {\n * // An optional string or URI prop named \"href\".\n * href: function(props, propName, componentName) {\n * var propValue = props[propName];\n * if (propValue != null && typeof propValue !== 'string' &&\n * !(propValue instanceof URI)) {\n * return new Error(\n * 'Expected a string or an URI for ' + propName + ' in ' +\n * componentName\n * );\n * }\n * }\n * },\n * render: function() {...}\n * });\n *\n * @internal\n */\n\n var ANONYMOUS = '<>';\n\n // Important!\n // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.\n var ReactPropTypes = {\n array: createPrimitiveTypeChecker('array'),\n bool: createPrimitiveTypeChecker('boolean'),\n func: createPrimitiveTypeChecker('function'),\n number: createPrimitiveTypeChecker('number'),\n object: createPrimitiveTypeChecker('object'),\n string: createPrimitiveTypeChecker('string'),\n symbol: createPrimitiveTypeChecker('symbol'),\n\n any: createAnyTypeChecker(),\n arrayOf: createArrayOfTypeChecker,\n element: createElementTypeChecker(),\n instanceOf: createInstanceTypeChecker,\n node: createNodeChecker(),\n objectOf: createObjectOfTypeChecker,\n oneOf: createEnumTypeChecker,\n oneOfType: createUnionTypeChecker,\n shape: createShapeTypeChecker,\n exact: createStrictShapeTypeChecker,\n };\n\n /**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\n /*eslint-disable no-self-compare*/\n function is(x, y) {\n // SameValue algorithm\n if (x === y) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n return x !== 0 || 1 / x === 1 / y;\n } else {\n // Step 6.a: NaN == NaN\n return x !== x && y !== y;\n }\n }\n /*eslint-enable no-self-compare*/\n\n /**\n * We use an Error-like object for backward compatibility as people may call\n * PropTypes directly and inspect their output. However, we don't use real\n * Errors anymore. We don't inspect their stack anyway, and creating them\n * is prohibitively expensive if they are created too often, such as what\n * happens in oneOfType() for any type before the one that matched.\n */\n function PropTypeError(message) {\n this.message = message;\n this.stack = '';\n }\n // Make `instanceof Error` still work for returned errors.\n PropTypeError.prototype = Error.prototype;\n\n function createChainableTypeChecker(validate) {\n if (process.env.NODE_ENV !== 'production') {\n var manualPropTypeCallCache = {};\n var manualPropTypeWarningCount = 0;\n }\n function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {\n componentName = componentName || ANONYMOUS;\n propFullName = propFullName || propName;\n\n if (secret !== ReactPropTypesSecret) {\n if (throwOnDirectAccess) {\n // New behavior only for users of `prop-types` package\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use `PropTypes.checkPropTypes()` to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {\n // Old behavior for people using React.PropTypes\n var cacheKey = componentName + ':' + propName;\n if (\n !manualPropTypeCallCache[cacheKey] &&\n // Avoid spamming the console because they are often not actionable except for lib authors\n manualPropTypeWarningCount < 3\n ) {\n warning(\n false,\n 'You are manually calling a React.PropTypes validation ' +\n 'function for the `%s` prop on `%s`. This is deprecated ' +\n 'and will throw in the standalone `prop-types` package. ' +\n 'You may be seeing this warning due to a third-party PropTypes ' +\n 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.',\n propFullName,\n componentName\n );\n manualPropTypeCallCache[cacheKey] = true;\n manualPropTypeWarningCount++;\n }\n }\n }\n if (props[propName] == null) {\n if (isRequired) {\n if (props[propName] === null) {\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));\n }\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));\n }\n return null;\n } else {\n return validate(props, propName, componentName, location, propFullName);\n }\n }\n\n var chainedCheckType = checkType.bind(null, false);\n chainedCheckType.isRequired = checkType.bind(null, true);\n\n return chainedCheckType;\n }\n\n function createPrimitiveTypeChecker(expectedType) {\n function validate(props, propName, componentName, location, propFullName, secret) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== expectedType) {\n // `propValue` being instance of, say, date/regexp, pass the 'object'\n // check, but we can offer a more precise error message here rather than\n // 'of type `object`'.\n var preciseType = getPreciseType(propValue);\n\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createAnyTypeChecker() {\n return createChainableTypeChecker(emptyFunction.thatReturnsNull);\n }\n\n function createArrayOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');\n }\n var propValue = props[propName];\n if (!Array.isArray(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));\n }\n for (var i = 0; i < propValue.length; i++) {\n var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createElementTypeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n if (!isValidElement(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createInstanceTypeChecker(expectedClass) {\n function validate(props, propName, componentName, location, propFullName) {\n if (!(props[propName] instanceof expectedClass)) {\n var expectedClassName = expectedClass.name || ANONYMOUS;\n var actualClassName = getClassName(props[propName]);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createEnumTypeChecker(expectedValues) {\n if (!Array.isArray(expectedValues)) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0;\n return emptyFunction.thatReturnsNull;\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n for (var i = 0; i < expectedValues.length; i++) {\n if (is(propValue, expectedValues[i])) {\n return null;\n }\n }\n\n var valuesString = JSON.stringify(expectedValues);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createObjectOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');\n }\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));\n }\n for (var key in propValue) {\n if (propValue.hasOwnProperty(key)) {\n var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createUnionTypeChecker(arrayOfTypeCheckers) {\n if (!Array.isArray(arrayOfTypeCheckers)) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;\n return emptyFunction.thatReturnsNull;\n }\n\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n if (typeof checker !== 'function') {\n warning(\n false,\n 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +\n 'received %s at index %s.',\n getPostfixForTypeWarning(checker),\n i\n );\n return emptyFunction.thatReturnsNull;\n }\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {\n return null;\n }\n }\n\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createNodeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n if (!isNode(props[propName])) {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n for (var key in shapeTypes) {\n var checker = shapeTypes[key];\n if (!checker) {\n continue;\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createStrictShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n // We need to check all keys in case some are required but missing from\n // props.\n var allKeys = assign({}, props[propName], shapeTypes);\n for (var key in allKeys) {\n var checker = shapeTypes[key];\n if (!checker) {\n return new PropTypeError(\n 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +\n '\\nBad object: ' + JSON.stringify(props[propName], null, ' ') +\n '\\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')\n );\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n\n return createChainableTypeChecker(validate);\n }\n\n function isNode(propValue) {\n switch (typeof propValue) {\n case 'number':\n case 'string':\n case 'undefined':\n return true;\n case 'boolean':\n return !propValue;\n case 'object':\n if (Array.isArray(propValue)) {\n return propValue.every(isNode);\n }\n if (propValue === null || isValidElement(propValue)) {\n return true;\n }\n\n var iteratorFn = getIteratorFn(propValue);\n if (iteratorFn) {\n var iterator = iteratorFn.call(propValue);\n var step;\n if (iteratorFn !== propValue.entries) {\n while (!(step = iterator.next()).done) {\n if (!isNode(step.value)) {\n return false;\n }\n }\n } else {\n // Iterator will provide entry [k,v] tuples rather than values.\n while (!(step = iterator.next()).done) {\n var entry = step.value;\n if (entry) {\n if (!isNode(entry[1])) {\n return false;\n }\n }\n }\n }\n } else {\n return false;\n }\n\n return true;\n default:\n return false;\n }\n }\n\n function isSymbol(propType, propValue) {\n // Native Symbol.\n if (propType === 'symbol') {\n return true;\n }\n\n // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'\n if (propValue['@@toStringTag'] === 'Symbol') {\n return true;\n }\n\n // Fallback for non-spec compliant Symbols which are polyfilled.\n if (typeof Symbol === 'function' && propValue instanceof Symbol) {\n return true;\n }\n\n return false;\n }\n\n // Equivalent of `typeof` but with special handling for array and regexp.\n function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }\n\n // This handles more types than `getPropType`. Only used for error messages.\n // See `createPrimitiveTypeChecker`.\n function getPreciseType(propValue) {\n if (typeof propValue === 'undefined' || propValue === null) {\n return '' + propValue;\n }\n var propType = getPropType(propValue);\n if (propType === 'object') {\n if (propValue instanceof Date) {\n return 'date';\n } else if (propValue instanceof RegExp) {\n return 'regexp';\n }\n }\n return propType;\n }\n\n // Returns a string that is postfixed to a warning about an invalid type.\n // For example, \"undefined\" or \"of type array\"\n function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }\n\n // Returns class name of the object, if any.\n function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }\n\n ReactPropTypes.checkPropTypes = checkPropTypes;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&\n Symbol.for &&\n Symbol.for('react.element')) ||\n 0xeac7;\n\n var isValidElement = function(object) {\n return typeof object === 'object' &&\n object !== null &&\n object.$$typeof === REACT_ELEMENT_TYPE;\n };\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","exports.publicEncrypt = require('./publicEncrypt');\nexports.privateDecrypt = require('./privateDecrypt');\n\nexports.privateEncrypt = function privateEncrypt(key, buf) {\n return exports.publicEncrypt(key, buf, true);\n};\n\nexports.publicDecrypt = function publicDecrypt(key, buf) {\n return exports.privateDecrypt(key, buf, true);\n};","var createHash = require('create-hash');\nmodule.exports = function (seed, len) {\n var t = new Buffer('');\n var i = 0, c;\n while (t.length < len) {\n c = i2ops(i++);\n t = Buffer.concat([t, createHash('sha1').update(seed).update(c).digest()]);\n }\n return t.slice(0, len);\n};\n\nfunction i2ops(c) {\n var out = new Buffer(4);\n out.writeUInt32BE(c,0);\n return out;\n}","var parseKeys = require('parse-asn1');\nvar mgf = require('./mgf');\nvar xor = require('./xor');\nvar bn = require('bn.js');\nvar crt = require('browserify-rsa');\nvar createHash = require('create-hash');\nvar withPublic = require('./withPublic');\nmodule.exports = function privateDecrypt(private_key, enc, reverse) {\n var padding;\n if (private_key.padding) {\n padding = private_key.padding;\n } else if (reverse) {\n padding = 1;\n } else {\n padding = 4;\n }\n \n var key = parseKeys(private_key);\n var k = key.modulus.byteLength();\n if (enc.length > k || new bn(enc).cmp(key.modulus) >= 0) {\n throw new Error('decryption error');\n }\n var msg;\n if (reverse) {\n msg = withPublic(new bn(enc), key);\n } else {\n msg = crt(enc, key);\n }\n var zBuffer = new Buffer(k - msg.length);\n zBuffer.fill(0);\n msg = Buffer.concat([zBuffer, msg], k);\n if (padding === 4) {\n return oaep(key, msg);\n } else if (padding === 1) {\n return pkcs1(key, msg, reverse);\n } else if (padding === 3) {\n return msg;\n } else {\n throw new Error('unknown padding');\n }\n};\n\nfunction oaep(key, msg){\n var n = key.modulus;\n var k = key.modulus.byteLength();\n var mLen = msg.length;\n var iHash = createHash('sha1').update(new Buffer('')).digest();\n var hLen = iHash.length;\n var hLen2 = 2 * hLen;\n if (msg[0] !== 0) {\n throw new Error('decryption error');\n }\n var maskedSeed = msg.slice(1, hLen + 1);\n var maskedDb = msg.slice(hLen + 1);\n var seed = xor(maskedSeed, mgf(maskedDb, hLen));\n var db = xor(maskedDb, mgf(seed, k - hLen - 1));\n if (compare(iHash, db.slice(0, hLen))) {\n throw new Error('decryption error');\n }\n var i = hLen;\n while (db[i] === 0) {\n i++;\n }\n if (db[i++] !== 1) {\n throw new Error('decryption error');\n }\n return db.slice(i);\n}\n\nfunction pkcs1(key, msg, reverse){\n var p1 = msg.slice(0, 2);\n var i = 2;\n var status = 0;\n while (msg[i++] !== 0) {\n if (i >= msg.length) {\n status++;\n break;\n }\n }\n var ps = msg.slice(2, i - 1);\n var p2 = msg.slice(i - 1, i);\n\n if ((p1.toString('hex') !== '0002' && !reverse) || (p1.toString('hex') !== '0001' && reverse)){\n status++;\n }\n if (ps.length < 8) {\n status++;\n }\n if (status) {\n throw new Error('decryption error');\n }\n return msg.slice(i);\n}\nfunction compare(a, b){\n a = new Buffer(a);\n b = new Buffer(b);\n var dif = 0;\n var len = a.length;\n if (a.length !== b.length) {\n dif++;\n len = Math.min(a.length, b.length);\n }\n var i = -1;\n while (++i < len) {\n dif += (a[i] ^ b[i]);\n }\n return dif;\n}","var parseKeys = require('parse-asn1');\nvar randomBytes = require('randombytes');\nvar createHash = require('create-hash');\nvar mgf = require('./mgf');\nvar xor = require('./xor');\nvar bn = require('bn.js');\nvar withPublic = require('./withPublic');\nvar crt = require('browserify-rsa');\n\nvar constants = {\n RSA_PKCS1_OAEP_PADDING: 4,\n RSA_PKCS1_PADDIN: 1,\n RSA_NO_PADDING: 3\n};\n\nmodule.exports = function publicEncrypt(public_key, msg, reverse) {\n var padding;\n if (public_key.padding) {\n padding = public_key.padding;\n } else if (reverse) {\n padding = 1;\n } else {\n padding = 4;\n }\n var key = parseKeys(public_key);\n var paddedMsg;\n if (padding === 4) {\n paddedMsg = oaep(key, msg);\n } else if (padding === 1) {\n paddedMsg = pkcs1(key, msg, reverse);\n } else if (padding === 3) {\n paddedMsg = new bn(msg);\n if (paddedMsg.cmp(key.modulus) >= 0) {\n throw new Error('data too long for modulus');\n }\n } else {\n throw new Error('unknown padding');\n }\n if (reverse) {\n return crt(paddedMsg, key);\n } else {\n return withPublic(paddedMsg, key);\n }\n};\n\nfunction oaep(key, msg){\n var k = key.modulus.byteLength();\n var mLen = msg.length;\n var iHash = createHash('sha1').update(new Buffer('')).digest();\n var hLen = iHash.length;\n var hLen2 = 2 * hLen;\n if (mLen > k - hLen2 - 2) {\n throw new Error('message too long');\n }\n var ps = new Buffer(k - mLen - hLen2 - 2);\n ps.fill(0);\n var dblen = k - hLen - 1;\n var seed = randomBytes(hLen);\n var maskedDb = xor(Buffer.concat([iHash, ps, new Buffer([1]), msg], dblen), mgf(seed, dblen));\n var maskedSeed = xor(seed, mgf(maskedDb, hLen));\n return new bn(Buffer.concat([new Buffer([0]), maskedSeed, maskedDb], k));\n}\nfunction pkcs1(key, msg, reverse){\n var mLen = msg.length;\n var k = key.modulus.byteLength();\n if (mLen > k - 11) {\n throw new Error('message too long');\n }\n var ps;\n if (reverse) {\n ps = new Buffer(k - mLen - 3);\n ps.fill(0xff);\n } else {\n ps = nonZero(k - mLen - 3);\n }\n return new bn(Buffer.concat([new Buffer([0, reverse?1:2]), ps, new Buffer([0]), msg], k));\n}\nfunction nonZero(len, crypto) {\n var out = new Buffer(len);\n var i = 0;\n var cache = randomBytes(len*2);\n var cur = 0;\n var num;\n while (i < len) {\n if (cur === cache.length) {\n cache = randomBytes(len*2);\n cur = 0;\n }\n num = cache[cur++];\n if (num) {\n out[i++] = num;\n }\n }\n return out;\n}","var bn = require('bn.js');\nfunction withPublic(paddedMsg, key) {\n return new Buffer(paddedMsg\n .toRed(bn.mont(key.modulus))\n .redPow(new bn(key.publicExponent))\n .fromRed()\n .toArray());\n}\n\nmodule.exports = withPublic;","module.exports = function xor(a, b) {\n var len = a.length;\n var i = -1;\n while (++i < len) {\n a[i] ^= b[i];\n }\n return a\n};","/*! https://mths.be/punycode v1.4.1 by @mathias */\n;(function(root) {\n\n\t/** Detect free variables */\n\tvar freeExports = typeof exports == 'object' && exports &&\n\t\t!exports.nodeType && exports;\n\tvar freeModule = typeof module == 'object' && module &&\n\t\t!module.nodeType && module;\n\tvar freeGlobal = typeof global == 'object' && global;\n\tif (\n\t\tfreeGlobal.global === freeGlobal ||\n\t\tfreeGlobal.window === freeGlobal ||\n\t\tfreeGlobal.self === freeGlobal\n\t) {\n\t\troot = freeGlobal;\n\t}\n\n\t/**\n\t * The `punycode` object.\n\t * @name punycode\n\t * @type Object\n\t */\n\tvar punycode,\n\n\t/** Highest positive signed 32-bit float value */\n\tmaxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1\n\n\t/** Bootstring parameters */\n\tbase = 36,\n\ttMin = 1,\n\ttMax = 26,\n\tskew = 38,\n\tdamp = 700,\n\tinitialBias = 72,\n\tinitialN = 128, // 0x80\n\tdelimiter = '-', // '\\x2D'\n\n\t/** Regular expressions */\n\tregexPunycode = /^xn--/,\n\tregexNonASCII = /[^\\x20-\\x7E]/, // unprintable ASCII chars + non-ASCII chars\n\tregexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g, // RFC 3490 separators\n\n\t/** Error messages */\n\terrors = {\n\t\t'overflow': 'Overflow: input needs wider integers to process',\n\t\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t\t'invalid-input': 'Invalid input'\n\t},\n\n\t/** Convenience shortcuts */\n\tbaseMinusTMin = base - tMin,\n\tfloor = Math.floor,\n\tstringFromCharCode = String.fromCharCode,\n\n\t/** Temporary variable */\n\tkey;\n\n\t/*--------------------------------------------------------------------------*/\n\n\t/**\n\t * A generic error utility function.\n\t * @private\n\t * @param {String} type The error type.\n\t * @returns {Error} Throws a `RangeError` with the applicable error message.\n\t */\n\tfunction error(type) {\n\t\tthrow new RangeError(errors[type]);\n\t}\n\n\t/**\n\t * A generic `Array#map` utility function.\n\t * @private\n\t * @param {Array} array The array to iterate over.\n\t * @param {Function} callback The function that gets called for every array\n\t * item.\n\t * @returns {Array} A new array of values returned by the callback function.\n\t */\n\tfunction map(array, fn) {\n\t\tvar length = array.length;\n\t\tvar result = [];\n\t\twhile (length--) {\n\t\t\tresult[length] = fn(array[length]);\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * A simple `Array#map`-like wrapper to work with domain name strings or email\n\t * addresses.\n\t * @private\n\t * @param {String} domain The domain name or email address.\n\t * @param {Function} callback The function that gets called for every\n\t * character.\n\t * @returns {Array} A new string of characters returned by the callback\n\t * function.\n\t */\n\tfunction mapDomain(string, fn) {\n\t\tvar parts = string.split('@');\n\t\tvar result = '';\n\t\tif (parts.length > 1) {\n\t\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t\t// the local part (i.e. everything up to `@`) intact.\n\t\t\tresult = parts[0] + '@';\n\t\t\tstring = parts[1];\n\t\t}\n\t\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\t\tstring = string.replace(regexSeparators, '\\x2E');\n\t\tvar labels = string.split('.');\n\t\tvar encoded = map(labels, fn).join('.');\n\t\treturn result + encoded;\n\t}\n\n\t/**\n\t * Creates an array containing the numeric code points of each Unicode\n\t * character in the string. While JavaScript uses UCS-2 internally,\n\t * this function will convert a pair of surrogate halves (each of which\n\t * UCS-2 exposes as separate characters) into a single code point,\n\t * matching UTF-16.\n\t * @see `punycode.ucs2.encode`\n\t * @see \n\t * @memberOf punycode.ucs2\n\t * @name decode\n\t * @param {String} string The Unicode input string (UCS-2).\n\t * @returns {Array} The new array of code points.\n\t */\n\tfunction ucs2decode(string) {\n\t\tvar output = [],\n\t\t counter = 0,\n\t\t length = string.length,\n\t\t value,\n\t\t extra;\n\t\twhile (counter < length) {\n\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t} else {\n\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\toutput.push(value);\n\t\t\t\t\tcounter--;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\toutput.push(value);\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t}\n\n\t/**\n\t * Creates a string based on an array of numeric code points.\n\t * @see `punycode.ucs2.decode`\n\t * @memberOf punycode.ucs2\n\t * @name encode\n\t * @param {Array} codePoints The array of numeric code points.\n\t * @returns {String} The new Unicode string (UCS-2).\n\t */\n\tfunction ucs2encode(array) {\n\t\treturn map(array, function(value) {\n\t\t\tvar output = '';\n\t\t\tif (value > 0xFFFF) {\n\t\t\t\tvalue -= 0x10000;\n\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t}\n\t\t\toutput += stringFromCharCode(value);\n\t\t\treturn output;\n\t\t}).join('');\n\t}\n\n\t/**\n\t * Converts a basic code point into a digit/integer.\n\t * @see `digitToBasic()`\n\t * @private\n\t * @param {Number} codePoint The basic numeric code point value.\n\t * @returns {Number} The numeric value of a basic code point (for use in\n\t * representing integers) in the range `0` to `base - 1`, or `base` if\n\t * the code point does not represent a value.\n\t */\n\tfunction basicToDigit(codePoint) {\n\t\tif (codePoint - 48 < 10) {\n\t\t\treturn codePoint - 22;\n\t\t}\n\t\tif (codePoint - 65 < 26) {\n\t\t\treturn codePoint - 65;\n\t\t}\n\t\tif (codePoint - 97 < 26) {\n\t\t\treturn codePoint - 97;\n\t\t}\n\t\treturn base;\n\t}\n\n\t/**\n\t * Converts a digit/integer into a basic code point.\n\t * @see `basicToDigit()`\n\t * @private\n\t * @param {Number} digit The numeric value of a basic code point.\n\t * @returns {Number} The basic code point whose value (when used for\n\t * representing integers) is `digit`, which needs to be in the range\n\t * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n\t * used; else, the lowercase form is used. The behavior is undefined\n\t * if `flag` is non-zero and `digit` has no uppercase form.\n\t */\n\tfunction digitToBasic(digit, flag) {\n\t\t// 0..25 map to ASCII a..z or A..Z\n\t\t// 26..35 map to ASCII 0..9\n\t\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n\t}\n\n\t/**\n\t * Bias adaptation function as per section 3.4 of RFC 3492.\n\t * https://tools.ietf.org/html/rfc3492#section-3.4\n\t * @private\n\t */\n\tfunction adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}\n\n\t/**\n\t * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n\t * symbols.\n\t * @memberOf punycode\n\t * @param {String} input The Punycode string of ASCII-only symbols.\n\t * @returns {String} The resulting string of Unicode symbols.\n\t */\n\tfunction decode(input) {\n\t\t// Don't use UCS-2\n\t\tvar output = [],\n\t\t inputLength = input.length,\n\t\t out,\n\t\t i = 0,\n\t\t n = initialN,\n\t\t bias = initialBias,\n\t\t basic,\n\t\t j,\n\t\t index,\n\t\t oldi,\n\t\t w,\n\t\t k,\n\t\t digit,\n\t\t t,\n\t\t /** Cached calculation results */\n\t\t baseMinusT;\n\n\t\t// Handle the basic code points: let `basic` be the number of input code\n\t\t// points before the last delimiter, or `0` if there is none, then copy\n\t\t// the first basic code points to the output.\n\n\t\tbasic = input.lastIndexOf(delimiter);\n\t\tif (basic < 0) {\n\t\t\tbasic = 0;\n\t\t}\n\n\t\tfor (j = 0; j < basic; ++j) {\n\t\t\t// if it's not a basic code point\n\t\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\t\terror('not-basic');\n\t\t\t}\n\t\t\toutput.push(input.charCodeAt(j));\n\t\t}\n\n\t\t// Main decoding loop: start just after the last delimiter if any basic code\n\t\t// points were copied; start at the beginning otherwise.\n\n\t\tfor (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t\t// `index` is the index of the next character to be consumed.\n\t\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t\t// which gets added to `i`. The overflow checking is easier\n\t\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t\t// value at the end to obtain `delta`.\n\t\t\tfor (oldi = i, w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\t\tif (index >= inputLength) {\n\t\t\t\t\terror('invalid-input');\n\t\t\t\t}\n\n\t\t\t\tdigit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\ti += digit * w;\n\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\t\tif (digit < t) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tbaseMinusT = base - t;\n\t\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\tw *= baseMinusT;\n\n\t\t\t}\n\n\t\t\tout = output.length + 1;\n\t\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t\t// incrementing `n` each time, so we'll fix that now:\n\t\t\tif (floor(i / out) > maxInt - n) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tn += floor(i / out);\n\t\t\ti %= out;\n\n\t\t\t// Insert `n` at position `i` of the output\n\t\t\toutput.splice(i++, 0, n);\n\n\t\t}\n\n\t\treturn ucs2encode(output);\n\t}\n\n\t/**\n\t * Converts a string of Unicode symbols (e.g. a domain name label) to a\n\t * Punycode string of ASCII-only symbols.\n\t * @memberOf punycode\n\t * @param {String} input The string of Unicode symbols.\n\t * @returns {String} The resulting Punycode string of ASCII-only symbols.\n\t */\n\tfunction encode(input) {\n\t\tvar n,\n\t\t delta,\n\t\t handledCPCount,\n\t\t basicLength,\n\t\t bias,\n\t\t j,\n\t\t m,\n\t\t q,\n\t\t k,\n\t\t t,\n\t\t currentValue,\n\t\t output = [],\n\t\t /** `inputLength` will hold the number of code points in `input`. */\n\t\t inputLength,\n\t\t /** Cached calculation results */\n\t\t handledCPCountPlusOne,\n\t\t baseMinusT,\n\t\t qMinusT;\n\n\t\t// Convert the input in UCS-2 to Unicode\n\t\tinput = ucs2decode(input);\n\n\t\t// Cache the length\n\t\tinputLength = input.length;\n\n\t\t// Initialize the state\n\t\tn = initialN;\n\t\tdelta = 0;\n\t\tbias = initialBias;\n\n\t\t// Handle the basic code points\n\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\tcurrentValue = input[j];\n\t\t\tif (currentValue < 0x80) {\n\t\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t\t}\n\t\t}\n\n\t\thandledCPCount = basicLength = output.length;\n\n\t\t// `handledCPCount` is the number of code points that have been handled;\n\t\t// `basicLength` is the number of basic code points.\n\n\t\t// Finish the basic string - if it is not empty - with a delimiter\n\t\tif (basicLength) {\n\t\t\toutput.push(delimiter);\n\t\t}\n\n\t\t// Main encoding loop:\n\t\twhile (handledCPCount < inputLength) {\n\n\t\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t\t// larger one:\n\t\t\tfor (m = maxInt, j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\t\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\t\tm = currentValue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Increase `delta` enough to advance the decoder's state to ,\n\t\t\t// but guard against overflow\n\t\t\thandledCPCountPlusOne = handledCPCount + 1;\n\t\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\t\tn = m;\n\n\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\n\t\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\tif (currentValue == n) {\n\t\t\t\t\t// Represent delta as a generalized variable-length integer\n\t\t\t\t\tfor (q = delta, k = base; /* no condition */; k += base) {\n\t\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tqMinusT = q - t;\n\t\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\t\toutput.push(\n\t\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t\t);\n\t\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t\t}\n\n\t\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\t\tdelta = 0;\n\t\t\t\t\t++handledCPCount;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t++delta;\n\t\t\t++n;\n\n\t\t}\n\t\treturn output.join('');\n\t}\n\n\t/**\n\t * Converts a Punycode string representing a domain name or an email address\n\t * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n\t * it doesn't matter if you call it on a string that has already been\n\t * converted to Unicode.\n\t * @memberOf punycode\n\t * @param {String} input The Punycoded domain name or email address to\n\t * convert to Unicode.\n\t * @returns {String} The Unicode representation of the given Punycode\n\t * string.\n\t */\n\tfunction toUnicode(input) {\n\t\treturn mapDomain(input, function(string) {\n\t\t\treturn regexPunycode.test(string)\n\t\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t\t: string;\n\t\t});\n\t}\n\n\t/**\n\t * Converts a Unicode string representing a domain name or an email address to\n\t * Punycode. Only the non-ASCII parts of the domain name will be converted,\n\t * i.e. it doesn't matter if you call it with a domain that's already in\n\t * ASCII.\n\t * @memberOf punycode\n\t * @param {String} input The domain name or email address to convert, as a\n\t * Unicode string.\n\t * @returns {String} The Punycode representation of the given domain name or\n\t * email address.\n\t */\n\tfunction toASCII(input) {\n\t\treturn mapDomain(input, function(string) {\n\t\t\treturn regexNonASCII.test(string)\n\t\t\t\t? 'xn--' + encode(string)\n\t\t\t\t: string;\n\t\t});\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\t/** Define the public API */\n\tpunycode = {\n\t\t/**\n\t\t * A string representing the current Punycode.js version number.\n\t\t * @memberOf punycode\n\t\t * @type String\n\t\t */\n\t\t'version': '1.4.1',\n\t\t/**\n\t\t * An object of methods to convert from JavaScript's internal character\n\t\t * representation (UCS-2) to Unicode code points, and back.\n\t\t * @see \n\t\t * @memberOf punycode\n\t\t * @type Object\n\t\t */\n\t\t'ucs2': {\n\t\t\t'decode': ucs2decode,\n\t\t\t'encode': ucs2encode\n\t\t},\n\t\t'decode': decode,\n\t\t'encode': encode,\n\t\t'toASCII': toASCII,\n\t\t'toUnicode': toUnicode\n\t};\n\n\t/** Expose `punycode` */\n\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t// like the following:\n\tif (\n\t\ttypeof define == 'function' &&\n\t\ttypeof define.amd == 'object' &&\n\t\tdefine.amd\n\t) {\n\t\tdefine('punycode', function() {\n\t\t\treturn punycode;\n\t\t});\n\t} else if (freeExports && freeModule) {\n\t\tif (module.exports == freeExports) {\n\t\t\t// in Node.js, io.js, or RingoJS v0.8.0+\n\t\t\tfreeModule.exports = punycode;\n\t\t} else {\n\t\t\t// in Narwhal or RingoJS v0.7.0-\n\t\t\tfor (key in punycode) {\n\t\t\t\tpunycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// in Rhino or a web browser\n\t\troot.punycode = punycode;\n\t}\n\n}(this));\n","'use strict';\nvar strictUriEncode = require('strict-uri-encode');\nvar objectAssign = require('object-assign');\nvar decodeComponent = require('decode-uri-component');\n\nfunction encoderForArrayFormat(opts) {\n\tswitch (opts.arrayFormat) {\n\t\tcase 'index':\n\t\t\treturn function (key, value, index) {\n\t\t\t\treturn value === null ? [\n\t\t\t\t\tencode(key, opts),\n\t\t\t\t\t'[',\n\t\t\t\t\tindex,\n\t\t\t\t\t']'\n\t\t\t\t].join('') : [\n\t\t\t\t\tencode(key, opts),\n\t\t\t\t\t'[',\n\t\t\t\t\tencode(index, opts),\n\t\t\t\t\t']=',\n\t\t\t\t\tencode(value, opts)\n\t\t\t\t].join('');\n\t\t\t};\n\n\t\tcase 'bracket':\n\t\t\treturn function (key, value) {\n\t\t\t\treturn value === null ? encode(key, opts) : [\n\t\t\t\t\tencode(key, opts),\n\t\t\t\t\t'[]=',\n\t\t\t\t\tencode(value, opts)\n\t\t\t\t].join('');\n\t\t\t};\n\n\t\tdefault:\n\t\t\treturn function (key, value) {\n\t\t\t\treturn value === null ? encode(key, opts) : [\n\t\t\t\t\tencode(key, opts),\n\t\t\t\t\t'=',\n\t\t\t\t\tencode(value, opts)\n\t\t\t\t].join('');\n\t\t\t};\n\t}\n}\n\nfunction parserForArrayFormat(opts) {\n\tvar result;\n\n\tswitch (opts.arrayFormat) {\n\t\tcase 'index':\n\t\t\treturn function (key, value, accumulator) {\n\t\t\t\tresult = /\\[(\\d*)\\]$/.exec(key);\n\n\t\t\t\tkey = key.replace(/\\[\\d*\\]$/, '');\n\n\t\t\t\tif (!result) {\n\t\t\t\t\taccumulator[key] = value;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (accumulator[key] === undefined) {\n\t\t\t\t\taccumulator[key] = {};\n\t\t\t\t}\n\n\t\t\t\taccumulator[key][result[1]] = value;\n\t\t\t};\n\n\t\tcase 'bracket':\n\t\t\treturn function (key, value, accumulator) {\n\t\t\t\tresult = /(\\[\\])$/.exec(key);\n\t\t\t\tkey = key.replace(/\\[\\]$/, '');\n\n\t\t\t\tif (!result) {\n\t\t\t\t\taccumulator[key] = value;\n\t\t\t\t\treturn;\n\t\t\t\t} else if (accumulator[key] === undefined) {\n\t\t\t\t\taccumulator[key] = [value];\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\taccumulator[key] = [].concat(accumulator[key], value);\n\t\t\t};\n\n\t\tdefault:\n\t\t\treturn function (key, value, accumulator) {\n\t\t\t\tif (accumulator[key] === undefined) {\n\t\t\t\t\taccumulator[key] = value;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\taccumulator[key] = [].concat(accumulator[key], value);\n\t\t\t};\n\t}\n}\n\nfunction encode(value, opts) {\n\tif (opts.encode) {\n\t\treturn opts.strict ? strictUriEncode(value) : encodeURIComponent(value);\n\t}\n\n\treturn value;\n}\n\nfunction keysSorter(input) {\n\tif (Array.isArray(input)) {\n\t\treturn input.sort();\n\t} else if (typeof input === 'object') {\n\t\treturn keysSorter(Object.keys(input)).sort(function (a, b) {\n\t\t\treturn Number(a) - Number(b);\n\t\t}).map(function (key) {\n\t\t\treturn input[key];\n\t\t});\n\t}\n\n\treturn input;\n}\n\nexports.extract = function (str) {\n\tvar queryStart = str.indexOf('?');\n\tif (queryStart === -1) {\n\t\treturn '';\n\t}\n\treturn str.slice(queryStart + 1);\n};\n\nexports.parse = function (str, opts) {\n\topts = objectAssign({arrayFormat: 'none'}, opts);\n\n\tvar formatter = parserForArrayFormat(opts);\n\n\t// Create an object with no prototype\n\t// https://github.com/sindresorhus/query-string/issues/47\n\tvar ret = Object.create(null);\n\n\tif (typeof str !== 'string') {\n\t\treturn ret;\n\t}\n\n\tstr = str.trim().replace(/^[?#&]/, '');\n\n\tif (!str) {\n\t\treturn ret;\n\t}\n\n\tstr.split('&').forEach(function (param) {\n\t\tvar parts = param.replace(/\\+/g, ' ').split('=');\n\t\t// Firefox (pre 40) decodes `%3D` to `=`\n\t\t// https://github.com/sindresorhus/query-string/pull/37\n\t\tvar key = parts.shift();\n\t\tvar val = parts.length > 0 ? parts.join('=') : undefined;\n\n\t\t// missing `=` should be `null`:\n\t\t// http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters\n\t\tval = val === undefined ? null : decodeComponent(val);\n\n\t\tformatter(decodeComponent(key), val, ret);\n\t});\n\n\treturn Object.keys(ret).sort().reduce(function (result, key) {\n\t\tvar val = ret[key];\n\t\tif (Boolean(val) && typeof val === 'object' && !Array.isArray(val)) {\n\t\t\t// Sort object keys, not values\n\t\t\tresult[key] = keysSorter(val);\n\t\t} else {\n\t\t\tresult[key] = val;\n\t\t}\n\n\t\treturn result;\n\t}, Object.create(null));\n};\n\nexports.stringify = function (obj, opts) {\n\tvar defaults = {\n\t\tencode: true,\n\t\tstrict: true,\n\t\tarrayFormat: 'none'\n\t};\n\n\topts = objectAssign(defaults, opts);\n\n\tif (opts.sort === false) {\n\t\topts.sort = function () {};\n\t}\n\n\tvar formatter = encoderForArrayFormat(opts);\n\n\treturn obj ? Object.keys(obj).sort(opts.sort).map(function (key) {\n\t\tvar val = obj[key];\n\n\t\tif (val === undefined) {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (val === null) {\n\t\t\treturn encode(key, opts);\n\t\t}\n\n\t\tif (Array.isArray(val)) {\n\t\t\tvar result = [];\n\n\t\t\tval.slice().forEach(function (val2) {\n\t\t\t\tif (val2 === undefined) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tresult.push(formatter(key, val2, result.length));\n\t\t\t});\n\n\t\t\treturn result.join('&');\n\t\t}\n\n\t\treturn encode(key, opts) + '=' + encode(val, opts);\n\t}).filter(function (x) {\n\t\treturn x.length > 0;\n\t}).join('&') : '';\n};\n\nexports.parseUrl = function (str, opts) {\n\treturn {\n\t\turl: str.split('?')[0] || '',\n\t\tquery: this.parse(this.extract(str), opts)\n\t};\n};\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\n// If obj.hasOwnProperty has been overridden, then calling\n// obj.hasOwnProperty(prop) will break.\n// See: https://github.com/joyent/node/issues/1707\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nmodule.exports = function(qs, sep, eq, options) {\n sep = sep || '&';\n eq = eq || '=';\n var obj = {};\n\n if (typeof qs !== 'string' || qs.length === 0) {\n return obj;\n }\n\n var regexp = /\\+/g;\n qs = qs.split(sep);\n\n var maxKeys = 1000;\n if (options && typeof options.maxKeys === 'number') {\n maxKeys = options.maxKeys;\n }\n\n var len = qs.length;\n // maxKeys <= 0 means that we should not limit keys count\n if (maxKeys > 0 && len > maxKeys) {\n len = maxKeys;\n }\n\n for (var i = 0; i < len; ++i) {\n var x = qs[i].replace(regexp, '%20'),\n idx = x.indexOf(eq),\n kstr, vstr, k, v;\n\n if (idx >= 0) {\n kstr = x.substr(0, idx);\n vstr = x.substr(idx + 1);\n } else {\n kstr = x;\n vstr = '';\n }\n\n k = decodeURIComponent(kstr);\n v = decodeURIComponent(vstr);\n\n if (!hasOwnProperty(obj, k)) {\n obj[k] = v;\n } else if (isArray(obj[k])) {\n obj[k].push(v);\n } else {\n obj[k] = [obj[k], v];\n }\n }\n\n return obj;\n};\n\nvar isArray = Array.isArray || function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]';\n};\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar stringifyPrimitive = function(v) {\n switch (typeof v) {\n case 'string':\n return v;\n\n case 'boolean':\n return v ? 'true' : 'false';\n\n case 'number':\n return isFinite(v) ? v : '';\n\n default:\n return '';\n }\n};\n\nmodule.exports = function(obj, sep, eq, name) {\n sep = sep || '&';\n eq = eq || '=';\n if (obj === null) {\n obj = undefined;\n }\n\n if (typeof obj === 'object') {\n return map(objectKeys(obj), function(k) {\n var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;\n if (isArray(obj[k])) {\n return map(obj[k], function(v) {\n return ks + encodeURIComponent(stringifyPrimitive(v));\n }).join(sep);\n } else {\n return ks + encodeURIComponent(stringifyPrimitive(obj[k]));\n }\n }).join(sep);\n\n }\n\n if (!name) return '';\n return encodeURIComponent(stringifyPrimitive(name)) + eq +\n encodeURIComponent(stringifyPrimitive(obj));\n};\n\nvar isArray = Array.isArray || function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]';\n};\n\nfunction map (xs, f) {\n if (xs.map) return xs.map(f);\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n res.push(f(xs[i], i));\n }\n return res;\n}\n\nvar objectKeys = Object.keys || function (obj) {\n var res = [];\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key);\n }\n return res;\n};\n","'use strict';\n\nexports.decode = exports.parse = require('./decode');\nexports.encode = exports.stringify = require('./encode');\n","'use strict'\n\nfunction oldBrowser () {\n throw new Error('Secure random number generation is not supported by this browser.\\nUse Chrome, Firefox or Internet Explorer 11')\n}\n\nvar Buffer = require('safe-buffer').Buffer\nvar crypto = global.crypto || global.msCrypto\n\nif (crypto && crypto.getRandomValues) {\n module.exports = randomBytes\n} else {\n module.exports = oldBrowser\n}\n\nfunction randomBytes (size, cb) {\n // phantomjs needs to throw\n if (size > 65536) throw new Error('requested too many random bytes')\n // in case browserify isn't using the Uint8Array version\n var rawBytes = new global.Uint8Array(size)\n\n // This will not work in older browsers.\n // See https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues\n if (size > 0) { // getRandomValues fails on IE if size == 0\n crypto.getRandomValues(rawBytes)\n }\n\n // XXX: phantomjs doesn't like a buffer being passed here\n var bytes = Buffer.from(rawBytes.buffer)\n\n if (typeof cb === 'function') {\n return process.nextTick(function () {\n cb(null, bytes)\n })\n }\n\n return bytes\n}\n","'use strict'\n\nfunction oldBrowser () {\n throw new Error('secure random number generation not supported by this browser\\nuse chrome, FireFox or Internet Explorer 11')\n}\nvar safeBuffer = require('safe-buffer')\nvar randombytes = require('randombytes')\nvar Buffer = safeBuffer.Buffer\nvar kBufferMaxLength = safeBuffer.kMaxLength\nvar crypto = global.crypto || global.msCrypto\nvar kMaxUint32 = Math.pow(2, 32) - 1\nfunction assertOffset (offset, length) {\n if (typeof offset !== 'number' || offset !== offset) { // eslint-disable-line no-self-compare\n throw new TypeError('offset must be a number')\n }\n\n if (offset > kMaxUint32 || offset < 0) {\n throw new TypeError('offset must be a uint32')\n }\n\n if (offset > kBufferMaxLength || offset > length) {\n throw new RangeError('offset out of range')\n }\n}\n\nfunction assertSize (size, offset, length) {\n if (typeof size !== 'number' || size !== size) { // eslint-disable-line no-self-compare\n throw new TypeError('size must be a number')\n }\n\n if (size > kMaxUint32 || size < 0) {\n throw new TypeError('size must be a uint32')\n }\n\n if (size + offset > length || size > kBufferMaxLength) {\n throw new RangeError('buffer too small')\n }\n}\nif ((crypto && crypto.getRandomValues) || !process.browser) {\n exports.randomFill = randomFill\n exports.randomFillSync = randomFillSync\n} else {\n exports.randomFill = oldBrowser\n exports.randomFillSync = oldBrowser\n}\nfunction randomFill (buf, offset, size, cb) {\n if (!Buffer.isBuffer(buf) && !(buf instanceof global.Uint8Array)) {\n throw new TypeError('\"buf\" argument must be a Buffer or Uint8Array')\n }\n\n if (typeof offset === 'function') {\n cb = offset\n offset = 0\n size = buf.length\n } else if (typeof size === 'function') {\n cb = size\n size = buf.length - offset\n } else if (typeof cb !== 'function') {\n throw new TypeError('\"cb\" argument must be a function')\n }\n assertOffset(offset, buf.length)\n assertSize(size, offset, buf.length)\n return actualFill(buf, offset, size, cb)\n}\n\nfunction actualFill (buf, offset, size, cb) {\n if (process.browser) {\n var ourBuf = buf.buffer\n var uint = new Uint8Array(ourBuf, offset, size)\n crypto.getRandomValues(uint)\n if (cb) {\n process.nextTick(function () {\n cb(null, buf)\n })\n return\n }\n return buf\n }\n if (cb) {\n randombytes(size, function (err, bytes) {\n if (err) {\n return cb(err)\n }\n bytes.copy(buf, offset)\n cb(null, buf)\n })\n return\n }\n var bytes = randombytes(size)\n bytes.copy(buf, offset)\n return buf\n}\nfunction randomFillSync (buf, offset, size) {\n if (typeof offset === 'undefined') {\n offset = 0\n }\n if (!Buffer.isBuffer(buf) && !(buf instanceof global.Uint8Array)) {\n throw new TypeError('\"buf\" argument must be a Buffer or Uint8Array')\n }\n\n assertOffset(offset, buf.length)\n\n if (size === undefined) size = buf.length - offset\n\n assertSize(size, offset, buf.length)\n\n return actualFill(buf, offset, size)\n}\n","module.exports = window.crypto;","module.exports = require('crypto');","var randomHex = function(size, callback) {\n var crypto = require('./crypto.js');\n var isCallback = (typeof callback === 'function');\n\n \n if (size > 65536) {\n if(isCallback) {\n callback(new Error('Requested too many random bytes.'));\n } else {\n throw new Error('Requested too many random bytes.');\n }\n };\n\n\n // is node\n if (typeof crypto !== 'undefined' && crypto.randomBytes) {\n\n if(isCallback) {\n crypto.randomBytes(size, function(err, result){\n if(!err) {\n callback(null, '0x'+ result.toString('hex'));\n } else {\n callback(error);\n }\n })\n } else {\n return '0x'+ crypto.randomBytes(size).toString('hex');\n }\n\n // is browser\n } else {\n var cryptoLib;\n\n if (typeof crypto !== 'undefined') {\n cryptoLib = crypto;\n } else if(typeof msCrypto !== 'undefined') {\n cryptoLib = msCrypto;\n }\n\n if (cryptoLib && cryptoLib.getRandomValues) {\n var randomBytes = cryptoLib.getRandomValues(new Uint8Array(size));\n var returnValue = '0x'+ Array.from(randomBytes).map(function(arr){ return arr.toString(16); }).join('');\n\n if(isCallback) {\n callback(null, returnValue);\n } else {\n return returnValue;\n }\n\n // not crypto object\n } else {\n var error = new Error('No \"crypto\" object available. This Browser doesn\\'t support generating secure random bytes.');\n\n if(isCallback) {\n callback(error);\n } else {\n throw error;\n }\n }\n }\n};\n\n\nmodule.exports = randomHex;\n","/** @license React v16.2.0\n * react-dom.development.js\n *\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar React = require('react');\nvar invariant = require('fbjs/lib/invariant');\nvar warning = require('fbjs/lib/warning');\nvar ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');\nvar _assign = require('object-assign');\nvar emptyFunction = require('fbjs/lib/emptyFunction');\nvar EventListener = require('fbjs/lib/EventListener');\nvar getActiveElement = require('fbjs/lib/getActiveElement');\nvar shallowEqual = require('fbjs/lib/shallowEqual');\nvar containsNode = require('fbjs/lib/containsNode');\nvar focusNode = require('fbjs/lib/focusNode');\nvar emptyObject = require('fbjs/lib/emptyObject');\nvar checkPropTypes = require('prop-types/checkPropTypes');\nvar hyphenateStyleName = require('fbjs/lib/hyphenateStyleName');\nvar camelizeStyleName = require('fbjs/lib/camelizeStyleName');\n\n/**\n * WARNING: DO NOT manually require this module.\n * This is a replacement for `invariant(...)` used by the error code system\n * and will _only_ be required by the corresponding babel pass.\n * It always throws.\n */\n\n!React ? invariant(false, 'ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM.') : void 0;\n\n// These attributes should be all lowercase to allow for\n// case insensitive checks\nvar RESERVED_PROPS = {\n children: true,\n dangerouslySetInnerHTML: true,\n defaultValue: true,\n defaultChecked: true,\n innerHTML: true,\n suppressContentEditableWarning: true,\n suppressHydrationWarning: true,\n style: true\n};\n\nfunction checkMask(value, bitmask) {\n return (value & bitmask) === bitmask;\n}\n\nvar DOMPropertyInjection = {\n /**\n * Mapping from normalized, camelcased property names to a configuration that\n * specifies how the associated DOM property should be accessed or rendered.\n */\n MUST_USE_PROPERTY: 0x1,\n HAS_BOOLEAN_VALUE: 0x4,\n HAS_NUMERIC_VALUE: 0x8,\n HAS_POSITIVE_NUMERIC_VALUE: 0x10 | 0x8,\n HAS_OVERLOADED_BOOLEAN_VALUE: 0x20,\n HAS_STRING_BOOLEAN_VALUE: 0x40,\n\n /**\n * Inject some specialized knowledge about the DOM. This takes a config object\n * with the following properties:\n *\n * Properties: object mapping DOM property name to one of the\n * DOMPropertyInjection constants or null. If your attribute isn't in here,\n * it won't get written to the DOM.\n *\n * DOMAttributeNames: object mapping React attribute name to the DOM\n * attribute name. Attribute names not specified use the **lowercase**\n * normalized name.\n *\n * DOMAttributeNamespaces: object mapping React attribute name to the DOM\n * attribute namespace URL. (Attribute names not specified use no namespace.)\n *\n * DOMPropertyNames: similar to DOMAttributeNames but for DOM properties.\n * Property names not specified use the normalized name.\n *\n * DOMMutationMethods: Properties that require special mutation methods. If\n * `value` is undefined, the mutation method should unset the property.\n *\n * @param {object} domPropertyConfig the config as described above.\n */\n injectDOMPropertyConfig: function (domPropertyConfig) {\n var Injection = DOMPropertyInjection;\n var Properties = domPropertyConfig.Properties || {};\n var DOMAttributeNamespaces = domPropertyConfig.DOMAttributeNamespaces || {};\n var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {};\n var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {};\n\n for (var propName in Properties) {\n !!properties.hasOwnProperty(propName) ? invariant(false, \"injectDOMPropertyConfig(...): You're trying to inject DOM property '%s' which has already been injected. You may be accidentally injecting the same DOM property config twice, or you may be injecting two configs that have conflicting property names.\", propName) : void 0;\n\n var lowerCased = propName.toLowerCase();\n var propConfig = Properties[propName];\n\n var propertyInfo = {\n attributeName: lowerCased,\n attributeNamespace: null,\n propertyName: propName,\n mutationMethod: null,\n\n mustUseProperty: checkMask(propConfig, Injection.MUST_USE_PROPERTY),\n hasBooleanValue: checkMask(propConfig, Injection.HAS_BOOLEAN_VALUE),\n hasNumericValue: checkMask(propConfig, Injection.HAS_NUMERIC_VALUE),\n hasPositiveNumericValue: checkMask(propConfig, Injection.HAS_POSITIVE_NUMERIC_VALUE),\n hasOverloadedBooleanValue: checkMask(propConfig, Injection.HAS_OVERLOADED_BOOLEAN_VALUE),\n hasStringBooleanValue: checkMask(propConfig, Injection.HAS_STRING_BOOLEAN_VALUE)\n };\n !(propertyInfo.hasBooleanValue + propertyInfo.hasNumericValue + propertyInfo.hasOverloadedBooleanValue <= 1) ? invariant(false, \"DOMProperty: Value can be one of boolean, overloaded boolean, or numeric value, but not a combination: %s\", propName) : void 0;\n\n if (DOMAttributeNames.hasOwnProperty(propName)) {\n var attributeName = DOMAttributeNames[propName];\n\n propertyInfo.attributeName = attributeName;\n }\n\n if (DOMAttributeNamespaces.hasOwnProperty(propName)) {\n propertyInfo.attributeNamespace = DOMAttributeNamespaces[propName];\n }\n\n if (DOMMutationMethods.hasOwnProperty(propName)) {\n propertyInfo.mutationMethod = DOMMutationMethods[propName];\n }\n\n // Downcase references to whitelist properties to check for membership\n // without case-sensitivity. This allows the whitelist to pick up\n // `allowfullscreen`, which should be written using the property configuration\n // for `allowFullscreen`\n properties[propName] = propertyInfo;\n }\n }\n};\n\n/* eslint-disable max-len */\nvar ATTRIBUTE_NAME_START_CHAR = \":A-Z_a-z\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02FF\\\\u0370-\\\\u037D\\\\u037F-\\\\u1FFF\\\\u200C-\\\\u200D\\\\u2070-\\\\u218F\\\\u2C00-\\\\u2FEF\\\\u3001-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFFD\";\n/* eslint-enable max-len */\nvar ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + \"\\\\-.0-9\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040\";\n\n\nvar ROOT_ATTRIBUTE_NAME = 'data-reactroot';\n\n/**\n * Map from property \"standard name\" to an object with info about how to set\n * the property in the DOM. Each object contains:\n *\n * attributeName:\n * Used when rendering markup or with `*Attribute()`.\n * attributeNamespace\n * propertyName:\n * Used on DOM node instances. (This includes properties that mutate due to\n * external factors.)\n * mutationMethod:\n * If non-null, used instead of the property or `setAttribute()` after\n * initial render.\n * mustUseProperty:\n * Whether the property must be accessed and mutated as an object property.\n * hasBooleanValue:\n * Whether the property should be removed when set to a falsey value.\n * hasNumericValue:\n * Whether the property must be numeric or parse as a numeric and should be\n * removed when set to a falsey value.\n * hasPositiveNumericValue:\n * Whether the property must be positive numeric or parse as a positive\n * numeric and should be removed when set to a falsey value.\n * hasOverloadedBooleanValue:\n * Whether the property can be used as a flag as well as with a value.\n * Removed when strictly equal to false; present without a value when\n * strictly equal to true; present with a value otherwise.\n */\nvar properties = {};\n\n/**\n * Checks whether a property name is a writeable attribute.\n * @method\n */\nfunction shouldSetAttribute(name, value) {\n if (isReservedProp(name)) {\n return false;\n }\n if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {\n return false;\n }\n if (value === null) {\n return true;\n }\n switch (typeof value) {\n case 'boolean':\n return shouldAttributeAcceptBooleanValue(name);\n case 'undefined':\n case 'number':\n case 'string':\n case 'object':\n return true;\n default:\n // function, symbol\n return false;\n }\n}\n\nfunction getPropertyInfo(name) {\n return properties.hasOwnProperty(name) ? properties[name] : null;\n}\n\nfunction shouldAttributeAcceptBooleanValue(name) {\n if (isReservedProp(name)) {\n return true;\n }\n var propertyInfo = getPropertyInfo(name);\n if (propertyInfo) {\n return propertyInfo.hasBooleanValue || propertyInfo.hasStringBooleanValue || propertyInfo.hasOverloadedBooleanValue;\n }\n var prefix = name.toLowerCase().slice(0, 5);\n return prefix === 'data-' || prefix === 'aria-';\n}\n\n/**\n * Checks to see if a property name is within the list of properties\n * reserved for internal React operations. These properties should\n * not be set on an HTML element.\n *\n * @private\n * @param {string} name\n * @return {boolean} If the name is within reserved props\n */\nfunction isReservedProp(name) {\n return RESERVED_PROPS.hasOwnProperty(name);\n}\n\nvar injection = DOMPropertyInjection;\n\nvar MUST_USE_PROPERTY = injection.MUST_USE_PROPERTY;\nvar HAS_BOOLEAN_VALUE = injection.HAS_BOOLEAN_VALUE;\nvar HAS_NUMERIC_VALUE = injection.HAS_NUMERIC_VALUE;\nvar HAS_POSITIVE_NUMERIC_VALUE = injection.HAS_POSITIVE_NUMERIC_VALUE;\nvar HAS_OVERLOADED_BOOLEAN_VALUE = injection.HAS_OVERLOADED_BOOLEAN_VALUE;\nvar HAS_STRING_BOOLEAN_VALUE = injection.HAS_STRING_BOOLEAN_VALUE;\n\nvar HTMLDOMPropertyConfig = {\n // When adding attributes to this list, be sure to also add them to\n // the `possibleStandardNames` module to ensure casing and incorrect\n // name warnings.\n Properties: {\n allowFullScreen: HAS_BOOLEAN_VALUE,\n // specifies target context for links with `preload` type\n async: HAS_BOOLEAN_VALUE,\n // Note: there is a special case that prevents it from being written to the DOM\n // on the client side because the browsers are inconsistent. Instead we call focus().\n autoFocus: HAS_BOOLEAN_VALUE,\n autoPlay: HAS_BOOLEAN_VALUE,\n capture: HAS_OVERLOADED_BOOLEAN_VALUE,\n checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,\n cols: HAS_POSITIVE_NUMERIC_VALUE,\n contentEditable: HAS_STRING_BOOLEAN_VALUE,\n controls: HAS_BOOLEAN_VALUE,\n 'default': HAS_BOOLEAN_VALUE,\n defer: HAS_BOOLEAN_VALUE,\n disabled: HAS_BOOLEAN_VALUE,\n download: HAS_OVERLOADED_BOOLEAN_VALUE,\n draggable: HAS_STRING_BOOLEAN_VALUE,\n formNoValidate: HAS_BOOLEAN_VALUE,\n hidden: HAS_BOOLEAN_VALUE,\n loop: HAS_BOOLEAN_VALUE,\n // Caution; `option.selected` is not updated if `select.multiple` is\n // disabled with `removeAttribute`.\n multiple: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,\n muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,\n noValidate: HAS_BOOLEAN_VALUE,\n open: HAS_BOOLEAN_VALUE,\n playsInline: HAS_BOOLEAN_VALUE,\n readOnly: HAS_BOOLEAN_VALUE,\n required: HAS_BOOLEAN_VALUE,\n reversed: HAS_BOOLEAN_VALUE,\n rows: HAS_POSITIVE_NUMERIC_VALUE,\n rowSpan: HAS_NUMERIC_VALUE,\n scoped: HAS_BOOLEAN_VALUE,\n seamless: HAS_BOOLEAN_VALUE,\n selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,\n size: HAS_POSITIVE_NUMERIC_VALUE,\n start: HAS_NUMERIC_VALUE,\n // support for projecting regular DOM Elements via V1 named slots ( shadow dom )\n span: HAS_POSITIVE_NUMERIC_VALUE,\n spellCheck: HAS_STRING_BOOLEAN_VALUE,\n // Style must be explicitly set in the attribute list. React components\n // expect a style object\n style: 0,\n // Keep it in the whitelist because it is case-sensitive for SVG.\n tabIndex: 0,\n // itemScope is for for Microdata support.\n // See http://schema.org/docs/gs.html\n itemScope: HAS_BOOLEAN_VALUE,\n // These attributes must stay in the white-list because they have\n // different attribute names (see DOMAttributeNames below)\n acceptCharset: 0,\n className: 0,\n htmlFor: 0,\n httpEquiv: 0,\n // Attributes with mutation methods must be specified in the whitelist\n // Set the string boolean flag to allow the behavior\n value: HAS_STRING_BOOLEAN_VALUE\n },\n DOMAttributeNames: {\n acceptCharset: 'accept-charset',\n className: 'class',\n htmlFor: 'for',\n httpEquiv: 'http-equiv'\n },\n DOMMutationMethods: {\n value: function (node, value) {\n if (value == null) {\n return node.removeAttribute('value');\n }\n\n // Number inputs get special treatment due to some edge cases in\n // Chrome. Let everything else assign the value attribute as normal.\n // https://github.com/facebook/react/issues/7253#issuecomment-236074326\n if (node.type !== 'number' || node.hasAttribute('value') === false) {\n node.setAttribute('value', '' + value);\n } else if (node.validity && !node.validity.badInput && node.ownerDocument.activeElement !== node) {\n // Don't assign an attribute if validation reports bad\n // input. Chrome will clear the value. Additionally, don't\n // operate on inputs that have focus, otherwise Chrome might\n // strip off trailing decimal places and cause the user's\n // cursor position to jump to the beginning of the input.\n //\n // In ReactDOMInput, we have an onBlur event that will trigger\n // this function again when focus is lost.\n node.setAttribute('value', '' + value);\n }\n }\n }\n};\n\nvar HAS_STRING_BOOLEAN_VALUE$1 = injection.HAS_STRING_BOOLEAN_VALUE;\n\n\nvar NS = {\n xlink: 'http://www.w3.org/1999/xlink',\n xml: 'http://www.w3.org/XML/1998/namespace'\n};\n\n/**\n * This is a list of all SVG attributes that need special casing,\n * namespacing, or boolean value assignment.\n *\n * When adding attributes to this list, be sure to also add them to\n * the `possibleStandardNames` module to ensure casing and incorrect\n * name warnings.\n *\n * SVG Attributes List:\n * https://www.w3.org/TR/SVG/attindex.html\n * SMIL Spec:\n * https://www.w3.org/TR/smil\n */\nvar ATTRS = ['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'x-height', 'xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type', 'xml:base', 'xmlns:xlink', 'xml:lang', 'xml:space'];\n\nvar SVGDOMPropertyConfig = {\n Properties: {\n autoReverse: HAS_STRING_BOOLEAN_VALUE$1,\n externalResourcesRequired: HAS_STRING_BOOLEAN_VALUE$1,\n preserveAlpha: HAS_STRING_BOOLEAN_VALUE$1\n },\n DOMAttributeNames: {\n autoReverse: 'autoReverse',\n externalResourcesRequired: 'externalResourcesRequired',\n preserveAlpha: 'preserveAlpha'\n },\n DOMAttributeNamespaces: {\n xlinkActuate: NS.xlink,\n xlinkArcrole: NS.xlink,\n xlinkHref: NS.xlink,\n xlinkRole: NS.xlink,\n xlinkShow: NS.xlink,\n xlinkTitle: NS.xlink,\n xlinkType: NS.xlink,\n xmlBase: NS.xml,\n xmlLang: NS.xml,\n xmlSpace: NS.xml\n }\n};\n\nvar CAMELIZE = /[\\-\\:]([a-z])/g;\nvar capitalize = function (token) {\n return token[1].toUpperCase();\n};\n\nATTRS.forEach(function (original) {\n var reactName = original.replace(CAMELIZE, capitalize);\n\n SVGDOMPropertyConfig.Properties[reactName] = 0;\n SVGDOMPropertyConfig.DOMAttributeNames[reactName] = original;\n});\n\ninjection.injectDOMPropertyConfig(HTMLDOMPropertyConfig);\ninjection.injectDOMPropertyConfig(SVGDOMPropertyConfig);\n\nvar ReactErrorUtils = {\n // Used by Fiber to simulate a try-catch.\n _caughtError: null,\n _hasCaughtError: false,\n\n // Used by event system to capture/rethrow the first error.\n _rethrowError: null,\n _hasRethrowError: false,\n\n injection: {\n injectErrorUtils: function (injectedErrorUtils) {\n !(typeof injectedErrorUtils.invokeGuardedCallback === 'function') ? invariant(false, 'Injected invokeGuardedCallback() must be a function.') : void 0;\n invokeGuardedCallback = injectedErrorUtils.invokeGuardedCallback;\n }\n },\n\n /**\n * Call a function while guarding against errors that happens within it.\n * Returns an error if it throws, otherwise null.\n *\n * In production, this is implemented using a try-catch. The reason we don't\n * use a try-catch directly is so that we can swap out a different\n * implementation in DEV mode.\n *\n * @param {String} name of the guard to use for logging or debugging\n * @param {Function} func The function to invoke\n * @param {*} context The context to use when calling the function\n * @param {...*} args Arguments for function\n */\n invokeGuardedCallback: function (name, func, context, a, b, c, d, e, f) {\n invokeGuardedCallback.apply(ReactErrorUtils, arguments);\n },\n\n /**\n * Same as invokeGuardedCallback, but instead of returning an error, it stores\n * it in a global so it can be rethrown by `rethrowCaughtError` later.\n * TODO: See if _caughtError and _rethrowError can be unified.\n *\n * @param {String} name of the guard to use for logging or debugging\n * @param {Function} func The function to invoke\n * @param {*} context The context to use when calling the function\n * @param {...*} args Arguments for function\n */\n invokeGuardedCallbackAndCatchFirstError: function (name, func, context, a, b, c, d, e, f) {\n ReactErrorUtils.invokeGuardedCallback.apply(this, arguments);\n if (ReactErrorUtils.hasCaughtError()) {\n var error = ReactErrorUtils.clearCaughtError();\n if (!ReactErrorUtils._hasRethrowError) {\n ReactErrorUtils._hasRethrowError = true;\n ReactErrorUtils._rethrowError = error;\n }\n }\n },\n\n /**\n * During execution of guarded functions we will capture the first error which\n * we will rethrow to be handled by the top level error handler.\n */\n rethrowCaughtError: function () {\n return rethrowCaughtError.apply(ReactErrorUtils, arguments);\n },\n\n hasCaughtError: function () {\n return ReactErrorUtils._hasCaughtError;\n },\n\n clearCaughtError: function () {\n if (ReactErrorUtils._hasCaughtError) {\n var error = ReactErrorUtils._caughtError;\n ReactErrorUtils._caughtError = null;\n ReactErrorUtils._hasCaughtError = false;\n return error;\n } else {\n invariant(false, 'clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.');\n }\n }\n};\n\nvar invokeGuardedCallback = function (name, func, context, a, b, c, d, e, f) {\n ReactErrorUtils._hasCaughtError = false;\n ReactErrorUtils._caughtError = null;\n var funcArgs = Array.prototype.slice.call(arguments, 3);\n try {\n func.apply(context, funcArgs);\n } catch (error) {\n ReactErrorUtils._caughtError = error;\n ReactErrorUtils._hasCaughtError = true;\n }\n};\n\n{\n // In DEV mode, we swap out invokeGuardedCallback for a special version\n // that plays more nicely with the browser's DevTools. The idea is to preserve\n // \"Pause on exceptions\" behavior. Because React wraps all user-provided\n // functions in invokeGuardedCallback, and the production version of\n // invokeGuardedCallback uses a try-catch, all user exceptions are treated\n // like caught exceptions, and the DevTools won't pause unless the developer\n // takes the extra step of enabling pause on caught exceptions. This is\n // untintuitive, though, because even though React has caught the error, from\n // the developer's perspective, the error is uncaught.\n //\n // To preserve the expected \"Pause on exceptions\" behavior, we don't use a\n // try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake\n // DOM node, and call the user-provided callback from inside an event handler\n // for that fake event. If the callback throws, the error is \"captured\" using\n // a global event handler. But because the error happens in a different\n // event loop context, it does not interrupt the normal program flow.\n // Effectively, this gives us try-catch behavior without actually using\n // try-catch. Neat!\n\n // Check that the browser supports the APIs we need to implement our special\n // DEV version of invokeGuardedCallback\n if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {\n var fakeNode = document.createElement('react');\n\n var invokeGuardedCallbackDev = function (name, func, context, a, b, c, d, e, f) {\n // Keeps track of whether the user-provided callback threw an error. We\n // set this to true at the beginning, then set it to false right after\n // calling the function. If the function errors, `didError` will never be\n // set to false. This strategy works even if the browser is flaky and\n // fails to call our global error handler, because it doesn't rely on\n // the error event at all.\n var didError = true;\n\n // Create an event handler for our fake event. We will synchronously\n // dispatch our fake event using `dispatchEvent`. Inside the handler, we\n // call the user-provided callback.\n var funcArgs = Array.prototype.slice.call(arguments, 3);\n function callCallback() {\n // We immediately remove the callback from event listeners so that\n // nested `invokeGuardedCallback` calls do not clash. Otherwise, a\n // nested call would trigger the fake event handlers of any call higher\n // in the stack.\n fakeNode.removeEventListener(evtType, callCallback, false);\n func.apply(context, funcArgs);\n didError = false;\n }\n\n // Create a global error event handler. We use this to capture the value\n // that was thrown. It's possible that this error handler will fire more\n // than once; for example, if non-React code also calls `dispatchEvent`\n // and a handler for that event throws. We should be resilient to most of\n // those cases. Even if our error event handler fires more than once, the\n // last error event is always used. If the callback actually does error,\n // we know that the last error event is the correct one, because it's not\n // possible for anything else to have happened in between our callback\n // erroring and the code that follows the `dispatchEvent` call below. If\n // the callback doesn't error, but the error event was fired, we know to\n // ignore it because `didError` will be false, as described above.\n var error = void 0;\n // Use this to track whether the error event is ever called.\n var didSetError = false;\n var isCrossOriginError = false;\n\n function onError(event) {\n error = event.error;\n didSetError = true;\n if (error === null && event.colno === 0 && event.lineno === 0) {\n isCrossOriginError = true;\n }\n }\n\n // Create a fake event type.\n var evtType = 'react-' + (name ? name : 'invokeguardedcallback');\n\n // Attach our event handlers\n window.addEventListener('error', onError);\n fakeNode.addEventListener(evtType, callCallback, false);\n\n // Synchronously dispatch our fake event. If the user-provided function\n // errors, it will trigger our global error handler.\n var evt = document.createEvent('Event');\n evt.initEvent(evtType, false, false);\n fakeNode.dispatchEvent(evt);\n\n if (didError) {\n if (!didSetError) {\n // The callback errored, but the error event never fired.\n error = new Error('An error was thrown inside one of your components, but React ' + \"doesn't know what it was. This is likely due to browser \" + 'flakiness. React does its best to preserve the \"Pause on ' + 'exceptions\" behavior of the DevTools, which requires some ' + \"DEV-mode only tricks. It's possible that these don't work in \" + 'your browser. Try triggering the error in production mode, ' + 'or switching to a modern browser. If you suspect that this is ' + 'actually an issue with React, please file an issue.');\n } else if (isCrossOriginError) {\n error = new Error(\"A cross-origin error was thrown. React doesn't have access to \" + 'the actual error object in development. ' + 'See https://fb.me/react-crossorigin-error for more information.');\n }\n ReactErrorUtils._hasCaughtError = true;\n ReactErrorUtils._caughtError = error;\n } else {\n ReactErrorUtils._hasCaughtError = false;\n ReactErrorUtils._caughtError = null;\n }\n\n // Remove our event listeners\n window.removeEventListener('error', onError);\n };\n\n invokeGuardedCallback = invokeGuardedCallbackDev;\n }\n}\n\nvar rethrowCaughtError = function () {\n if (ReactErrorUtils._hasRethrowError) {\n var error = ReactErrorUtils._rethrowError;\n ReactErrorUtils._rethrowError = null;\n ReactErrorUtils._hasRethrowError = false;\n throw error;\n }\n};\n\n/**\n * Injectable ordering of event plugins.\n */\nvar eventPluginOrder = null;\n\n/**\n * Injectable mapping from names to event plugin modules.\n */\nvar namesToPlugins = {};\n\n/**\n * Recomputes the plugin list using the injected plugins and plugin ordering.\n *\n * @private\n */\nfunction recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;\n if (plugins[pluginIndex]) {\n continue;\n }\n !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n for (var eventName in publishedEvents) {\n !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;\n }\n }\n}\n\n/**\n * Publishes an event so that it can be dispatched by the supplied plugin.\n *\n * @param {object} dispatchConfig Dispatch configuration for the event.\n * @param {object} PluginModule Plugin publishing the event.\n * @return {boolean} True if the event was successfully published.\n * @private\n */\nfunction publishEventForPlugin(dispatchConfig, pluginModule, eventName) {\n !!eventNameDispatchConfigs.hasOwnProperty(eventName) ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same event name, `%s`.', eventName) : void 0;\n eventNameDispatchConfigs[eventName] = dispatchConfig;\n\n var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;\n if (phasedRegistrationNames) {\n for (var phaseName in phasedRegistrationNames) {\n if (phasedRegistrationNames.hasOwnProperty(phaseName)) {\n var phasedRegistrationName = phasedRegistrationNames[phaseName];\n publishRegistrationName(phasedRegistrationName, pluginModule, eventName);\n }\n }\n return true;\n } else if (dispatchConfig.registrationName) {\n publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName);\n return true;\n }\n return false;\n}\n\n/**\n * Publishes a registration name that is used to identify dispatched events.\n *\n * @param {string} registrationName Registration name to add.\n * @param {object} PluginModule Plugin publishing the event.\n * @private\n */\nfunction publishRegistrationName(registrationName, pluginModule, eventName) {\n !!registrationNameModules[registrationName] ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same registration name, `%s`.', registrationName) : void 0;\n registrationNameModules[registrationName] = pluginModule;\n registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies;\n\n {\n var lowerCasedName = registrationName.toLowerCase();\n possibleRegistrationNames[lowerCasedName] = registrationName;\n\n if (registrationName === 'onDoubleClick') {\n possibleRegistrationNames.ondblclick = registrationName;\n }\n }\n}\n\n/**\n * Registers plugins so that they can extract and dispatch events.\n *\n * @see {EventPluginHub}\n */\n\n/**\n * Ordered list of injected plugins.\n */\nvar plugins = [];\n\n/**\n * Mapping from event name to dispatch config\n */\nvar eventNameDispatchConfigs = {};\n\n/**\n * Mapping from registration name to plugin module\n */\nvar registrationNameModules = {};\n\n/**\n * Mapping from registration name to event name\n */\nvar registrationNameDependencies = {};\n\n/**\n * Mapping from lowercase registration names to the properly cased version,\n * used to warn in the case of missing event handlers. Available\n * only in true.\n * @type {Object}\n */\nvar possibleRegistrationNames = {};\n// Trust the developer to only use possibleRegistrationNames in true\n\n/**\n * Injects an ordering of plugins (by plugin name). This allows the ordering\n * to be decoupled from injection of the actual plugins so that ordering is\n * always deterministic regardless of packaging, on-the-fly injection, etc.\n *\n * @param {array} InjectedEventPluginOrder\n * @internal\n * @see {EventPluginHub.injection.injectEventPluginOrder}\n */\nfunction injectEventPluginOrder(injectedEventPluginOrder) {\n !!eventPluginOrder ? invariant(false, 'EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React.') : void 0;\n // Clone the ordering so it cannot be dynamically mutated.\n eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder);\n recomputePluginOrdering();\n}\n\n/**\n * Injects plugins to be used by `EventPluginHub`. The plugin names must be\n * in the ordering injected by `injectEventPluginOrder`.\n *\n * Plugins can be injected as part of page initialization or on-the-fly.\n *\n * @param {object} injectedNamesToPlugins Map from names to plugin modules.\n * @internal\n * @see {EventPluginHub.injection.injectEventPluginsByName}\n */\nfunction injectEventPluginsByName(injectedNamesToPlugins) {\n var isOrderingDirty = false;\n for (var pluginName in injectedNamesToPlugins) {\n if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {\n continue;\n }\n var pluginModule = injectedNamesToPlugins[pluginName];\n if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) {\n !!namesToPlugins[pluginName] ? invariant(false, 'EventPluginRegistry: Cannot inject two different event plugins using the same name, `%s`.', pluginName) : void 0;\n namesToPlugins[pluginName] = pluginModule;\n isOrderingDirty = true;\n }\n }\n if (isOrderingDirty) {\n recomputePluginOrdering();\n }\n}\n\nvar EventPluginRegistry = Object.freeze({\n\tplugins: plugins,\n\teventNameDispatchConfigs: eventNameDispatchConfigs,\n\tregistrationNameModules: registrationNameModules,\n\tregistrationNameDependencies: registrationNameDependencies,\n\tpossibleRegistrationNames: possibleRegistrationNames,\n\tinjectEventPluginOrder: injectEventPluginOrder,\n\tinjectEventPluginsByName: injectEventPluginsByName\n});\n\nvar getFiberCurrentPropsFromNode = null;\nvar getInstanceFromNode = null;\nvar getNodeFromInstance = null;\n\nvar injection$2 = {\n injectComponentTree: function (Injected) {\n getFiberCurrentPropsFromNode = Injected.getFiberCurrentPropsFromNode;\n getInstanceFromNode = Injected.getInstanceFromNode;\n getNodeFromInstance = Injected.getNodeFromInstance;\n\n {\n warning(getNodeFromInstance && getInstanceFromNode, 'EventPluginUtils.injection.injectComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.');\n }\n }\n};\n\n\n\n\n\n\nvar validateEventDispatches;\n{\n validateEventDispatches = function (event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n\n var listenersIsArr = Array.isArray(dispatchListeners);\n var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;\n\n var instancesIsArr = Array.isArray(dispatchInstances);\n var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0;\n\n warning(instancesIsArr === listenersIsArr && instancesLen === listenersLen, 'EventPluginUtils: Invalid `event`.');\n };\n}\n\n/**\n * Dispatch the event to the listener.\n * @param {SyntheticEvent} event SyntheticEvent to handle\n * @param {boolean} simulated If the event is simulated (changes exn behavior)\n * @param {function} listener Application-level callback\n * @param {*} inst Internal component instance\n */\nfunction executeDispatch(event, simulated, listener, inst) {\n var type = event.type || 'unknown-event';\n event.currentTarget = getNodeFromInstance(inst);\n ReactErrorUtils.invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event);\n event.currentTarget = null;\n}\n\n/**\n * Standard/simple iteration through an event's collected dispatches.\n */\nfunction executeDispatchesInOrder(event, simulated) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and Instances are two parallel arrays that are always in sync.\n executeDispatch(event, simulated, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, simulated, dispatchListeners, dispatchInstances);\n }\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n}\n\n/**\n * @see executeDispatchesInOrderStopAtTrueImpl\n */\n\n\n/**\n * Execution of a \"direct\" dispatch - there must be at most one dispatch\n * accumulated on the event or it is considered an error. It doesn't really make\n * sense for an event with multiple dispatches (bubbled) to keep track of the\n * return values at each dispatch execution, but it does tend to make sense when\n * dealing with \"direct\" dispatches.\n *\n * @return {*} The return value of executing the single dispatch.\n */\n\n\n/**\n * @param {SyntheticEvent} event\n * @return {boolean} True iff number of dispatches accumulated is greater than 0.\n */\n\n/**\n * Accumulates items that must not be null or undefined into the first one. This\n * is used to conserve memory by avoiding array allocations, and thus sacrifices\n * API cleanness. Since `current` can be null before being passed in and not\n * null after this function, make sure to assign it back to `current`:\n *\n * `a = accumulateInto(a, b);`\n *\n * This API should be sparingly used. Try `accumulate` for something cleaner.\n *\n * @return {*|array<*>} An accumulation of items.\n */\n\nfunction accumulateInto(current, next) {\n !(next != null) ? invariant(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : void 0;\n\n if (current == null) {\n return next;\n }\n\n // Both are not empty. Warning: Never call x.concat(y) when you are not\n // certain that x is an Array (x could be a string with concat method).\n if (Array.isArray(current)) {\n if (Array.isArray(next)) {\n current.push.apply(current, next);\n return current;\n }\n current.push(next);\n return current;\n }\n\n if (Array.isArray(next)) {\n // A bit too dangerous to mutate `next`.\n return [current].concat(next);\n }\n\n return [current, next];\n}\n\n/**\n * @param {array} arr an \"accumulation\" of items which is either an Array or\n * a single item. Useful when paired with the `accumulate` module. This is a\n * simple utility that allows us to reason about a collection of items, but\n * handling the case when there is exactly one item (and we do not need to\n * allocate an array).\n * @param {function} cb Callback invoked with each element or a collection.\n * @param {?} [scope] Scope used as `this` in a callback.\n */\nfunction forEachAccumulated(arr, cb, scope) {\n if (Array.isArray(arr)) {\n arr.forEach(cb, scope);\n } else if (arr) {\n cb.call(scope, arr);\n }\n}\n\n/**\n * Internal queue of events that have accumulated their dispatches and are\n * waiting to have their dispatches executed.\n */\nvar eventQueue = null;\n\n/**\n * Dispatches an event and releases it back into the pool, unless persistent.\n *\n * @param {?object} event Synthetic event to be dispatched.\n * @param {boolean} simulated If the event is simulated (changes exn behavior)\n * @private\n */\nvar executeDispatchesAndRelease = function (event, simulated) {\n if (event) {\n executeDispatchesInOrder(event, simulated);\n\n if (!event.isPersistent()) {\n event.constructor.release(event);\n }\n }\n};\nvar executeDispatchesAndReleaseSimulated = function (e) {\n return executeDispatchesAndRelease(e, true);\n};\nvar executeDispatchesAndReleaseTopLevel = function (e) {\n return executeDispatchesAndRelease(e, false);\n};\n\nfunction isInteractive(tag) {\n return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea';\n}\n\nfunction shouldPreventMouseEvent(name, type, props) {\n switch (name) {\n case 'onClick':\n case 'onClickCapture':\n case 'onDoubleClick':\n case 'onDoubleClickCapture':\n case 'onMouseDown':\n case 'onMouseDownCapture':\n case 'onMouseMove':\n case 'onMouseMoveCapture':\n case 'onMouseUp':\n case 'onMouseUpCapture':\n return !!(props.disabled && isInteractive(type));\n default:\n return false;\n }\n}\n\n/**\n * This is a unified interface for event plugins to be installed and configured.\n *\n * Event plugins can implement the following properties:\n *\n * `extractEvents` {function(string, DOMEventTarget, string, object): *}\n * Required. When a top-level event is fired, this method is expected to\n * extract synthetic events that will in turn be queued and dispatched.\n *\n * `eventTypes` {object}\n * Optional, plugins that fire events must publish a mapping of registration\n * names that are used to register listeners. Values of this mapping must\n * be objects that contain `registrationName` or `phasedRegistrationNames`.\n *\n * `executeDispatch` {function(object, function, string)}\n * Optional, allows plugins to override how an event gets dispatched. By\n * default, the listener is simply invoked.\n *\n * Each plugin that is injected into `EventsPluginHub` is immediately operable.\n *\n * @public\n */\n\n/**\n * Methods for injecting dependencies.\n */\nvar injection$1 = {\n /**\n * @param {array} InjectedEventPluginOrder\n * @public\n */\n injectEventPluginOrder: injectEventPluginOrder,\n\n /**\n * @param {object} injectedNamesToPlugins Map from names to plugin modules.\n */\n injectEventPluginsByName: injectEventPluginsByName\n};\n\n/**\n * @param {object} inst The instance, which is the source of events.\n * @param {string} registrationName Name of listener (e.g. `onClick`).\n * @return {?function} The stored callback.\n */\nfunction getListener(inst, registrationName) {\n var listener;\n\n // TODO: shouldPreventMouseEvent is DOM-specific and definitely should not\n // live here; needs to be moved to a better place soon\n var stateNode = inst.stateNode;\n if (!stateNode) {\n // Work in progress (ex: onload events in incremental mode).\n return null;\n }\n var props = getFiberCurrentPropsFromNode(stateNode);\n if (!props) {\n // Work in progress.\n return null;\n }\n listener = props[registrationName];\n if (shouldPreventMouseEvent(registrationName, inst.type, props)) {\n return null;\n }\n !(!listener || typeof listener === 'function') ? invariant(false, 'Expected `%s` listener to be a function, instead got a value of `%s` type.', registrationName, typeof listener) : void 0;\n return listener;\n}\n\n/**\n * Allows registered plugins an opportunity to extract events from top-level\n * native browser events.\n *\n * @return {*} An accumulation of synthetic events.\n * @internal\n */\nfunction extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget) {\n var events;\n for (var i = 0; i < plugins.length; i++) {\n // Not every plugin in the ordering may be loaded at runtime.\n var possiblePlugin = plugins[i];\n if (possiblePlugin) {\n var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);\n if (extractedEvents) {\n events = accumulateInto(events, extractedEvents);\n }\n }\n }\n return events;\n}\n\n/**\n * Enqueues a synthetic event that should be dispatched when\n * `processEventQueue` is invoked.\n *\n * @param {*} events An accumulation of synthetic events.\n * @internal\n */\nfunction enqueueEvents(events) {\n if (events) {\n eventQueue = accumulateInto(eventQueue, events);\n }\n}\n\n/**\n * Dispatches all synthetic events on the event queue.\n *\n * @internal\n */\nfunction processEventQueue(simulated) {\n // Set `eventQueue` to null before processing it so that we can tell if more\n // events get enqueued while processing.\n var processingEventQueue = eventQueue;\n eventQueue = null;\n\n if (!processingEventQueue) {\n return;\n }\n\n if (simulated) {\n forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated);\n } else {\n forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);\n }\n !!eventQueue ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.') : void 0;\n // This would be a good time to rethrow if any of the event handlers threw.\n ReactErrorUtils.rethrowCaughtError();\n}\n\nvar EventPluginHub = Object.freeze({\n\tinjection: injection$1,\n\tgetListener: getListener,\n\textractEvents: extractEvents,\n\tenqueueEvents: enqueueEvents,\n\tprocessEventQueue: processEventQueue\n});\n\nvar IndeterminateComponent = 0; // Before we know whether it is functional or class\nvar FunctionalComponent = 1;\nvar ClassComponent = 2;\nvar HostRoot = 3; // Root of a host tree. Could be nested inside another node.\nvar HostPortal = 4; // A subtree. Could be an entry point to a different renderer.\nvar HostComponent = 5;\nvar HostText = 6;\nvar CallComponent = 7;\nvar CallHandlerPhase = 8;\nvar ReturnComponent = 9;\nvar Fragment = 10;\n\nvar randomKey = Math.random().toString(36).slice(2);\nvar internalInstanceKey = '__reactInternalInstance$' + randomKey;\nvar internalEventHandlersKey = '__reactEventHandlers$' + randomKey;\n\nfunction precacheFiberNode$1(hostInst, node) {\n node[internalInstanceKey] = hostInst;\n}\n\n/**\n * Given a DOM node, return the closest ReactDOMComponent or\n * ReactDOMTextComponent instance ancestor.\n */\nfunction getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n // Walk up the tree until we find an ancestor whose instance we have cached.\n var parents = [];\n while (!node[internalInstanceKey]) {\n parents.push(node);\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var closest = void 0;\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n for (; node && (inst = node[internalInstanceKey]); node = parents.pop()) {\n closest = inst;\n }\n\n return closest;\n}\n\n/**\n * Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent\n * instance, or null if the node was not rendered by this React.\n */\nfunction getInstanceFromNode$1(node) {\n var inst = node[internalInstanceKey];\n if (inst) {\n if (inst.tag === HostComponent || inst.tag === HostText) {\n return inst;\n } else {\n return null;\n }\n }\n return null;\n}\n\n/**\n * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding\n * DOM node.\n */\nfunction getNodeFromInstance$1(inst) {\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber this, is just the state node right now. We assume it will be\n // a host component or host text.\n return inst.stateNode;\n }\n\n // Without this first invariant, passing a non-DOM-component triggers the next\n // invariant for a missing parent, which is super confusing.\n invariant(false, 'getNodeFromInstance: Invalid argument.');\n}\n\nfunction getFiberCurrentPropsFromNode$1(node) {\n return node[internalEventHandlersKey] || null;\n}\n\nfunction updateFiberProps$1(node, props) {\n node[internalEventHandlersKey] = props;\n}\n\nvar ReactDOMComponentTree = Object.freeze({\n\tprecacheFiberNode: precacheFiberNode$1,\n\tgetClosestInstanceFromNode: getClosestInstanceFromNode,\n\tgetInstanceFromNode: getInstanceFromNode$1,\n\tgetNodeFromInstance: getNodeFromInstance$1,\n\tgetFiberCurrentPropsFromNode: getFiberCurrentPropsFromNode$1,\n\tupdateFiberProps: updateFiberProps$1\n});\n\nfunction getParent(inst) {\n do {\n inst = inst['return'];\n // TODO: If this is a HostRoot we might want to bail out.\n // That is depending on if we want nested subtrees (layers) to bubble\n // events to their parent. We could also go through parentNode on the\n // host node but that wouldn't work for React Native and doesn't let us\n // do the portal feature.\n } while (inst && inst.tag !== HostComponent);\n if (inst) {\n return inst;\n }\n return null;\n}\n\n/**\n * Return the lowest common ancestor of A and B, or null if they are in\n * different trees.\n */\nfunction getLowestCommonAncestor(instA, instB) {\n var depthA = 0;\n for (var tempA = instA; tempA; tempA = getParent(tempA)) {\n depthA++;\n }\n var depthB = 0;\n for (var tempB = instB; tempB; tempB = getParent(tempB)) {\n depthB++;\n }\n\n // If A is deeper, crawl up.\n while (depthA - depthB > 0) {\n instA = getParent(instA);\n depthA--;\n }\n\n // If B is deeper, crawl up.\n while (depthB - depthA > 0) {\n instB = getParent(instB);\n depthB--;\n }\n\n // Walk in lockstep until we find a match.\n var depth = depthA;\n while (depth--) {\n if (instA === instB || instA === instB.alternate) {\n return instA;\n }\n instA = getParent(instA);\n instB = getParent(instB);\n }\n return null;\n}\n\n/**\n * Return if A is an ancestor of B.\n */\n\n\n/**\n * Return the parent instance of the passed-in instance.\n */\nfunction getParentInstance(inst) {\n return getParent(inst);\n}\n\n/**\n * Simulates the traversal of a two-phase, capture/bubble event dispatch.\n */\nfunction traverseTwoPhase(inst, fn, arg) {\n var path = [];\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n var i;\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n}\n\n/**\n * Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that\n * should would receive a `mouseEnter` or `mouseLeave` event.\n *\n * Does not invoke the callback on the nearest common ancestor because nothing\n * \"entered\" or \"left\" that element.\n */\nfunction traverseEnterLeave(from, to, fn, argFrom, argTo) {\n var common = from && to ? getLowestCommonAncestor(from, to) : null;\n var pathFrom = [];\n while (true) {\n if (!from) {\n break;\n }\n if (from === common) {\n break;\n }\n var alternate = from.alternate;\n if (alternate !== null && alternate === common) {\n break;\n }\n pathFrom.push(from);\n from = getParent(from);\n }\n var pathTo = [];\n while (true) {\n if (!to) {\n break;\n }\n if (to === common) {\n break;\n }\n var _alternate = to.alternate;\n if (_alternate !== null && _alternate === common) {\n break;\n }\n pathTo.push(to);\n to = getParent(to);\n }\n for (var i = 0; i < pathFrom.length; i++) {\n fn(pathFrom[i], 'bubbled', argFrom);\n }\n for (var _i = pathTo.length; _i-- > 0;) {\n fn(pathTo[_i], 'captured', argTo);\n }\n}\n\n/**\n * Some event types have a notion of different registration names for different\n * \"phases\" of propagation. This finds listeners by a given phase.\n */\nfunction listenerAtPhase(inst, event, propagationPhase) {\n var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n return getListener(inst, registrationName);\n}\n\n/**\n * A small set of propagation patterns, each of which will accept a small amount\n * of information, and generate a set of \"dispatch ready event objects\" - which\n * are sets of events that have already been annotated with a set of dispatched\n * listener functions/ids. The API is designed this way to discourage these\n * propagation strategies from actually executing the dispatches, since we\n * always want to collect the entire set of dispatches before executing even a\n * single one.\n */\n\n/**\n * Tags a `SyntheticEvent` with dispatched listeners. Creating this function\n * here, allows us to not have to bind or create functions for each event.\n * Mutating the event's members allows us to not have to create a wrapping\n * \"dispatch\" object that pairs the event with the listener.\n */\nfunction accumulateDirectionalDispatches(inst, phase, event) {\n {\n warning(inst, 'Dispatching inst must not be null');\n }\n var listener = listenerAtPhase(inst, event, phase);\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n}\n\n/**\n * Collect dispatches (must be entirely collected before dispatching - see unit\n * tests). Lazily allocate the array to conserve memory. We must loop through\n * each event and perform the traversal for each one. We cannot perform a\n * single traversal for the entire collection of events because each event may\n * have a different target.\n */\nfunction accumulateTwoPhaseDispatchesSingle(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n }\n}\n\n/**\n * Same as `accumulateTwoPhaseDispatchesSingle`, but skips over the targetID.\n */\nfunction accumulateTwoPhaseDispatchesSingleSkipTarget(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n var targetInst = event._targetInst;\n var parentInst = targetInst ? getParentInstance(targetInst) : null;\n traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);\n }\n}\n\n/**\n * Accumulates without regard to direction, does not look for phased\n * registration names. Same as `accumulateDirectDispatchesSingle` but without\n * requiring that the `dispatchMarker` be the same as the dispatched ID.\n */\nfunction accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n}\n\n/**\n * Accumulates dispatches on an `SyntheticEvent`, but only for the\n * `dispatchMarker`.\n * @param {SyntheticEvent} event\n */\nfunction accumulateDirectDispatchesSingle(event) {\n if (event && event.dispatchConfig.registrationName) {\n accumulateDispatches(event._targetInst, null, event);\n }\n}\n\nfunction accumulateTwoPhaseDispatches(events) {\n forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);\n}\n\nfunction accumulateTwoPhaseDispatchesSkipTarget(events) {\n forEachAccumulated(events, accumulateTwoPhaseDispatchesSingleSkipTarget);\n}\n\nfunction accumulateEnterLeaveDispatches(leave, enter, from, to) {\n traverseEnterLeave(from, to, accumulateDispatches, leave, enter);\n}\n\nfunction accumulateDirectDispatches(events) {\n forEachAccumulated(events, accumulateDirectDispatchesSingle);\n}\n\nvar EventPropagators = Object.freeze({\n\taccumulateTwoPhaseDispatches: accumulateTwoPhaseDispatches,\n\taccumulateTwoPhaseDispatchesSkipTarget: accumulateTwoPhaseDispatchesSkipTarget,\n\taccumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches,\n\taccumulateDirectDispatches: accumulateDirectDispatches\n});\n\nvar contentKey = null;\n\n/**\n * Gets the key used to access text content on a DOM node.\n *\n * @return {?string} Key used to access text content.\n * @internal\n */\nfunction getTextContentAccessor() {\n if (!contentKey && ExecutionEnvironment.canUseDOM) {\n // Prefer textContent to innerText because many browsers support both but\n // SVG elements don't support innerText even when
does.\n contentKey = 'textContent' in document.documentElement ? 'textContent' : 'innerText';\n }\n return contentKey;\n}\n\n/**\n * This helper object stores information about text content of a target node,\n * allowing comparison of content before and after a given event.\n *\n * Identify the node where selection currently begins, then observe\n * both its text content and its current position in the DOM. Since the\n * browser may natively replace the target node during composition, we can\n * use its position to find its replacement.\n *\n *\n */\nvar compositionState = {\n _root: null,\n _startText: null,\n _fallbackText: null\n};\n\nfunction initialize(nativeEventTarget) {\n compositionState._root = nativeEventTarget;\n compositionState._startText = getText();\n return true;\n}\n\nfunction reset() {\n compositionState._root = null;\n compositionState._startText = null;\n compositionState._fallbackText = null;\n}\n\nfunction getData() {\n if (compositionState._fallbackText) {\n return compositionState._fallbackText;\n }\n\n var start;\n var startValue = compositionState._startText;\n var startLength = startValue.length;\n var end;\n var endValue = getText();\n var endLength = endValue.length;\n\n for (start = 0; start < startLength; start++) {\n if (startValue[start] !== endValue[start]) {\n break;\n }\n }\n\n var minEnd = startLength - start;\n for (end = 1; end <= minEnd; end++) {\n if (startValue[startLength - end] !== endValue[endLength - end]) {\n break;\n }\n }\n\n var sliceTail = end > 1 ? 1 - end : undefined;\n compositionState._fallbackText = endValue.slice(start, sliceTail);\n return compositionState._fallbackText;\n}\n\nfunction getText() {\n if ('value' in compositionState._root) {\n return compositionState._root.value;\n }\n return compositionState._root[getTextContentAccessor()];\n}\n\n/* eslint valid-typeof: 0 */\n\nvar didWarnForAddedNewProperty = false;\nvar isProxySupported = typeof Proxy === 'function';\nvar EVENT_POOL_SIZE = 10;\n\nvar shouldBeReleasedProperties = ['dispatchConfig', '_targetInst', 'nativeEvent', 'isDefaultPrevented', 'isPropagationStopped', '_dispatchListeners', '_dispatchInstances'];\n\n/**\n * @interface Event\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\nvar EventInterface = {\n type: null,\n target: null,\n // currentTarget is set when dispatching; no use in copying it here\n currentTarget: emptyFunction.thatReturnsNull,\n eventPhase: null,\n bubbles: null,\n cancelable: null,\n timeStamp: function (event) {\n return event.timeStamp || Date.now();\n },\n defaultPrevented: null,\n isTrusted: null\n};\n\n/**\n * Synthetic events are dispatched by event plugins, typically in response to a\n * top-level event delegation handler.\n *\n * These systems should generally use pooling to reduce the frequency of garbage\n * collection. The system should check `isPersistent` to determine whether the\n * event should be released into the pool after being dispatched. Users that\n * need a persisted event should invoke `persist`.\n *\n * Synthetic events (and subclasses) implement the DOM Level 3 Events API by\n * normalizing browser quirks. Subclasses do not necessarily have to implement a\n * DOM interface; custom application-specific events can also subclass this.\n *\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {*} targetInst Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @param {DOMEventTarget} nativeEventTarget Target node.\n */\nfunction SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) {\n {\n // these have a getter/setter for warnings\n delete this.nativeEvent;\n delete this.preventDefault;\n delete this.stopPropagation;\n }\n\n this.dispatchConfig = dispatchConfig;\n this._targetInst = targetInst;\n this.nativeEvent = nativeEvent;\n\n var Interface = this.constructor.Interface;\n for (var propName in Interface) {\n if (!Interface.hasOwnProperty(propName)) {\n continue;\n }\n {\n delete this[propName]; // this has a getter/setter for warnings\n }\n var normalize = Interface[propName];\n if (normalize) {\n this[propName] = normalize(nativeEvent);\n } else {\n if (propName === 'target') {\n this.target = nativeEventTarget;\n } else {\n this[propName] = nativeEvent[propName];\n }\n }\n }\n\n var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;\n if (defaultPrevented) {\n this.isDefaultPrevented = emptyFunction.thatReturnsTrue;\n } else {\n this.isDefaultPrevented = emptyFunction.thatReturnsFalse;\n }\n this.isPropagationStopped = emptyFunction.thatReturnsFalse;\n return this;\n}\n\n_assign(SyntheticEvent.prototype, {\n preventDefault: function () {\n this.defaultPrevented = true;\n var event = this.nativeEvent;\n if (!event) {\n return;\n }\n\n if (event.preventDefault) {\n event.preventDefault();\n } else if (typeof event.returnValue !== 'unknown') {\n event.returnValue = false;\n }\n this.isDefaultPrevented = emptyFunction.thatReturnsTrue;\n },\n\n stopPropagation: function () {\n var event = this.nativeEvent;\n if (!event) {\n return;\n }\n\n if (event.stopPropagation) {\n event.stopPropagation();\n } else if (typeof event.cancelBubble !== 'unknown') {\n // The ChangeEventPlugin registers a \"propertychange\" event for\n // IE. This event does not support bubbling or cancelling, and\n // any references to cancelBubble throw \"Member not found\". A\n // typeof check of \"unknown\" circumvents this issue (and is also\n // IE specific).\n event.cancelBubble = true;\n }\n\n this.isPropagationStopped = emptyFunction.thatReturnsTrue;\n },\n\n /**\n * We release all dispatched `SyntheticEvent`s after each event loop, adding\n * them back into the pool. This allows a way to hold onto a reference that\n * won't be added back into the pool.\n */\n persist: function () {\n this.isPersistent = emptyFunction.thatReturnsTrue;\n },\n\n /**\n * Checks if this event should be released back into the pool.\n *\n * @return {boolean} True if this should not be released, false otherwise.\n */\n isPersistent: emptyFunction.thatReturnsFalse,\n\n /**\n * `PooledClass` looks for `destructor` on each instance it releases.\n */\n destructor: function () {\n var Interface = this.constructor.Interface;\n for (var propName in Interface) {\n {\n Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));\n }\n }\n for (var i = 0; i < shouldBeReleasedProperties.length; i++) {\n this[shouldBeReleasedProperties[i]] = null;\n }\n {\n Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));\n Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', emptyFunction));\n Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', emptyFunction));\n }\n }\n});\n\nSyntheticEvent.Interface = EventInterface;\n\n/**\n * Helper to reduce boilerplate when creating subclasses.\n *\n * @param {function} Class\n * @param {?object} Interface\n */\nSyntheticEvent.augmentClass = function (Class, Interface) {\n var Super = this;\n\n var E = function () {};\n E.prototype = Super.prototype;\n var prototype = new E();\n\n _assign(prototype, Class.prototype);\n Class.prototype = prototype;\n Class.prototype.constructor = Class;\n\n Class.Interface = _assign({}, Super.Interface, Interface);\n Class.augmentClass = Super.augmentClass;\n addEventPoolingTo(Class);\n};\n\n/** Proxying after everything set on SyntheticEvent\n * to resolve Proxy issue on some WebKit browsers\n * in which some Event properties are set to undefined (GH#10010)\n */\n{\n if (isProxySupported) {\n /*eslint-disable no-func-assign */\n SyntheticEvent = new Proxy(SyntheticEvent, {\n construct: function (target, args) {\n return this.apply(target, Object.create(target.prototype), args);\n },\n apply: function (constructor, that, args) {\n return new Proxy(constructor.apply(that, args), {\n set: function (target, prop, value) {\n if (prop !== 'isPersistent' && !target.constructor.Interface.hasOwnProperty(prop) && shouldBeReleasedProperties.indexOf(prop) === -1) {\n warning(didWarnForAddedNewProperty || target.isPersistent(), \"This synthetic event is reused for performance reasons. If you're \" + \"seeing this, you're adding a new property in the synthetic event object. \" + 'The property is never released. See ' + 'https://fb.me/react-event-pooling for more information.');\n didWarnForAddedNewProperty = true;\n }\n target[prop] = value;\n return true;\n }\n });\n }\n });\n /*eslint-enable no-func-assign */\n }\n}\n\naddEventPoolingTo(SyntheticEvent);\n\n/**\n * Helper to nullify syntheticEvent instance properties when destructing\n *\n * @param {String} propName\n * @param {?object} getVal\n * @return {object} defineProperty object\n */\nfunction getPooledWarningPropertyDefinition(propName, getVal) {\n var isFunction = typeof getVal === 'function';\n return {\n configurable: true,\n set: set,\n get: get\n };\n\n function set(val) {\n var action = isFunction ? 'setting the method' : 'setting the property';\n warn(action, 'This is effectively a no-op');\n return val;\n }\n\n function get() {\n var action = isFunction ? 'accessing the method' : 'accessing the property';\n var result = isFunction ? 'This is a no-op function' : 'This is set to null';\n warn(action, result);\n return getVal;\n }\n\n function warn(action, result) {\n var warningCondition = false;\n warning(warningCondition, \"This synthetic event is reused for performance reasons. If you're seeing this, \" + \"you're %s `%s` on a released/nullified synthetic event. %s. \" + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result);\n }\n}\n\nfunction getPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) {\n var EventConstructor = this;\n if (EventConstructor.eventPool.length) {\n var instance = EventConstructor.eventPool.pop();\n EventConstructor.call(instance, dispatchConfig, targetInst, nativeEvent, nativeInst);\n return instance;\n }\n return new EventConstructor(dispatchConfig, targetInst, nativeEvent, nativeInst);\n}\n\nfunction releasePooledEvent(event) {\n var EventConstructor = this;\n !(event instanceof EventConstructor) ? invariant(false, 'Trying to release an event instance into a pool of a different type.') : void 0;\n event.destructor();\n if (EventConstructor.eventPool.length < EVENT_POOL_SIZE) {\n EventConstructor.eventPool.push(event);\n }\n}\n\nfunction addEventPoolingTo(EventConstructor) {\n EventConstructor.eventPool = [];\n EventConstructor.getPooled = getPooledEvent;\n EventConstructor.release = releasePooledEvent;\n}\n\nvar SyntheticEvent$1 = SyntheticEvent;\n\n/**\n * @interface Event\n * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents\n */\nvar CompositionEventInterface = {\n data: null\n};\n\n/**\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {string} dispatchMarker Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @extends {SyntheticEvent}\n */\nfunction SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {\n return SyntheticEvent$1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);\n}\n\nSyntheticEvent$1.augmentClass(SyntheticCompositionEvent, CompositionEventInterface);\n\n/**\n * @interface Event\n * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105\n * /#events-inputevents\n */\nvar InputEventInterface = {\n data: null\n};\n\n/**\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {string} dispatchMarker Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @extends {SyntheticEvent}\n */\nfunction SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {\n return SyntheticEvent$1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);\n}\n\nSyntheticEvent$1.augmentClass(SyntheticInputEvent, InputEventInterface);\n\nvar END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space\nvar START_KEYCODE = 229;\n\nvar canUseCompositionEvent = ExecutionEnvironment.canUseDOM && 'CompositionEvent' in window;\n\nvar documentMode = null;\nif (ExecutionEnvironment.canUseDOM && 'documentMode' in document) {\n documentMode = document.documentMode;\n}\n\n// Webkit offers a very useful `textInput` event that can be used to\n// directly represent `beforeInput`. The IE `textinput` event is not as\n// useful, so we don't use it.\nvar canUseTextInputEvent = ExecutionEnvironment.canUseDOM && 'TextEvent' in window && !documentMode && !isPresto();\n\n// In IE9+, we have access to composition events, but the data supplied\n// by the native compositionend event may be incorrect. Japanese ideographic\n// spaces, for instance (\\u3000) are not recorded correctly.\nvar useFallbackCompositionData = ExecutionEnvironment.canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);\n\n/**\n * Opera <= 12 includes TextEvent in window, but does not fire\n * text input events. Rely on keypress instead.\n */\nfunction isPresto() {\n var opera = window.opera;\n return typeof opera === 'object' && typeof opera.version === 'function' && parseInt(opera.version(), 10) <= 12;\n}\n\nvar SPACEBAR_CODE = 32;\nvar SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);\n\n// Events and their corresponding property names.\nvar eventTypes = {\n beforeInput: {\n phasedRegistrationNames: {\n bubbled: 'onBeforeInput',\n captured: 'onBeforeInputCapture'\n },\n dependencies: ['topCompositionEnd', 'topKeyPress', 'topTextInput', 'topPaste']\n },\n compositionEnd: {\n phasedRegistrationNames: {\n bubbled: 'onCompositionEnd',\n captured: 'onCompositionEndCapture'\n },\n dependencies: ['topBlur', 'topCompositionEnd', 'topKeyDown', 'topKeyPress', 'topKeyUp', 'topMouseDown']\n },\n compositionStart: {\n phasedRegistrationNames: {\n bubbled: 'onCompositionStart',\n captured: 'onCompositionStartCapture'\n },\n dependencies: ['topBlur', 'topCompositionStart', 'topKeyDown', 'topKeyPress', 'topKeyUp', 'topMouseDown']\n },\n compositionUpdate: {\n phasedRegistrationNames: {\n bubbled: 'onCompositionUpdate',\n captured: 'onCompositionUpdateCapture'\n },\n dependencies: ['topBlur', 'topCompositionUpdate', 'topKeyDown', 'topKeyPress', 'topKeyUp', 'topMouseDown']\n }\n};\n\n// Track whether we've ever handled a keypress on the space key.\nvar hasSpaceKeypress = false;\n\n/**\n * Return whether a native keypress event is assumed to be a command.\n * This is required because Firefox fires `keypress` events for key commands\n * (cut, copy, select-all, etc.) even though no character is inserted.\n */\nfunction isKeypressCommand(nativeEvent) {\n return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n !(nativeEvent.ctrlKey && nativeEvent.altKey);\n}\n\n/**\n * Translate native top level events into event types.\n *\n * @param {string} topLevelType\n * @return {object}\n */\nfunction getCompositionEventType(topLevelType) {\n switch (topLevelType) {\n case 'topCompositionStart':\n return eventTypes.compositionStart;\n case 'topCompositionEnd':\n return eventTypes.compositionEnd;\n case 'topCompositionUpdate':\n return eventTypes.compositionUpdate;\n }\n}\n\n/**\n * Does our fallback best-guess model think this event signifies that\n * composition has begun?\n *\n * @param {string} topLevelType\n * @param {object} nativeEvent\n * @return {boolean}\n */\nfunction isFallbackCompositionStart(topLevelType, nativeEvent) {\n return topLevelType === 'topKeyDown' && nativeEvent.keyCode === START_KEYCODE;\n}\n\n/**\n * Does our fallback mode think that this event is the end of composition?\n *\n * @param {string} topLevelType\n * @param {object} nativeEvent\n * @return {boolean}\n */\nfunction isFallbackCompositionEnd(topLevelType, nativeEvent) {\n switch (topLevelType) {\n case 'topKeyUp':\n // Command keys insert or clear IME input.\n return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;\n case 'topKeyDown':\n // Expect IME keyCode on each keydown. If we get any other\n // code we must have exited earlier.\n return nativeEvent.keyCode !== START_KEYCODE;\n case 'topKeyPress':\n case 'topMouseDown':\n case 'topBlur':\n // Events are not possible without cancelling IME.\n return true;\n default:\n return false;\n }\n}\n\n/**\n * Google Input Tools provides composition data via a CustomEvent,\n * with the `data` property populated in the `detail` object. If this\n * is available on the event object, use it. If not, this is a plain\n * composition event and we have nothing special to extract.\n *\n * @param {object} nativeEvent\n * @return {?string}\n */\nfunction getDataFromCustomEvent(nativeEvent) {\n var detail = nativeEvent.detail;\n if (typeof detail === 'object' && 'data' in detail) {\n return detail.data;\n }\n return null;\n}\n\n// Track the current IME composition status, if any.\nvar isComposing = false;\n\n/**\n * @return {?object} A SyntheticCompositionEvent.\n */\nfunction extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {\n var eventType;\n var fallbackData;\n\n if (canUseCompositionEvent) {\n eventType = getCompositionEventType(topLevelType);\n } else if (!isComposing) {\n if (isFallbackCompositionStart(topLevelType, nativeEvent)) {\n eventType = eventTypes.compositionStart;\n }\n } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) {\n eventType = eventTypes.compositionEnd;\n }\n\n if (!eventType) {\n return null;\n }\n\n if (useFallbackCompositionData) {\n // The current composition is stored statically and must not be\n // overwritten while composition continues.\n if (!isComposing && eventType === eventTypes.compositionStart) {\n isComposing = initialize(nativeEventTarget);\n } else if (eventType === eventTypes.compositionEnd) {\n if (isComposing) {\n fallbackData = getData();\n }\n }\n }\n\n var event = SyntheticCompositionEvent.getPooled(eventType, targetInst, nativeEvent, nativeEventTarget);\n\n if (fallbackData) {\n // Inject data generated from fallback path into the synthetic event.\n // This matches the property of native CompositionEventInterface.\n event.data = fallbackData;\n } else {\n var customData = getDataFromCustomEvent(nativeEvent);\n if (customData !== null) {\n event.data = customData;\n }\n }\n\n accumulateTwoPhaseDispatches(event);\n return event;\n}\n\n/**\n * @param {TopLevelTypes} topLevelType Record from `BrowserEventConstants`.\n * @param {object} nativeEvent Native browser event.\n * @return {?string} The string corresponding to this `beforeInput` event.\n */\nfunction getNativeBeforeInputChars(topLevelType, nativeEvent) {\n switch (topLevelType) {\n case 'topCompositionEnd':\n return getDataFromCustomEvent(nativeEvent);\n case 'topKeyPress':\n /**\n * If native `textInput` events are available, our goal is to make\n * use of them. However, there is a special case: the spacebar key.\n * In Webkit, preventing default on a spacebar `textInput` event\n * cancels character insertion, but it *also* causes the browser\n * to fall back to its default spacebar behavior of scrolling the\n * page.\n *\n * Tracking at:\n * https://code.google.com/p/chromium/issues/detail?id=355103\n *\n * To avoid this issue, use the keypress event as if no `textInput`\n * event is available.\n */\n var which = nativeEvent.which;\n if (which !== SPACEBAR_CODE) {\n return null;\n }\n\n hasSpaceKeypress = true;\n return SPACEBAR_CHAR;\n\n case 'topTextInput':\n // Record the characters to be added to the DOM.\n var chars = nativeEvent.data;\n\n // If it's a spacebar character, assume that we have already handled\n // it at the keypress level and bail immediately. Android Chrome\n // doesn't give us keycodes, so we need to blacklist it.\n if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {\n return null;\n }\n\n return chars;\n\n default:\n // For other native event types, do nothing.\n return null;\n }\n}\n\n/**\n * For browsers that do not provide the `textInput` event, extract the\n * appropriate string to use for SyntheticInputEvent.\n *\n * @param {string} topLevelType Record from `BrowserEventConstants`.\n * @param {object} nativeEvent Native browser event.\n * @return {?string} The fallback string for this `beforeInput` event.\n */\nfunction getFallbackBeforeInputChars(topLevelType, nativeEvent) {\n // If we are currently composing (IME) and using a fallback to do so,\n // try to extract the composed characters from the fallback object.\n // If composition event is available, we extract a string only at\n // compositionevent, otherwise extract it at fallback events.\n if (isComposing) {\n if (topLevelType === 'topCompositionEnd' || !canUseCompositionEvent && isFallbackCompositionEnd(topLevelType, nativeEvent)) {\n var chars = getData();\n reset();\n isComposing = false;\n return chars;\n }\n return null;\n }\n\n switch (topLevelType) {\n case 'topPaste':\n // If a paste event occurs after a keypress, throw out the input\n // chars. Paste events should not lead to BeforeInput events.\n return null;\n case 'topKeyPress':\n /**\n * As of v27, Firefox may fire keypress events even when no character\n * will be inserted. A few possibilities:\n *\n * - `which` is `0`. Arrow keys, Esc key, etc.\n *\n * - `which` is the pressed key code, but no char is available.\n * Ex: 'AltGr + d` in Polish. There is no modified character for\n * this key combination and no character is inserted into the\n * document, but FF fires the keypress for char code `100` anyway.\n * No `input` event will occur.\n *\n * - `which` is the pressed key code, but a command combination is\n * being used. Ex: `Cmd+C`. No character is inserted, and no\n * `input` event will occur.\n */\n if (!isKeypressCommand(nativeEvent)) {\n // IE fires the `keypress` event when a user types an emoji via\n // Touch keyboard of Windows. In such a case, the `char` property\n // holds an emoji character like `\\uD83D\\uDE0A`. Because its length\n // is 2, the property `which` does not represent an emoji correctly.\n // In such a case, we directly return the `char` property instead of\n // using `which`.\n if (nativeEvent.char && nativeEvent.char.length > 1) {\n return nativeEvent.char;\n } else if (nativeEvent.which) {\n return String.fromCharCode(nativeEvent.which);\n }\n }\n return null;\n case 'topCompositionEnd':\n return useFallbackCompositionData ? null : nativeEvent.data;\n default:\n return null;\n }\n}\n\n/**\n * Extract a SyntheticInputEvent for `beforeInput`, based on either native\n * `textInput` or fallback behavior.\n *\n * @return {?object} A SyntheticInputEvent.\n */\nfunction extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {\n var chars;\n\n if (canUseTextInputEvent) {\n chars = getNativeBeforeInputChars(topLevelType, nativeEvent);\n } else {\n chars = getFallbackBeforeInputChars(topLevelType, nativeEvent);\n }\n\n // If no characters are being inserted, no BeforeInput event should\n // be fired.\n if (!chars) {\n return null;\n }\n\n var event = SyntheticInputEvent.getPooled(eventTypes.beforeInput, targetInst, nativeEvent, nativeEventTarget);\n\n event.data = chars;\n accumulateTwoPhaseDispatches(event);\n return event;\n}\n\n/**\n * Create an `onBeforeInput` event to match\n * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.\n *\n * This event plugin is based on the native `textInput` event\n * available in Chrome, Safari, Opera, and IE. This event fires after\n * `onKeyPress` and `onCompositionEnd`, but before `onInput`.\n *\n * `beforeInput` is spec'd but not implemented in any browsers, and\n * the `input` event does not provide any useful information about what has\n * actually been added, contrary to the spec. Thus, `textInput` is the best\n * available event to identify the characters that have actually been inserted\n * into the target node.\n *\n * This plugin is also responsible for emitting `composition` events, thus\n * allowing us to share composition fallback code for both `beforeInput` and\n * `composition` event types.\n */\nvar BeforeInputEventPlugin = {\n eventTypes: eventTypes,\n\n extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {\n return [extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget), extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget)];\n }\n};\n\n// Use to restore controlled state after a change event has fired.\n\nvar fiberHostComponent = null;\n\nvar ReactControlledComponentInjection = {\n injectFiberControlledHostComponent: function (hostComponentImpl) {\n // The fiber implementation doesn't use dynamic dispatch so we need to\n // inject the implementation.\n fiberHostComponent = hostComponentImpl;\n }\n};\n\nvar restoreTarget = null;\nvar restoreQueue = null;\n\nfunction restoreStateOfTarget(target) {\n // We perform this translation at the end of the event loop so that we\n // always receive the correct fiber here\n var internalInstance = getInstanceFromNode(target);\n if (!internalInstance) {\n // Unmounted\n return;\n }\n !(fiberHostComponent && typeof fiberHostComponent.restoreControlledState === 'function') ? invariant(false, 'Fiber needs to be injected to handle a fiber target for controlled events. This error is likely caused by a bug in React. Please file an issue.') : void 0;\n var props = getFiberCurrentPropsFromNode(internalInstance.stateNode);\n fiberHostComponent.restoreControlledState(internalInstance.stateNode, internalInstance.type, props);\n}\n\nvar injection$3 = ReactControlledComponentInjection;\n\nfunction enqueueStateRestore(target) {\n if (restoreTarget) {\n if (restoreQueue) {\n restoreQueue.push(target);\n } else {\n restoreQueue = [target];\n }\n } else {\n restoreTarget = target;\n }\n}\n\nfunction restoreStateIfNeeded() {\n if (!restoreTarget) {\n return;\n }\n var target = restoreTarget;\n var queuedTargets = restoreQueue;\n restoreTarget = null;\n restoreQueue = null;\n\n restoreStateOfTarget(target);\n if (queuedTargets) {\n for (var i = 0; i < queuedTargets.length; i++) {\n restoreStateOfTarget(queuedTargets[i]);\n }\n }\n}\n\nvar ReactControlledComponent = Object.freeze({\n\tinjection: injection$3,\n\tenqueueStateRestore: enqueueStateRestore,\n\trestoreStateIfNeeded: restoreStateIfNeeded\n});\n\n// Used as a way to call batchedUpdates when we don't have a reference to\n// the renderer. Such as when we're dispatching events or if third party\n// libraries need to call batchedUpdates. Eventually, this API will go away when\n// everything is batched by default. We'll then have a similar API to opt-out of\n// scheduled work and instead do synchronous work.\n\n// Defaults\nvar fiberBatchedUpdates = function (fn, bookkeeping) {\n return fn(bookkeeping);\n};\n\nvar isNestingBatched = false;\nfunction batchedUpdates(fn, bookkeeping) {\n if (isNestingBatched) {\n // If we are currently inside another batch, we need to wait until it\n // fully completes before restoring state. Therefore, we add the target to\n // a queue of work.\n return fiberBatchedUpdates(fn, bookkeeping);\n }\n isNestingBatched = true;\n try {\n return fiberBatchedUpdates(fn, bookkeeping);\n } finally {\n // Here we wait until all updates have propagated, which is important\n // when using controlled components within layers:\n // https://github.com/facebook/react/issues/1698\n // Then we restore state of any controlled component.\n isNestingBatched = false;\n restoreStateIfNeeded();\n }\n}\n\nvar ReactGenericBatchingInjection = {\n injectFiberBatchedUpdates: function (_batchedUpdates) {\n fiberBatchedUpdates = _batchedUpdates;\n }\n};\n\nvar injection$4 = ReactGenericBatchingInjection;\n\n/**\n * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary\n */\nvar supportedInputTypes = {\n color: true,\n date: true,\n datetime: true,\n 'datetime-local': true,\n email: true,\n month: true,\n number: true,\n password: true,\n range: true,\n search: true,\n tel: true,\n text: true,\n time: true,\n url: true,\n week: true\n};\n\nfunction isTextInputElement(elem) {\n var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();\n\n if (nodeName === 'input') {\n return !!supportedInputTypes[elem.type];\n }\n\n if (nodeName === 'textarea') {\n return true;\n }\n\n return false;\n}\n\n/**\n * HTML nodeType values that represent the type of the node\n */\n\nvar ELEMENT_NODE = 1;\nvar TEXT_NODE = 3;\nvar COMMENT_NODE = 8;\nvar DOCUMENT_NODE = 9;\nvar DOCUMENT_FRAGMENT_NODE = 11;\n\n/**\n * Gets the target node from a native browser event by accounting for\n * inconsistencies in browser DOM APIs.\n *\n * @param {object} nativeEvent Native browser event.\n * @return {DOMEventTarget} Target node.\n */\nfunction getEventTarget(nativeEvent) {\n var target = nativeEvent.target || nativeEvent.srcElement || window;\n\n // Normalize SVG